atg.rest.security
Class RestSecurityManager

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.rest.security.RestSecurityManager
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class RestSecurityManager
extends GenericService

This class manages Rest security configuration. It is responsible for initialization of the Rest security configuration from Rest security definition files. In addition it provides runtime Rest security checks for current profile user.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static int WILDCARD_CACHE_SIZE
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
RestSecurityManager()
          Default Constructor
 
Method Summary
protected  void addSecurityConfiguration(org.w3c.dom.Document pDocument)
          Adds Rest security configuration(s) for the given XML Document object
 void doStartService()
          This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values.
 ComponentResolver getComponentResolver()
           
 ComponentSecurityConfiguration getComponentSecurityConfiguration(java.lang.String pComponentName)
          Gets ComponentSecurityConfiguration
 java.util.Map<java.lang.String,ComponentSecurityConfiguration> getComponentSecurityConfigurations()
           
 ComponentSecurityConfiguration getDefaultComponentSecurityConfiguration()
           
 RestConfiguration getRestConfiguration()
           
 atg.xml.XMLFile[] getRestSecurityDefinitionFiles()
           
 SecurityConfiguration getSecurityConfiguration()
           
 ComponentSecurityConfiguration getWildCardComponentSecurityConfiguration(java.lang.String pComponentName)
          Given a componentName, returns a wild card ComponentSecurityConfiguration.
protected  java.lang.String getWildCardName(java.lang.String pComponentName)
          Given a component name, returns a wild card name for the component.
protected  java.util.ArrayList<java.lang.String> getWildCardNames(java.lang.String pComponentName)
          Given a component name, returns a list of wild card name for the component.
 atg.xml.tools.XMLToDOMParser getXMLToDOMParser()
           
 atg.xml.tools.XMLToolsFactory getXMLToolsFactory()
           
protected  void initializeRestSecurityConfiguration(atg.xml.XMLFile[] pFiles)
          Initializes the Rest security configuration by parsing the configuration files
 boolean isCheckFormHandlerProperties()
           
 boolean isWarnSecureSetting()
           
 void setCheckFormHandlerProperties(boolean pCheckFormHandlerProperties)
           
 void setComponentResolver(ComponentResolver pComponentResolver)
           
 void setDefaultComponentSecurityConfiguration(ComponentSecurityConfiguration pDefaultComponentSecurityConfiguration)
           
 void setRestConfiguration(RestConfiguration pRestConfiguration)
           
 void setRestSecurityDefinitionFiles(atg.xml.XMLFile[] pRestSecurityDefinitionFiles)
           
 void setSecurityConfiguration(SecurityConfiguration pSecurityConfiguration)
           
 void setWarnSecureSetting(boolean pWarnSecureSetting)
           
 void setXMLToolsFactory(atg.xml.tools.XMLToolsFactory pXMLToolsFactory)
           
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

WILDCARD_CACHE_SIZE

public static int WILDCARD_CACHE_SIZE
Constructor Detail

RestSecurityManager

public RestSecurityManager()
Default Constructor

Method Detail

setRestSecurityDefinitionFiles

public void setRestSecurityDefinitionFiles(atg.xml.XMLFile[] pRestSecurityDefinitionFiles)
Parameters:
pRestSecurityDefinitionFiles - The restSecurityDefinitionFiles to set.

getRestSecurityDefinitionFiles

public atg.xml.XMLFile[] getRestSecurityDefinitionFiles()
Returns:
Returns the value of restSecutryDefinitionFiles.

setXMLToolsFactory

public void setXMLToolsFactory(atg.xml.tools.XMLToolsFactory pXMLToolsFactory)
Parameters:
pXMLToolsFactory - new value to set

getXMLToolsFactory

public atg.xml.tools.XMLToolsFactory getXMLToolsFactory()
Returns:
Returns the value of XMLToolsFactory

getXMLToDOMParser

public atg.xml.tools.XMLToDOMParser getXMLToDOMParser()
Returns:
Returns the value of XMLToDOMParser

setSecurityConfiguration

