Class Gateway


public class Gateway extends ProxyManager
The Gateway is the central object of a CRISTAL process. It initializes, maintains and shuts down every other subsystem in both the client and the server. Child objects:
  • Lookup - Provides access to the CRISTAL directory. Find or search for Items or Agents.
  • ProxyManager - Gives a local proxy object for Entities found in the directory. Execute activities in Items, query or subscribe to Entity data.
  • Method Details

    • init

      public static void init(Properties props) throws InvalidDataException
      Initialises the Gateway and all of the client objects it holds, with the exception of the Lookup, which is initialised during connect()
      Parameters:
      props - - java.util.Properties containing all application properties. If null, the java system properties are used
      Throws:
      InvalidDataException - - invalid properties caused a failure in initialisation
    • init

      public static void init(Properties props, ResourceLoader res) throws InvalidDataException
      Initialises the Gateway and all of the client objects it holds, with the exception of the Lookup, which is initialised during connect()
      Parameters:
      props - - java.util.Properties containing all application properties. If null, the java system properties are used
      res - - ResourceLoader for the kernel to use to resolve all class resource requests such as for bootstrap descriptions and version information
      Throws:
      InvalidDataException - - invalid properties caused a failure in initialisation
    • startServer

      public static void startServer() throws InvalidDataException, CannotManageException
      Makes this process capable of creating and managing server entities. Runs the Creates the LookupManager, ProxyServer, initialises the vertx services
      Throws:
      InvalidDataException
      CannotManageException
    • getModuleManager

      public static ModuleManager getModuleManager()
      Static getter for ModuleManager
      Returns:
      ModuleManager
    • connect

      public static void connect() throws CriseVertxException
      Connects to the Lookup server in an administrative context. It shall be used in server processes only.
      Throws:
      InvalidDataException - - bad params
      PersistencyException - - error starting storages
      ObjectNotFoundException - - object not found
      CriseVertxException
    • connect

      public static AgentProxy connect(String agentName, String agentPassword) throws CriseVertxException
      Log in with the given username and password, and initialises the Lookup and ProxyManager. It shall be used in client processes only.
      Parameters:
      agentName - - username
      agentPassword - - password
      Returns:
      an AgentProxy on the requested user
      Throws:
      InvalidDataException - - bad params
      PersistencyException - - error starting storages
      ObjectNotFoundException - - object not found
      CriseVertxException
    • connect

      public static AgentProxy connect(String agentName, String agentPassword, String resource) throws CriseVertxException
      Log in with the given username and password, and initialises the Lookup and ProxyManager. It shall be uses in client processes only.
      Parameters:
      agentName - - username
      agentPassword - - password
      resource - - resource
      Returns:
      an AgentProxy on the requested user
      Throws:
      InvalidDataException - - bad params
      PersistencyException - - error starting storages
      ObjectNotFoundException - - object not found
      CriseVertxException
    • close

      public static void close()
      Shuts down all kernel API objects
    • getSecurityManager

      public static SecurityManager getSecurityManager()
    • getLookup

      public static Lookup getLookup()
    • getLookupManager

      public static LookupManager getLookupManager() throws CannotManageException
      Throws:
      CannotManageException
    • getVertx

      public static io.vertx.core.Vertx getVertx()
    • getStorage

      public static ClusterStorageManager getStorage()
    • getMarshaller

      public static CastorXMLUtility getMarshaller()
    • getResource

      public static ResourceLoader getResource()
    • getProxyManager

      public static ProxyManager getProxyManager()
      Deprecated.
      use static getProxy(...) methods of Gateway
      Returns:
      the instance of ProxyManager
    • getCentreId

      public static String getCentreId()
    • propertyNames

      public static Enumeration<?> propertyNames()
    • dumpC2KProps

      public static void dumpC2KProps()
    • getProperties

      public static ObjectProperties getProperties()
    • getKernelVersion

      public static String getKernelVersion()
    • getResourceImportHandler

      @Deprecated public static ResourceImportHandler getResourceImportHandler(String resType) throws Exception
      Deprecated.
      Retrieves the ResourceImportHandler available for the resource type. It creates a new if configured or falls back to the default one provided in the kernel
      Parameters:
      resType - the type o the Resource. ie. one of these values: OD/SC/SM/EA/CA/QL
      Returns:
      the initialised ResourceImportHandler
      Throws:
      Exception
    • getResourceImportHandler

      public static ResourceImportHandler getResourceImportHandler(BuiltInResources resType) throws Exception
      Retrieves the ResourceImportHandler available for the resource type. It creates a new if configured or falls back to the default one provided in the kernel
      Parameters:
      resType - the type o the Resource
      Returns:
      the initialised ResourceImportHandler
      Throws:
      Exception
    • runBoostrap

      public static void runBoostrap() throws Exception
      Run the different kind of Boostrap processes
      Throws:
      Exception - anything could happen
    • sendProxyEvent

      public static void sendProxyEvent(ProxyMessage message)
      Send a single ProxyMessage to the subscribers
      Parameters:
      message - the be sent
    • sendProxyEvent

      public static void sendProxyEvent(Set<ProxyMessage> messages)
      Send a Set of ProxyMessages to the subscribers
      Parameters:
      messages -