fedora.server.security
Class BackendSecuritySpec

java.lang.Object
  extended by fedora.server.security.BackendSecuritySpec

public class BackendSecuritySpec
extends java.lang.Object

Class that instantiates information parsed from the beSecurity.xml file. Methods are provided to set and get backend security properties by role id.

Author:
payette

Constructor Summary
BackendSecuritySpec()
           
 
Method Summary
 java.util.Hashtable getDefaultSecuritySpec()
          Get the default backend security properties.
 java.util.Hashtable getSecuritySpec(java.lang.String roleKey)
          Get security properties for either the a backend service or a method within that backend service.
 java.util.Hashtable getSecuritySpec(java.lang.String serviceRoleID, java.lang.String methodName)
          Get security properties for either the a backend service or a method within that backend service.
 java.util.Set listRoleKeys()
           
 void setSecuritySpec(java.lang.String serviceRoleID, java.lang.String methodName, java.util.Hashtable<java.lang.String,java.lang.String> properties)
          Set the security properties at the backend service or for a method of that backend service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackendSecuritySpec

public BackendSecuritySpec()
Method Detail

setSecuritySpec

public void setSecuritySpec(java.lang.String serviceRoleID,
                            java.lang.String methodName,
                            java.util.Hashtable<java.lang.String,java.lang.String> properties)
                     throws GeneralException
Set the security properties at the backend service or for a method of that backend service.

Parameters:
serviceRoleID - - the role identifier for a service. Valid values for this parameter are: - a bmech PID for a backend service - "default" to indicate the default properties for any service - "fedoraInternalCall-1" for Fedora calling back to itself as a service
methodName - - optional method name within the backend service. If specified security properties at the service method level will be recorded. If null, service properties at the service level will be recorded.
properties -
Throws:
GeneralException

getDefaultSecuritySpec

public java.util.Hashtable getDefaultSecuritySpec()
Get the default backend security properties.


getSecuritySpec

public java.util.Hashtable getSecuritySpec(java.lang.String serviceRoleID,
                                           java.lang.String methodName)
Get security properties for either the a backend service or a method within that backend service.

Parameters:
serviceRoleID - - role identifier for a backend service. Valid options: - "default" (the overall default for backend services) - "fedoraInternalCall-1" (the role key for fedora calling back to itself) - A bmech PID (e.g., "bmech:9") as the identifier for a backend service
methodName - - a method name that is specified within a bmech service. If values is null, then this method will return the security properties defined for the backend service specified by the serviceRoleID parameter.
Returns:
a Hashtable containing the backend security properties for the role or role/method. The security property names, defined in BackendSecurityDeserializer.java, are: - BackendSecurityDeserializer.CALL_BASIC_AUTH - BackendSecurityDeserializer.CALL_SSL - BackendSecurityDeserializer.CALL_USERNAME - BackendSecurityDeserializer.CALL_PASSWORD - BackendSecurityDeserializer.CALLBACK_BASIC_AUTH - BackendSecurityDeserializer.CALLBACK_SSL - BackendSecurityDeserializer.IPLIST

getSecuritySpec

public java.util.Hashtable getSecuritySpec(java.lang.String roleKey)
Get security properties for either the a backend service or a method within that backend service.

Parameters:
roleKey - = the role identifier for the backend service, for example: - "default" (the overall default for backend services) - "fedoraInternalCall-1" (the role key for fedora calling back to itself) - "bmech:9" (the role key for a backend service) - "bmech:9/getThumb" (the role key for a method within a backend service)
Returns:
a Hashtable containing the backend security properties for the roleKey. The security property names, defined in BackendSecurityDeserializer.java, are: - BackendSecurityDeserializer.CALL_BASIC_AUTH - BackendSecurityDeserializer.CALL_SSL - BackendSecurityDeserializer.CALL_USERNAME - BackendSecurityDeserializer.CALL_PASSWORD - BackendSecurityDeserializer.CALLBACK_BASIC_AUTH - BackendSecurityDeserializer.CALLBACK_SSL - BackendSecurityDeserializer.IPLIST

listRoleKeys

public java.util.Set listRoleKeys()