public void setSecurityConfiguration(SecurityConfiguration pSecurityConfiguration)
Parameters:
pSecurityConfiguration - new value to set

getSecurityConfiguration

public SecurityConfiguration getSecurityConfiguration()
Returns:
Returns the value of seurityConfiguration

setRestConfiguration

public void setRestConfiguration(RestConfiguration pRestConfiguration)
Parameters:
pRestConfiguration - new value to set

getRestConfiguration

public RestConfiguration getRestConfiguration()
Returns:
Returns the value of restConfiguration

setComponentResolver

public void setComponentResolver(ComponentResolver pComponentResolver)
Parameters:
pComponentResolver - new value to set

getComponentResolver

public ComponentResolver getComponentResolver()
Returns:
Returns the value of componentResolver

setWarnSecureSetting

public void setWarnSecureSetting(boolean pWarnSecureSetting)
Parameters:
pWarnSecureSetting - new value to set

isWarnSecureSetting

public boolean isWarnSecureSetting()
Returns:
Returns true if to log warning when "secure" property is set to false.

setCheckFormHandlerProperties

public void setCheckFormHandlerProperties(boolean pCheckFormHandlerProperties)
Parameters:
pCheckFormHandlerProperties - - whether to check security for form handler properties or not

isCheckFormHandlerProperties

public boolean isCheckFormHandlerProperties()
Returns:
checkFormHandlerProperties (whether to check security for form handler properties or not)

getComponentSecurityConfigurations

public java.util.Map<java.lang.String,ComponentSecurityConfiguration> getComponentSecurityConfigurations()
Returns:
the value of componentSecurityConfigurations

setDefaultComponentSecurityConfiguration

public void setDefaultComponentSecurityConfiguration(ComponentSecurityConfiguration pDefaultComponentSecurityConfiguration)
Parameters:
pDefaultComponentSecurityConfiguration - new value to set

getDefaultComponentSecurityConfiguration

public ComponentSecurityConfiguration getDefaultComponentSecurityConfiguration()
Returns:
the value of defaultComponentSecurityConfiguration

doStartService

public void doStartService()
                    throws ServiceException
Description copied from class: GenericService
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. The Service should override this method to start any processes it requires.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up

initializeRestSecurityConfiguration

protected void initializeRestSecurityConfiguration(atg.xml.XMLFile[] pFiles)
                                            throws ServiceException
Initializes the Rest security configuration by parsing the configuration files

Parameters:
pFiles - the Rest security configuration file(s)
Throws:
ServiceException - if errors occur while parsing the configuration files.

addSecurityConfiguration

protected void addSecurityConfiguration(org.w3c.dom.Document pDocument)
                                 throws RestInitializationException
Adds Rest security configuration(s) for the given XML Document object

Parameters:
pDocument - the XML Document object to read and use to configure the SecurityManager
Throws:
RestInitializationException - if errors occur while adding security configuration(s).

getComponentSecurityConfiguration

public ComponentSecurityConfiguration getComponentSecurityConfiguration(java.lang.String pComponentName)
Gets ComponentSecurityConfiguration

Parameters:
pName - The component name.
Returns:
ComponentSecurityConfiguration

getWildCardName

protected java.lang.String getWildCardName(java.lang.String pComponentName)
Given a component name, returns a wild card name for the component. For example: For component: /atg/rest/Configuration The wild card name: /atg/rest/*

Parameters:
pComponentName -
Returns:
Returns the wild card name for a component

getWildCardNames

protected java.util.ArrayList<java.lang.String> getWildCardNames(java.lang.String pComponentName)
Given a component name, returns a list of wild card name for the component. For example: For component: /atg/rest/Configuration The wild card name list: /atg/rest/* /atg/*

Parameters:
pComponentName -
Returns:
Returns a list of wild card name

getWildCardComponentSecurityConfiguration

public ComponentSecurityConfiguration getWildCardComponentSecurityConfiguration(java.lang.String pComponentName)
Given a componentName, returns a wild card ComponentSecurityConfiguration.

Parameters:
pComponentName -
Returns: