Package com.gigaspaces.security
Class SecurityFactory
java.lang.Object
com.gigaspaces.security.SecurityFactory
A factory for creating an
SecurityManager and locating of security properties file by
name.- Since:
- 7.0.1
- Author:
- Moran Avigdor
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SecurityManagercreateSecurityManager(Properties securityProperties) Creates aSecurityManagerinstance using the provided security properties.static InputStreamfindSecurityProperties(String resourceName) Finds the security properties file based on the resource name.static PropertiesloadComponentSecurityProperties(String component, boolean useMinusDLast) Load a component's security properties file.static PropertiesloadSecurityProperties(String resourceName) Loads the specified properties file from the resource.
-
Field Details
-
DEFAULT_SECURITY_RESOURCE
- See Also:
-
DEFAULT_SECURITY_DIRECTORY
- See Also:
-
-
Constructor Details
-
SecurityFactory
public SecurityFactory()
-
-
Method Details
-
createSecurityManager
Creates aSecurityManagerinstance using the provided security properties. The property keySecurityManager.SECURITY_MANAGER_CLASS_PROPERTY_KEYidentifies 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
Loads the specified properties file from the resource. seefindSecurityProperties(String). If no resource is found, aSecurityExceptionis thrown.The properties file is used to configure the different security components.
- Parameters:
resourceName- The full resource name. Ifnullloads 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.
-
loadComponentSecurityProperties
Load a component's security properties file.- Parameters:
component- The component name, e.g. "grid"useMinusDLast- if -Dcom.gs.security.properties-file is set, use it after looking up default component file- Returns:
- The loaded properties
- Throws:
SecurityException- if couldn't locate/load security file- Since:
- 12.2
-
findSecurityProperties
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 returnnull.- Parameters:
resourceName- The full resource name. Ifnullloads the default.- Returns:
- an input stream to the properties file.
nullif no resource was found.
-