org.globus.wsrf.impl.security.descriptor
Class ServiceSecurityDescriptor

java.lang.Object
  extended byorg.globus.wsrf.impl.security.descriptor.util.ElementParser
      extended byorg.globus.wsrf.impl.security.descriptor.SecurityDescriptor
          extended byorg.globus.wsrf.impl.security.descriptor.ServiceSecurityDescriptor
All Implemented Interfaces:
AuthMethodParserCallback, AuthzParamParserCallback, CredentialParamsParserCallback, ElementHandler, GlobalParamsParserCallback, RunAsParserCallback, java.io.Serializable
Direct Known Subclasses:
ResourceSecurityDescriptor

public class ServiceSecurityDescriptor
extends SecurityDescriptor
implements RunAsParserCallback, AuthMethodParserCallback

Represents a service's security descriptor.

See Also:
Serialized Form

Field Summary
private  java.util.List defaultAuthMethods
           
private  int defaultRunAsType
           
private  java.util.Map methodAuthMethods
           
private  java.util.Map methodRunAsTypes
           
 
Fields inherited from class org.globus.wsrf.impl.security.descriptor.SecurityDescriptor
i18n, NS, RESOURCE
 
Fields inherited from class org.globus.wsrf.impl.security.descriptor.util.ElementParser
elementHandlers
 
Constructor Summary
ServiceSecurityDescriptor()
           
 
Method Summary
 java.util.List getAuthMethods(javax.xml.namespace.QName method)
          Returns the authentication methods that need to be enforced for a said method.
 java.util.List getDefaultAuthMethods()
          Returns default authentication methods that need to be enforced.
 int getDefaultRunAsType()
          Returns default run-as type.
 java.lang.String getRequiredAuthMethodsErrorMessage(java.util.List methods, javax.xml.namespace.QName opName)
           
 int getRunAsType(javax.xml.namespace.QName method)
          Returns configured run-as type.
private  void readObject(java.io.ObjectInputStream ois)
           
 void setAuthMethods(java.util.List authMethods)
          Sets the authentication mechanism required for invocation of methods.
 void setAuthMethods(java.util.List authMethods, boolean overwrite)
          Sets the authentication mechanism required for invocation of methods.
 void setMethodAuthMethods(javax.xml.namespace.QName method, java.util.List authMethods)
          Sets the authentication mechanism required for invocation of said method.
 void setMethodAuthMethods(javax.xml.namespace.QName method, java.util.List authMethods, boolean overwrite)
          Sets the authentication mechanism required for invocation of said method.
 void setMethodRunAsType(javax.xml.namespace.QName method, int identity)
          Sets the credentials that need to be used in invoking method
 void setMethodRunAsType(javax.xml.namespace.QName method, int identity, boolean overwrite)
          Sets the credentials that need to be used in invoking method
 void setRunAsType(int runAsType)
          Sets the credentials that need to be used in invocation of methods that do not have any run-as specified using setMethodRunAsType.
 void setRunAsType(int runAsType, boolean overwrite)
          Sets the credentials that need to be used in invocation of methods that do not have any run-as specified using setMethodRunAsType.
private  void writeObject(java.io.ObjectOutputStream oos)
           
 
Methods inherited from class org.globus.wsrf.impl.security.descriptor.SecurityDescriptor
getAuthz, getAuthzChain, getCertFilename, getContextLifetime, getGridMap, getGridMapFile, getKeyFilename, getLastModified, getProxyFilename, getRejectLimitedProxyState, getReplayAttackFilter, getReplayAttackWindow, getSubject, isRefreshRequired, setAuthz, setAuthzChain, setCertificateFiles, setContextLifetime, setGridMap, setGridMapFile, setLastModified, setProxyFilename, setRejectLimitedProxy, setReplayAttackFilter, setReplayAttackWindow, setSubject
 
Methods inherited from class org.globus.wsrf.impl.security.descriptor.util.ElementParser
checkElement, getFirstChildElement, getQName, parse, register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultRunAsType

private int defaultRunAsType

methodRunAsTypes

private java.util.Map methodRunAsTypes

defaultAuthMethods

private java.util.List defaultAuthMethods

methodAuthMethods

private java.util.Map methodAuthMethods
Constructor Detail

ServiceSecurityDescriptor

public ServiceSecurityDescriptor()
Method Detail

setRunAsType

public void setRunAsType(int runAsType)
                  throws SecurityDescriptorException
Sets the credentials that need to be used in invocation of methods that do not have any run-as specified using setMethodRunAsType.

Specified by:
setRunAsType in interface RunAsParserCallback
Parameters:
runAsType - can be one of RunAsConstants
Throws:
SecurityDescriptorException

setRunAsType

public void setRunAsType(int runAsType,
                         boolean overwrite)
                  throws SecurityDescriptorException
Sets the credentials that need to be used in invocation of methods that do not have any run-as specified using setMethodRunAsType.

Parameters:
runAsType - can be one of RunAsConstants
overwrite - if true, overwrite existing configuration
Throws:
SecurityDescriptorException

setMethodRunAsType

public void setMethodRunAsType(javax.xml.namespace.QName method,
                               int identity)
                        throws SecurityDescriptorException
Sets the credentials that need to be used in invoking method

Parameters:
method - method name
identity - can be one of RunAsConstants
Throws:
SecurityDescriptorException

setMethodRunAsType

public void setMethodRunAsType(javax.xml.namespace.QName method,
                               int identity,
                               boolean overwrite)
                        throws SecurityDescriptorException
Sets the credentials that need to be used in invoking method

Parameters:
method - method name
identity - can be one of RunAsConstants
overwrite - if true, overwrite existing configuration
Throws:
SecurityDescriptorException

setAuthMethods

public void setAuthMethods(java.util.List authMethods)
                    throws SecurityDescriptorException
Sets the authentication mechanism required for invocation of methods.

Specified by:
setAuthMethods in interface AuthMethodParserCallback
Parameters:
authMethods - list of authentication mechanism that implement AuthMethod
Throws:
SecurityDescriptorException

setAuthMethods

public void setAuthMethods(java.util.List authMethods,
                           boolean overwrite)
                    throws SecurityDescriptorException
Sets the authentication mechanism required for invocation of methods.

Parameters:
authMethods - list of authentication mechanism that implement AuthMethod
overwrite - if true, overwrite existing configuration
Throws:
SecurityDescriptorException

setMethodAuthMethods

public void setMethodAuthMethods(javax.xml.namespace.QName method,
                                 java.util.List authMethods)
                          throws SecurityDescriptorException
Sets the authentication mechanism required for invocation of said method.

Parameters:
method - method name
authMethods - list of authentication mechanism that implement AuthMethod
Throws:
SecurityDescriptorException

setMethodAuthMethods

public void setMethodAuthMethods(javax.xml.namespace.QName method,
                                 java.util.List authMethods,
                                 boolean overwrite)
                          throws SecurityDescriptorException
Sets the authentication mechanism required for invocation of said method.

Parameters:
method - method name
authMethods - list of authentication mechanism that implement AuthMethod
overwrite - if true, overwrite existing configuration
Throws:
SecurityDescriptorException

getDefaultRunAsType

public int getDefaultRunAsType()
Returns default run-as type. If not set, run-as resource is returned.


getRunAsType

public int getRunAsType(javax.xml.namespace.QName method)
Returns configured run-as type. If nothing is set, default run-as is returned.


getDefaultAuthMethods

public java.util.List getDefaultAuthMethods()
Returns default authentication methods that need to be enforced.


getAuthMethods

public java.util.List getAuthMethods(javax.xml.namespace.QName method)
Returns the authentication methods that need to be enforced for a said method. If none is explicitly configured, default authentication methods are used.

Parameters:
method - QName of the method

getRequiredAuthMethodsErrorMessage

public java.lang.String getRequiredAuthMethodsErrorMessage(java.util.List methods,
                                                           javax.xml.namespace.QName opName)

writeObject

private void writeObject(java.io.ObjectOutputStream oos)
                  throws java.io.IOException
Throws:
java.io.IOException

readObject

private void readObject(java.io.ObjectInputStream ois)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException