org.idoox.security
Class SecurityConfig

java.lang.Object
  extended byorg.idoox.security.SecurityConfig

public final class SecurityConfig
extends java.lang.Object

This class represents configuration properties for the security classes. It can be initialized manually using init() method or on demand when the first getProperty method is called.

When on demand intialization is used, the location of the property file is determined from the idoox.security.config system property. If this file is not found or the property is not set, it uses default property file included in the distribution of standalone security module.

The location of the property file can specified either as filename with path or as URL with scheme resource:. For the later case, the ClassLoader is used to load property file using classpath.

Since:
3.0
Component:
Security-Core

Constructor Summary
SecurityConfig()
           
 
Method Summary
 java.lang.String getId()
          Returns id of this object.
 java.lang.ClassLoader getImplClassLoader()
           
 java.util.Properties getProperties()
          Returns a copy of current of security properties.
 java.lang.String getProperty(java.lang.String key)
          Returns property value for given name.
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Returns property value for given name.
 void init(java.util.Properties properties, java.lang.ClassLoader implLoader)
          Method for explicit initialization of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecurityConfig

public SecurityConfig()
Method Detail

getProperty

public java.lang.String getProperty(java.lang.String key)
Returns property value for given name. The method returns null if property is not found.

Parameters:
key - the property key
Returns:
the value for the specified key

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)
Returns property value for given name. The method returns the default value argument if property is not found.

Parameters:
key - the property key
defaultValue - a default value
Returns:
the value for the specified key

getProperties

public java.util.Properties getProperties()
Returns a copy of current of security properties.

Returns:
current security properties
Since:
4.0

getImplClassLoader

public java.lang.ClassLoader getImplClassLoader()

init

public void init(java.util.Properties properties,
                 java.lang.ClassLoader implLoader)
Method for explicit initialization of this class. It allows to supply configuration values from other source than the default one.

Note that this method can be called before any other method on this class is called and only one time, RuntimeException is thrown otherwise.

The common property keys are: security.provider. gss.provider. gss.provider.default Cipher. Signature. MessageDigest. pstore.source pstore.provider pstore.source.sax.file userstore.source keystore.source userstore.impl keystore.impl

Parameters:
properties - properties containing the configuration for the security classes.

getId

public java.lang.String getId()
Returns id of this object.

Returns:
id of this object.