Class ServerAPI

  • All Implemented Interfaces:
    java.lang.Runnable

    public class ServerAPI
    extends java.lang.Object
    implements java.lang.Runnable
    This class provides a REST based interface to IBM Tivoli Directory Integrator's server api as well as a few other services the server api currently does not provide. Validation is performed by the local server api (e.g. APIEngine.getLocalSession()) and any username/passwords passed in the request is forwarded to the local server api.

    The HTTPServerConnector is used to handle connections. All commands are delegated to a java class named after the command. A command of "status" will result in attempt to instantiate "com.ibm.di.eclipse.http.commands.StatusCommand". If no such class exists an attempt is made to execute a script

    This class is not intended to be used by other clients than the IBM Tivoli Directory Integrator configuration editor. It's functions and services are considered internal use only.

    • Constructor Detail

      • ServerAPI

        public ServerAPI()
                  throws java.lang.Exception
        Initializes this object with the default port (1098)
        Throws:
        java.lang.Exception
      • ServerAPI

        public ServerAPI​(int port,
                         boolean ssl)
                  throws java.lang.Exception
        Initializes this object with the provided port number.
        Parameters:
        port - The TCP port number for incoming connections
        Throws:
        java.lang.Exception
      • ServerAPI

        public ServerAPI​(HTTPServerConnector conn)
                  throws java.lang.Exception
        Initializes this object with an established connection.
        Parameters:
        conn - HTTPServerConnector instance
        Throws:
        java.lang.Exception
    • Method Detail

      • start

        public java.lang.Thread start()
        Creates a thread to run this object.
        Returns:
        The thread
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • logmsg

        public void logmsg​(java.lang.String string)
      • debugMsg

        public void debugMsg​(java.lang.String string)
      • getSession

        public Session getSession()
      • getRequest

        public Entry getRequest()
      • addPendingCommand

        public void addPendingCommand​(java.lang.String url,
                                      RestCommand obj)
        Adds a command to be retrieved by a subsequent URL request.
        Parameters:
        url - The name of the command
        obj - The value for the command
      • getPendingCommand

        public RestCommand getPendingCommand​(java.lang.String name)
        This method returns a pending RestCommand. The object is removed upon retrieval.
        Parameters:
        name - The name of the command to retrieve and remove.
        Returns:
        The value for the removed command.
      • isDebugOn

        public boolean isDebugOn()
        Returns true if debug level logging is enabled
        Returns:
        debug logging on/off