Class SecurityFactory

java.lang.Object
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 Details

  • Constructor Details

    • SecurityFactory

      public SecurityFactory()
  • Method Details

    • 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.
    • loadComponentSecurityProperties

      public static Properties loadComponentSecurityProperties(String component, boolean useMinusDLast)
      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

      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.