GigaSpaces XAP 7.0 API

com.gigaspaces.security
Class SecurityFactory

java.lang.Object
  extended by com.gigaspaces.security.SecurityFactory

public class SecurityFactory
extends Object

A factory for creating an SecurityManager and locating of security properties file by name.

Since:
7.0.1
Author:
Moran Avigdor

Field Summary
static String DEFAULT_SECURITY_DIRECTORY
           
static String DEFAULT_SECURITY_RESOURCE
           
 
Constructor Summary
SecurityFactory()
           
 
Method Summary
static SecurityManager createSecurityManager(Properties securityProperties)
          Creates a SecurityManager instance using the provided security properties.
static InputStream findSecurityProperties(String resourceName)
          Finds the security properties file based on the resource name.
static Properties loadSecurityProperties(String resourceName)
          Loads the specified properties file from the resource. see findSecurityProperties(String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SECURITY_RESOURCE

public static final String DEFAULT_SECURITY_RESOURCE
See Also:
Constant Field Values

DEFAULT_SECURITY_DIRECTORY

public static final String DEFAULT_SECURITY_DIRECTORY
See Also:
Constant Field Values
Constructor Detail

SecurityFactory

public SecurityFactory()
Method Detail

createSecurityManager

public static SecurityManager createSecurityManager(Properties securityProperties)
Creates a SecurityManager instance using the provided security properties. The property key SecurityManager.SECURITY_MANAGER_CLASS_PROPERTY_KEY identifies the class name to use to load the security manager implementation.

Parameters:
securityProperties - The security properties to use to create the security manager and underlying components.
Returns:
The security manager instance.
Throws:
SecurityException - if failed to create the security manager.

loadSecurityProperties

public static Properties loadSecurityProperties(String resourceName)
Loads the specified properties file from the resource. see findSecurityProperties(String). If no resource is found, a SecurityException is thrown.

The properties file is used to configure the different security components.

Parameters:
resourceName - The full resource name. If null loads the default.
Returns:
a properties file holding security related key-value pairs.
Throws:
SecurityException - if any exception was thrown while trying to load the resource, or if the resource could not be located.

findSecurityProperties

public static InputStream findSecurityProperties(String resourceName)
Finds the security properties file based on the resource name. The resourceName can be a direct path to the file, or a reference to a resource located in the classpath. If the resource is not found, it attempts to load the default security.properties. If no resource is found, will return null.

Parameters:
resourceName - The full resource name. If null loads the default.
Returns:
an input stream to the properties file. null if no resource was found.

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.