com.ibm.di.api
Class APIEngine

java.lang.Object
  extended by com.ibm.di.api.APIEngine

public class APIEngine
extends Object

This is the core class of the Server API. The APIEngine class does all initialization of the Server API. Both the local and the remote APIs are initialized by this class. During the initialization the values of the "api.*" properties in global.properties/solution.properties are used. This class provides methods which give access to a local session needed for using the local API.


Field Summary
static int DEFAULT_REGISTRY_PORT
           
static String PROP_API_CUSTOM_AUTH
           
static String PROP_API_CUSTOM_AUTH_LDAP_ADMIN_DN
           
static String PROP_API_CUSTOM_AUTH_LDAP_ADMIN_PASSWORD
           
static String PROP_API_CUSTOM_AUTH_LDAP_CRITICAL
           
static String PROP_API_CUSTOM_AUTH_LDAP_HOSTNAME
           
static String PROP_API_CUSTOM_AUTH_LDAP_PORT
           
static String PROP_API_CUSTOM_AUTH_LDAP_SEARCHBASE
           
static String PROP_API_CUSTOM_AUTH_LDAP_USE_SSL
           
static String PROP_API_CUSTOM_AUTH_LDAP_USER_ATTRIBUTE
           
static String PROP_API_CUSTOM_AUTH_LDAP_VALUE
           
static String PROP_API_CUSTOM_METHOD_INVOKE
           
static String PROP_API_CUSTOM_METHOD_INVOKE_ALLOWED_CLASSES
           
static String PROP_API_JMX_ON
           
static String PROP_API_JMX_REMOTE_ON
           
static String PROP_API_ON
           
static String PROP_API_REMOTE_NAMING_PORT
           
static String PROP_API_REMOTE_NONSSL_HOSTS
           
static String PROP_API_REMOTE_ON
           
static String PROP_API_REMOTE_SSL_CLIENT_AUTH_ON
           
static String PROP_API_REMOTE_SSL_ON
           
static String PROP_API_USER_REGISTRY
           
static String PROP_API_USER_REGISTRY_ENCRYPTION_ON
           
static String PROP_TOMBSTONE_MANAGER_ON
           
static String REMOTE_SESSION_FACTORY_NAME
           
 
Constructor Summary
APIEngine()
           
 
Method Summary
static void addEventListener(DIEventListener aListener, String aTypeFilter, String aIdFilter)
          Adds a new event listener.
static void assemblyLineStarted(AssemblyLine aAssemblyLine)
          This is a notification method, that notifies the engine that the specified Assembly Line has been started.
static void assemblyLineTerminated(AssemblyLine aAssemblyLine)
          This is a notification method, that notifies the engine that the specified Assembly Line has been terminated.
static void configInstanceStarted(RSInterface aConfigInstance)
          This is a notification method, that notifies the engine that the specified Config Instance has been started.
static void configInstanceStopped(RSInterface aConfigInstance)
          This is a notification method, that notifies the engine that the specified Config Instance has been stopped.
static void eventHandlerStarted(Switchboard aEventHandler)
          This is a notification method, that notifies the engine that the specified Event Handler has been started.
static void eventHandlerTerminated(Switchboard aEventHandler)
          This is a notification method, that notifies the engine that the specified Event Handler has been terminated.
static Hashtable getAssemblyLines()
          Returns a hashtable whose key elements are the Configuration Instances currently started, and the values are vectors containing all Assembly Lines currently started in the corresponding Configuration Instance.
static APIAuthenticator getAuthenticator()
          Returns the API Authenticator object.
static RMIClientSocketFactory getClientSF()
           
static String getConfigId(RSInterface configInstance)
          Obtain the configuration instance id for a running configuration instance, which has already loaded its configuration file.
static Vector getConfigInstances()
          Returns a vector containing all configuration instances currently started.
static ConfigurationRegistry getConfigurationRegistry()
          Returns Configuration Registry object.
static Hashtable getEventHandlers()
          Returns a hashtable whose key elements are the Configuration Instances currently started, and the values are vectors containing all Event Handlers currently started in the corresponding Configuration Instance.
