org.globus.ogsa.impl.base.cas.server
Class CasQueryPortImpl

java.lang.Object
  extended byorg.globus.ogsa.impl.base.cas.server.CasQueryPortImpl
All Implemented Interfaces:
OperationProvider

public class CasQueryPortImpl
extends java.lang.Object
implements OperationProvider

Implementation of CAS Query interface


Constructor Summary
CasQueryPortImpl()
           
 
Method Summary
 CasObjectData[] findApplicablePolicy(java.lang.String type, java.lang.String name)
          Method to get all applicable policies
 org.globus.ogsa.base.cas.casTypes.SAMLAssertion getAssertion(SAMLAuthzQueryType[] queries, int lifetimeInSeconds)
          Method that generated an assertion with a list of AuthzDecisionStmt that represent the list of actions that are permitted.
 CasObjectData getCasObject(java.lang.String type, java.lang.String name)
          Method to get an object given its identifier
 java.lang.String[] getGroupMembers(java.lang.String groupType, java.lang.String groupName)
          Method that returns the group members as an array of string
 QName[] getOperations()
          Called during initialization when the Grid service needs to find out what operations are supported by this provider.
 void initialize(GridServiceBase base)
          Called when the operation provider is added to a grid service.
 java.lang.String[] list(java.lang.String type)
          Method to get a list of objects
 java.lang.String whoami()
          Method to get nickname of the user invoking the method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CasQueryPortImpl

public CasQueryPortImpl()
Method Detail

initialize

public void initialize(GridServiceBase base)
                throws GridServiceException
Description copied from interface: OperationProvider
Called when the operation provider is added to a grid service.

Specified by:
initialize in interface OperationProvider
Parameters:
base - the service this provider is being associated with
Throws:
GridServiceException - if the initialization (and service creation is to be aborted)

getOperations

public QName[] getOperations()
Description copied from interface: OperationProvider
Called during initialization when the Grid service needs to find out what operations are supported by this provider.

Specified by:
getOperations in interface OperationProvider
Returns:
an array of operation qnames as defined in WSDL. An OperationProvider can use the empty string "" to denote that all operations with a certain local name are implemented. Similarly the wildcard "*" can be used in the local part of the qname to denote that all operations within a certain namespace are implemented. Combining these two approaches and returning: new QName[] {new QName("","*")}, will result in all incoming operations being redirected to this provider (apart from the OGSI defined GridService interface operations provided by the GridServiceBase implementation. Note that individual operations in the OGSI namespace could still be overridded with this approach, but not using the 'all namespaces and all operation' wildcard.

whoami

public java.lang.String whoami()
                        throws CasFault
Method to get nickname of the user invoking the method

Returns:
user name of the user invoking the method
Throws:
CasFault - if any other error occurs.

findApplicablePolicy

public CasObjectData[] findApplicablePolicy(java.lang.String type,
                                            java.lang.String name)
                                     throws CasFault,
                                            NoPermissionFault
Method to get all applicable policies

Parameters:
type - type of object whose policy is needed trustAnchor/namespace/user/userGroup/object/objectGroup/ serviceType, serviceTypeAction/serviceActionGroup
name - identifier for the object trustAnchorNickname/namespaceNickname/userNickname/userGroupName/ object(namespace|name)/objectGroupName/serviceTypeName/ serviceTypeAction(serviceType/action)/serviceActionGroupName
Returns:
an array of PolicyData
Throws:
NoPermissionFault - if the client does not have permission to perform this operation.
CasFault - if any other error occurs.

list

public java.lang.String[] list(java.lang.String type)
                        throws CasFault,
                               NoPermissionFault
Method to get a list of objects

Parameters:
type - type of object "user" or "userGroup" or "object" or "objectGroup" or "serviceAction" or "serviceActionGroup" or "serviceType" or "namespace" or "trustAnchor" or "policy"
Returns:
list of objects of the particular type
Throws:
NoPermissionFault - if the client does not have permission to perform this operation.
CasFault - if any other error occurs.

getCasObject

public CasObjectData getCasObject(java.lang.String type,
                                  java.lang.String name)
                           throws CasFault,
                                  NoPermissionFault
Method to get an object given its identifier

Parameters:
type - type of object "user" or "userGroup" or "object" or "objectGroup" or "serviceType" or "trustAnchor" or "namespace" or "policy"
name - name that identifies the object userName, userGroupName, object(objectNamespace|objectName), objectGroupName, serviceTypeName, trustAnchorNick, namespaceNick, policyId
Returns:
returns the CasObject that represents the object of type "type" and name. Returns null if such an object does not exist
Throws:
NoPermissionFault - if the client does not have permission to perform this operation.
CasFault - if any other error occurs.

getGroupMembers

public java.lang.String[] getGroupMembers(java.lang.String groupType,
                                          java.lang.String groupName)
                                   throws CasFault,
                                          NoPermissionFault
Method that returns the group members as an array of string

Parameters:
groupType - Type of group. Should be "user" or "object" or "serviceAction"
groupName - Name of the group whose members are to be retrieved
Returns:
Group member identifiers as an array of strings
Throws:
NoPermissionFault - if the client does not have permission to perform this operation.
CasFault - if any other error occurs.

getAssertion

public org.globus.ogsa.base.cas.casTypes.SAMLAssertion getAssertion(SAMLAuthzQueryType[] queries,
                                                                    int lifetimeInSeconds)
                                                             throws CasFault,
                                                                    NoPermissionFault
Method that generated an assertion with a list of AuthzDecisionStmt that represent the list of actions that are permitted.

Parameters:
lifetimeInSeconds - Requested lifetime on the assertion in seconds
Returns:
SAMLAsssertion A SAMLAssertion object with SAMLAuthorizationDecisionStatement(s) (OpenSAML datatype is passed as xsd:any)
Throws:
NoPermissionFault - if the client does not have permission to perform this operation.
CasFault - if any error occurs.