com.spss.psapi.session

Class SessionFactory

  • java.lang.Object
    • com.spss.psapi.session.SessionFactory


  • public abstract class SessionFactory
    extends java.lang.Object
    A session factory is used to create instances of Session.
    Since:
    PSAPI 1.0
    Version:
    1.1
    Author:
    Julian Clinton
    See Also:
    Session
    Specification Status:
    Under Development
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      class  SessionFactory.SessionBuilder
      Creates a session using the builder pattern.
    • Constructor Summary

      Constructors 
      Modifier Constructor and Description
      protected SessionFactory()
      Default constructor used by sub-classes of SessionFactory.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      abstract Session create(java.util.Locale locale)
      Creates a new session using the specified locale.
      abstract Session create(java.util.Locale locale, ServerConnectionDescriptor serverDescriptor)
      Creates a new session using the specified locale.
      abstract Session create(java.util.Locale locale, ServerConnectionDescriptor serverDescriptor, RepositoryConnectionDescriptor repositoryDescriptor)
      Creates a new session using the specified locale.
      abstract Session create(java.util.Locale locale, ServerConnectionDescriptor serverDescriptor, RepositoryConnectionDescriptor repositoryDescriptor, ASCredentialDescriptor asConnectionDescriptor)
      Create a new sessio using the sepcified locale, The session is automatically connected to the specified server
      protected abstract Session create(SessionFactory.SessionBuilder builder)
      Creates a new session from the specified builder.
      abstract AdministratorSession createAdministratorSession(java.util.Locale locale, ServerConnectionDescriptor serverDescriptor)
      Creates a new admin session using the specified locale.
      abstract ServerConnectionDescriptor createServerConnectionDescriptor(java.lang.String hostName, int port, java.lang.String dataDirectory, boolean useSSL, boolean useSSO, byte[] token)
      Creates a new server connection descriptor using the supplied arguments.
      abstract ServerConnectionDescriptor createServerConnectionDescriptor(java.lang.String hostName, int port, java.lang.String userName, java.lang.String password, java.lang.String domain, java.lang.String dataDirectory)
      Creates a new server connection descriptor using the supplied arguments.
      abstract ServerConnectionDescriptor createServerConnectionDescriptor(java.lang.String hostName, int port, java.lang.String userName, java.lang.String password, java.lang.String domain, java.lang.String dataDirectory, boolean useSsl)
      Creates a new server connection descriptor using the supplied arguments.
      SessionFactory.SessionBuilder createSessionBuilder(java.util.Locale locale)
      Creates a new session builder for the specified locale.
      abstract ApplicationData getApplicationData()
      Returns the application data.
      static SessionFactory getInstance()
      Creates the shared instance of the SessionFactory.
      static java.lang.String getProperty(java.lang.String key)
      Returns the value of the specified configuration property obtained from one of the following sources, in order of precedence: The value set by setProperty(String, String) The value of the corresponding Java system property Returns null if the property has no value or if the system property cannot be read for any reason.
      static java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
      Returns the value of the specified configuration property obtained from one of the following sources, in order of precedence: The value set by setProperty(String, String) The value of the corresponding Java system property Returns the specified default value if the property has no value or if the system property cannot be read for any reason.
      static Session getPSAPISession(SystemSession session)
      Converts a system session to a full session.
      abstract void notifyApplicationShutdown()
      Called by the owner application to notify the SessionFactory that the application is shutting down.
      abstract void notifyApplicationStartup()
      Called by the owner application to notify the SessionFactory that the application has started up.
      abstract void setApplicationData(ApplicationData applicationData)
      Sets the application data.
      static void setProperty(java.lang.String key, java.lang.String value)
      Sets the value of the specified configuration property.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • EXTENSIONS_AUTOLOAD_DIRECTORY_PROPERTY

        public static final java.lang.String EXTENSIONS_AUTOLOAD_DIRECTORY_PROPERTY
        Configuration property which identifies the autoload directory for extensions.
        Since:
        PSAPI 12.0
        See Also:
        Constant Field Values
      • PSAPI_LIB_DIRECTORY_PROPERTY

        public static final java.lang.String PSAPI_LIB_DIRECTORY_PROPERTY
        Configuration property which identifies the "lib" directory for the PSAPI JARs.
        Since:
        PSAPI 18.1
        See Also:
        Constant Field Values
      • NATIVE_LIBRARY_SUFFIX_PROPERTY

        public static final java.lang.String NATIVE_LIBRARY_SUFFIX_PROPERTY
        Configuration property which specifies the platform suffix for native libraries.

        Obsolete as of Modeler API 13.0 which no longer uses native libraries.

        Since:
        PSAPI 12.0
        See Also:
        Constant Field Values
      • SERVER_INSTALLATION_DIRECTORY_PROPERTY

        public static final java.lang.String SERVER_INSTALLATION_DIRECTORY_PROPERTY
        Configuration property which identifies the installation directory of the local server.
        Since:
        PSAPI 12.0
        See Also:
        Constant Field Values
      • SESSION_SERVICE_ENDPOINT_PROPERTY

        public static final java.lang.String SESSION_SERVICE_ENDPOINT_PROPERTY
        Configuration property which identifies the endpoint of the cloud session service. The value must be a URL.
        Since:
        PSAPI 18.1
        See Also:
        Constant Field Values
    • Constructor Detail

      • SessionFactory

        protected SessionFactory()
        Default constructor used by sub-classes of SessionFactory. The default constructor does nothing.
    • Method Detail

      • notifyApplicationStartup

        public abstract void notifyApplicationStartup()
        Called by the owner application to notify the SessionFactory that the application has started up. If the application doesn't call this explicitly, it will be called the first time a session or administrator session is created. The method should only be called once and any subsequent calls will be ignored.
        Since:
        PSAPI 12.0.1
      • notifyApplicationShutdown

        public abstract void notifyApplicationShutdown()
        Called by the owner application to notify the SessionFactory that the application is shutting down. If the application doesn't call this, resources allocated by the SessionFactory may not be freed correctly. The method should only be called once and any subsequent calls will be ignored. Once called, no further calls to the Modeler API should be made within the lifetime of the JVM.
        Since:
        PSAPI 12.0.1
      • setApplicationData

        public abstract void setApplicationData(ApplicationData applicationData)
        Sets the application data.
        Parameters:
        applicationData - the application data
        See Also:
        getApplicationData()
      • createSessionBuilder

        public SessionFactory.SessionBuilder createSessionBuilder(java.util.Locale locale)
        Creates a new session builder for the specified locale.
        Returns:
        a new session builder
        Since:
        PSAPI 18.1
      • createServerConnectionDescriptor

        public abstract ServerConnectionDescriptor createServerConnectionDescriptor(java.lang.String hostName,
                                                                  int port,
                                                                  java.lang.String userName,
                                                                  java.lang.String password,
                                                                  java.lang.String domain,
                                                                  java.lang.String dataDirectory)
        Creates a new server connection descriptor using the supplied arguments.
        Parameters:
        hostName - the host machine name to be used
        port - the port number to be used
        userName - the user name to be used
        password - the password
        domain - the login domain name to be used
        dataDirectory - the data directory to be used
        Returns:
        a new ServerConnectionDescriptor
        See Also:
        create(Locale, ServerConnectionDescriptor), ServerConnectionDescriptor
      • createServerConnectionDescriptor

        public abstract ServerConnectionDescriptor createServerConnectionDescriptor(java.lang.String hostName,
                                                                  int port,
                                                                  java.lang.String dataDirectory,
                                                                  boolean useSSL,
                                                                  boolean useSSO,
                                                                  byte[] token)
        Creates a new server connection descriptor using the supplied arguments.
        Parameters:
        hostName - the host machine name to be used
        port - the port number to be used
        dataDirectory - the data directory to be used
        useSSL - true to establish a secure connection using SSL
        useSSO - true to establish a connection with SSO
        token - the Kerberos token to be used
        Returns:
        a new ServerConnectionDescriptor
        See Also:
        create(Locale, ServerConnectionDescriptor), ServerConnectionDescriptor
      • createServerConnectionDescriptor

        public abstract ServerConnectionDescriptor createServerConnectionDescriptor(java.lang.String hostName,
                                                                  int port,
                                                                  java.lang.String userName,
                                                                  java.lang.String password,
                                                                  java.lang.String domain,
                                                                  java.lang.String dataDirectory,
                                                                  boolean useSsl)
        Creates a new server connection descriptor using the supplied arguments.
        Parameters:
        hostName - the host machine name to be used
        port - the port number to be used
        userName - the user name to be used
        password - the password
        domain - the login domain name to be used
        dataDirectory - the data directory to be used
        useSsl - true to establish a secure connection using SSL
        Returns:
        a new ServerConnectionDescriptor
        Since:
        PSAPI 2.0
        See Also:
        create(Locale, ServerConnectionDescriptor), ServerConnectionDescriptor
      • getProperty

        public static java.lang.String getProperty(java.lang.String key)
        Returns the value of the specified configuration property obtained from one of the following sources, in order of precedence:
        • The value set by setProperty(String, String)
        • The value of the corresponding Java system property
        Returns null if the property has no value or if the system property cannot be read for any reason.
        Parameters:
        key - the property name
        Returns:
        returns the property value or null if the property has no value
        Since:
        PSAPI 12.0
        See Also:
        System.getProperty(String)
      • getProperty

        public static java.lang.String getProperty(java.lang.String key,
                                   java.lang.String defaultValue)
        Returns the value of the specified configuration property obtained from one of the following sources, in order of precedence:
        • The value set by setProperty(String, String)
        • The value of the corresponding Java system property
        Returns the specified default value if the property has no value or if the system property cannot be read for any reason.
        Parameters:
        key - the property name
        defaultValue - the value to return if the property has no value
        Returns:
        returns the property value or the default value if the property has no value
        Since:
        PSAPI 12.0
        See Also:
        System.getProperty(String)
      • setProperty

        public static void setProperty(java.lang.String key,
                       java.lang.String value)
        Sets the value of the specified configuration property.

        To be effective, configuration properties must be set before the first call to getInstance().

        Parameters:
        key - the property name
        value - the property value
        Since:
        PSAPI 12.0
      • getPSAPISession

        public static Session getPSAPISession(SystemSession session)
        Converts a system session to a full session. The returned session is automatically connected to the server. Assumes the SystemSession parameter to be an instance of DefaultSession.
        Parameters:
        session -
        Returns:
        a psapi session

(C) Copyright IBM Corp. 1994, 2015. All Rights Reserved.