static EventNotifier getEventNotifier()
          Returns the Event Notifier object.
static Identity getIdentity(String aUserId)
          Returns the Identity object from the Security Registry corresponding to the user id passes as parameter.
static String getInvokeClassesAllowed()
          This methods returns a list of classes.
static LDAPAuthentication getLDAPAuthenticator()
          Returns the LDAP Authenticator.
static Session getLocalSession()
          Creates a local Session object using a local SessionFactory created during the initialization.
static Session getLocalSession(String aUserName, String aPassword)
          Creates a local Session object using a local SessionFactory created during the initialization.
static boolean getMethodInvokeEnabled()
          If method invokation is enabled, then this method returns true.
static int getNamingPort()
           
static ResourceHash getResHash()
           
static RMIServerSocketFactory getServerSF()
           
static TombstoneManager getTombstoneManager()
          Returns the Tombstone Manager object.
static void initialize()
          Initializes the Server API.
static void initializeRemote()
          Initializes the Server API for remote access.
static Registry initRMIRegistry()
          Creates and initializes the RMI Registry.
static boolean isDebugEnabled()
          Returns "true" if debug is enabled and "false" otherwise.
static boolean isLDAPAuthenticationEnabled()
          Returns true if LDAP Authentication is enabled.
static boolean isSSLClientAuthenticationOn()
          Returns true if SSL Client Authentiation is on.
static boolean isSSLon()
          Returns true if SSL has been turned on.
static void logDebug(String aMessage)
          Logs a message using the DEBUG log level.
static void logError(String aMessage)
          Logs a message using the ERROR log level.
static void logErrorAndThrowException(String aErrorMsg)
          Logs a message using the ERROR log level and then throws a DIException using the same message.
static void logErrorAndThrowException(String aErrorMsg, Throwable e)
          Logs a message composed from the message passes as parameter and the message in the Throwable object.
static void logFatal(String aMessage)
          Logs a message using the FATAL log level.
static void logInfo(String aMessage)
          Logs a message using the INFO log level.
static void logWarn(String aMessage)
          Logs a message using the WARN log level.
static boolean removeEventListener(DIEventListener aListener)
          Removes existing event listener.
static void sendCustomNotification(String aType, String aId, Object aData)
          Sends a custom notification event using the API Engine's Event Notifier.
static void sendEventToACT(Serializable event)
          Process event by the Active Correlation Technology engine.
static void serverStopped(long aServerStarted)
          This is a notification method, that notifies the engine that server has been stopped.
static void setKeyStorePasswords(String aKeyStorePassword, String aKeyPassword)
           
static void triggerStarted(Trigger aTrigger)
          This is a notification method, that notifies the engine that the specified Trigger has been started.
static void triggerTerminated(Trigger aTrigger)
          This is a notification method, that notifies the engine that the specified Trigger has been terminated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_API_ON

public static final String PROP_API_ON
See Also:
Constant Field Values

PROP_API_USER_REGISTRY

public static final String PROP_API_USER_REGISTRY
See Also:
Constant Field Values

PROP_API_USER_REGISTRY_ENCRYPTION_ON

public static final String PROP_API_USER_REGISTRY_ENCRYPTION_ON
See Also:
Constant Field Values

PROP_API_REMOTE_ON

public static final String PROP_API_REMOTE_ON
See Also:
Constant Field Values

PROP_API_REMOTE_NAMING_PORT

public static final String PROP_API_REMOTE_NAMING_PORT
See Also:
Constant Field Values

PROP_API_REMOTE_SSL_ON

public static final String PROP_API_REMOTE_SSL_ON
See Also:
Constant Field Values

PROP_API_REMOTE_SSL_CLIENT_AUTH_ON

public static final String PROP_API_REMOTE_SSL_CLIENT_AUTH_ON
See Also:
Constant Field Values

PROP_API_REMOTE_NONSSL_HOSTS

public static final String PROP_API_REMOTE_NONSSL_HOSTS
See Also:
Constant Field Values

PROP_API_JMX_ON

public static final String PROP_API_JMX_ON
See Also:
Constant Field Values

PROP_API_JMX_REMOTE_ON

public static final String PROP_API_JMX_REMOTE_ON
See Also:
Constant Field Values

PROP_TOMBSTONE_MANAGER_ON

public static final String PROP_TOMBSTONE_MANAGER_ON
See Also:
Constant Field Values

PROP_API_CUSTOM_AUTH

public static final String PROP_API_CUSTOM_AUTH
See Also:
Constant Field Values

PROP_API_CUSTOM_METHOD_INVOKE

public static final String PROP_API_CUSTOM_METHOD_INVOKE
See Also:
Constant Field Values

PROP_API_CUSTOM_METHOD_INVOKE_ALLOWED_CLASSES

public static final String PROP_API_CUSTOM_METHOD_INVOKE_ALLOWED_CLASSES
See Also:
Constant Field Values

PROP_API_CUSTOM_AUTH_LDAP_CRITICAL

public static final String PROP_API_CUSTOM_AUTH_LDAP_CRITICAL
See Also:
Constant Field Values

PROP_API_CUSTOM_AUTH_LDAP_HOSTNAME

public static final String PROP_API_CUSTOM_AUTH_LDAP_HOSTNAME
See Also:
Constant Field Values

PROP_API_CUSTOM_AUTH_LDAP_PORT

public static final String PROP_API_CUSTOM_AUTH_LDAP_PORT
See Also:
Constant Field Values

PROP_API_CUSTOM_AUTH_LDAP_USE_SSL

public static final String PROP_API_CUSTOM_AUTH_LDAP_USE_SSL
See Also:
Constant Field Values

PROP_API_CUSTOM_AUTH_LDAP_SEARCHBASE

public static final String PROP_API_CUSTOM_AUTH_LDAP_SEARCHBASE
See Also:
Constant Field Values

PROP_API_CUSTOM_AUTH_LDAP_ADMIN_DN

public static final String PROP_API_CUSTOM_AUTH_LDAP_ADMIN_DN
See Also:
Constant Field Values

PROP_API_CUSTOM_AUTH_LDAP_ADMIN_PASSWORD

public static final String PROP_API_CUSTOM_AUTH_LDAP_ADMIN_PASSWORD
See Also:
Constant Field Values

PROP_API_CUSTOM_AUTH_LDAP_USER_ATTRIBUTE

public static final String PROP_API_CUSTOM_AUTH_LDAP_USER_ATTRIBUTE
See Also:
Constant Field Values

PROP_API_CUSTOM_AUTH_LDAP_VALUE

public static final String PROP_API_CUSTOM_AUTH_LDAP_VALUE
See Also:
Constant Field Values

DEFAULT_REGISTRY_PORT

public static final int DEFAULT_REGISTRY_PORT
See Also:
Constant Field Values

REMOTE_SESSION_FACTORY_NAME

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

APIEngine

public APIEngine()
Method Detail

getResHash

public static ResourceHash getResHash()

initialize

public static void initialize()
                       throws DIException
Initializes the Server API. It creates and initialize the Security Registry, the local Session Factory, the Process Factory, the Config Registry, the Event Notifier. Many of the initializations depends on the global properties values. Depending on the configuration API Authenticator and Tombstone Manager are also created.

Throws:
DIException

getLocalSession

public static Session getLocalSession()
                               throws DIException
Creates a local Session object using a local SessionFactory created during the initialization. This method is used by TDI components in order to gain access to the Local Server API.

Throws:
DIException

getLocalSession

public static Session getLocalSession(String aUserName,
                                      String aPassword)
                               throws DIException
Creates a local Session object using a local SessionFactory created during the initialization. This method is used when creation of the Session object requires authentication. The username and password parameters are used during the authentication process. This method is used by TDI components in order to gain access to the Local Server API.

Throws:
DIException

initializeRemote

public static void initializeRemote()
                             throws DIException
Initializes the Server API for remote access. It initializes the RMI Registry and registers the Remote Session Factory that is used to access the Server API.

Throws:
DIException

configInstanceStarted

public static void configInstanceStarted(RSInterface aConfigInstance)
                                  throws DIException
This is a notification method, that notifies the engine that the specified Config Instance has been started. The API Engine updates the Process Registry and sends a notification event. This method is for internal use by the Server API and should not be used elsewhere.

Throws:
DIException

configInstanceStopped

public static void configInstanceStopped(RSInterface aConfigInstance)
                                  throws DIException
This is a notification method, that notifies the engine that the specified Config Instance has been stopped. The API Engine updates the Process Registry and sends a notification event. This method is for internal use by the Server API and should not be used elsewhere.

Throws:
DIException

assemblyLineStarted

public static void assemblyLineStarted(AssemblyLine aAssemblyLine)
                                throws DIException
This is a notification method, that notifies the engine that the specified Assembly Line has been started. The API Engine updates the Process Registry and sends a notification event. This method is for internal use by the Server API and should not be used elsewhere.

Throws:
DIException

assemblyLineTerminated

public static void assemblyLineTerminated(AssemblyLine aAssemblyLine)
                                   throws DIException
This is a notification method, that notifies the engine that the specified Assembly Line has been terminated. The API Engine updates the Process Registry and sends a notification event. This method is for internal use by the Server API and should not be used elsewhere.

Throws:
DIException

eventHandlerStarted

public static void eventHandlerStarted(Switchboard aEventHandler)
                                throws DIException
This is a notification method, that notifies the engine that the specified Event Handler has been started. The API Engine updates the Process Registry and sends a notification event. This method is for internal use by the Server API and should not be used elsewhere.

Throws:
DIException

eventHandlerTerminated

public static void eventHandlerTerminated(Switchboard aEventHandler)
                                   throws DIException
This is a notification method, that notifies the engine that the specified Event Handler has been terminated. The API Engine updates the Process Registry and sends a notification event. This method is for internal use by the Server API and should not be used elsewhere.

Throws:
DIException

triggerStarted

public static void triggerStarted(Trigger aTrigger)
                           throws DIException
This is a notification method, that notifies the engine that the specified Trigger has been started. The API Engine updates the Process Registry and sends a notification event. This method is for internal use by the Server API and should not be used elsewhere.

Throws:
DIException

triggerTerminated

public static void triggerTerminated(Trigger aTrigger)
                              throws DIException
This is a notification method, that notifies the engine that the specified Trigger has been terminated. The API Engine updates the Process Registry and sends a notification event. This method is for internal use by the Server API and should not be used elsewhere.

Throws:
DIException

serverStopped

public static void serverStopped(long aServerStarted)
                          throws DIException
This is a notification method, that notifies the engine that server has been stopped. The only parameter specifies the time the server has been started. The API Engine sends a notification event. This method is for internal use by the Server API and should not be used elsewhere.

Throws:
DIException

getConfigInstances

public static Vector getConfigInstances()
                                 throws DIException
Returns a vector containing all configuration instances currently started.

Throws:
DIException

getAssemblyLines

public static Hashtable getAssemblyLines()
                                  throws DIException
Returns a hashtable whose key elements are the Configuration Instances currently started, and the values are vectors containing all Assembly Lines currently started in the corresponding Configuration Instance.

Throws:
DIException

getEventHandlers

public static Hashtable getEventHandlers()
                                  throws DIException
Returns a hashtable whose key elements are the Configuration Instances currently started, and the values are vectors containing all Event Handlers currently started in the corresponding Configuration Instance.

Throws:
DIException

getIdentity

public static Identity getIdentity(String aUserId)
                            throws DIException
Returns the Identity object from the Security Registry corresponding to the user id passes as parameter.

Throws:
DIException

addEventListener

public static void addEventListener(DIEventListener aListener,
                                    String aTypeFilter,
                                    String aIdFilter)
                             throws DIException
Adds a new event listener.

Throws:
DIException

removeEventListener

public static boolean removeEventListener(DIEventListener aListener)
                                   throws DIException
Removes existing event listener.

Throws:
DIException

isDebugEnabled

public static boolean isDebugEnabled()
Returns "true" if debug is enabled and "false" otherwise.


logDebug

public static void logDebug(String aMessage)
Logs a message using the DEBUG log level.


logInfo

public static void logInfo(String aMessage)
Logs a message using the INFO log level.


logError

public static void logError(String aMessage)
Logs a message using the ERROR log level.


logWarn

public static void logWarn(String aMessage)
Logs a message using the WARN log level.


logFatal

public static void logFatal(String aMessage)
Logs a message using the FATAL log level.


logErrorAndThrowException

public static void logErrorAndThrowException(String aErrorMsg)
                                      throws DIException
Logs a message using the ERROR log level and then throws a DIException using the same message.

Throws:
DIException

logErrorAndThrowException

public static void logErrorAndThrowException(String aErrorMsg,
                                             Throwable e)
                                      throws DIException
Logs a message composed from the message passes as parameter and the message in the Throwable object. The new message is logged using the ERROR log level and then a DIException is thrown containing that message.

Throws:
DIException

getNamingPort

public static int getNamingPort()

isSSLon

public static boolean isSSLon()
Returns true if SSL has been turned on. Otherwise returns false.


isSSLClientAuthenticationOn

public static boolean isSSLClientAuthenticationOn()
Returns true if SSL Client Authentiation is on. Otherwise returns false.


getServerSF

public static RMIServerSocketFactory getServerSF()

getClientSF

public static RMIClientSocketFactory getClientSF()

initRMIRegistry

public static Registry initRMIRegistry()
                                throws DIException
Creates and initializes the RMI Registry.

Throws:
DIException

setKeyStorePasswords

public static void setKeyStorePasswords(String aKeyStorePassword,
                                        String aKeyPassword)
                                 throws Exception
Throws:
Exception

getTombstoneManager

public static TombstoneManager getTombstoneManager()
Returns the Tombstone Manager object.


getConfigurationRegistry

public static ConfigurationRegistry getConfigurationRegistry()
Returns Configuration Registry object.


getEventNotifier

public static EventNotifier getEventNotifier()
Returns the Event Notifier object.


getAuthenticator

public static APIAuthenticator getAuthenticator()
Returns the API Authenticator object.


sendCustomNotification

public static void sendCustomNotification(String aType,
                                          String aId,
                                          Object aData)
                                   throws DIException
Sends a custom notification event using the API Engine's Event Notifier.

Throws:
DIException

getLDAPAuthenticator

public static LDAPAuthentication getLDAPAuthenticator()
Returns the LDAP Authenticator.


isLDAPAuthenticationEnabled

public static boolean isLDAPAuthenticationEnabled()
Returns true if LDAP Authentication is enabled. Otherwise returns false.


getMethodInvokeEnabled

public static boolean getMethodInvokeEnabled()
If method invokation is enabled, then this method returns true.

Returns:
true if method invokation is enabled and false otherwise.

getInvokeClassesAllowed

public static String getInvokeClassesAllowed()
This methods returns a list of classes. These classes are the only classes which can be invoked through invokeCustom() methods of the Server API.

Returns:
list of classes which can be invoked through invokeCustom() methods of the Server API.

sendEventToACT

public static void sendEventToACT(Serializable event)
                           throws DIException
Process event by the Active Correlation Technology engine. When the method returns, the engine has completely processed the event. Currently only events of type org.eclipse.hyades.logging.events.cbe.CommonBaseEvent are supported.

Parameters:
event - The event to be processed.
Throws:
DIException - An error while processing the event.
Since:
TDI 6.1.1

getConfigId

public static String getConfigId(RSInterface configInstance)
Obtain the configuration instance id for a running configuration instance, which has already loaded its configuration file.

Parameters:
configInstance - A running configuration instance.
Returns:
the configuration id, which corresponds to the specified configuration instance; null if the instance is not running or has not loaded its configuration yet
Since:
TDI 6.1.1