Class KodexService<I,​O>

  • Type Parameters:
    I - the input type
    O - the output type
    All Implemented Interfaces:
    de.iip_ecosphere.platform.services.environment.MonitoringService, de.iip_ecosphere.platform.services.environment.ParameterConfigurerProvider, de.iip_ecosphere.platform.services.environment.Service, de.iip_ecosphere.platform.services.environment.switching.ServiceBase

    public class KodexService<I,​O>
    extends de.iip_ecosphere.platform.services.environment.AbstractStringProcessService<I,​O>
    Integration of KIPROTECT KODEX as a service.
    Author:
    Holger Eichelberger, SSE
    • Nested Class Summary

      • Nested classes/interfaces inherited from class de.iip_ecosphere.platform.services.environment.AbstractProcessService

        de.iip_ecosphere.platform.services.environment.AbstractProcessService.RunnableWithStop
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String dataSpec  
      private static boolean DEBUG  
      static java.lang.String VERSION  
      static int WAITING_TIME_OTHER  
      static int WAITING_TIME_WIN  
      • Fields inherited from interface de.iip_ecosphere.platform.services.environment.switching.ServiceBase

        APPLICATION_SEPARATOR, DEFAULT_APPLICATION_INSTANCE_ID
    • Constructor Summary

      Constructors 
      Constructor Description
      KodexService​(de.iip_ecosphere.platform.transport.serialization.TypeTranslator<I,​java.lang.String> inTrans, de.iip_ecosphere.platform.transport.serialization.TypeTranslator<java.lang.String,​O> outTrans, de.iip_ecosphere.platform.transport.connectors.ReceptionCallback<O> callback, de.iip_ecosphere.platform.services.environment.YamlService yaml)
      Creates an instance of the service with the required type translators to/from JSON.
      KodexService​(de.iip_ecosphere.platform.transport.serialization.TypeTranslator<I,​java.lang.String> inTrans, de.iip_ecosphere.platform.transport.serialization.TypeTranslator<java.lang.String,​O> outTrans, de.iip_ecosphere.platform.transport.connectors.ReceptionCallback<O> callback, de.iip_ecosphere.platform.services.environment.YamlService yaml, java.lang.String dataSpec)
      Creates an instance of the service with the required type translators to/from JSON.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static void cleanFiles()
      Cleans up KODEX files.
      protected int getWaitTimeBeforeDestroy()  
      void migrate​(java.lang.String resourceId)  
      void reconfigure​(java.util.Map<java.lang.String,​java.lang.String> values)  
      protected de.iip_ecosphere.platform.services.environment.ServiceState start()  
      void switchTo​(java.lang.String targetId)  
      void update​(java.net.URI location)  
      • Methods inherited from class de.iip_ecosphere.platform.services.environment.AbstractStringProcessService

        handleInputStream, process, redirectIO
      • Methods inherited from class de.iip_ecosphere.platform.services.environment.AbstractProcessService

        addProcessSpecCmdArg, attachIngestor, attachMetricsProvider, configure, createAndConfigureProcess, createProcess, createProcess, getCallbacks, getExecutableName, getExecutableName, getExecutablePrefix, getExecutablePrefix, getExecutableSuffix, getInputTranslator, getOsArch, getOutputTranslator, getPid, getProcessId, getProcessSpec, getServiceIn, getServiceSpec, handleErrorStream, handleOutputStream, notifyCallbacks, processQuiet, redirectIO, selectNotNull, selectNotNull, setInheritIo, stop, waitAndDestroy, waitAndDestroy
      • Methods inherited from class de.iip_ecosphere.platform.services.environment.AbstractRunnablesService

        register
      • Methods inherited from class de.iip_ecosphere.platform.services.environment.AbstractService

        activate, addConfigurer, addConfigurer, addConfigurer, createInstance, createInstance, createInstance, getDescription, getId, getKind, getName, getNetMgtKeyAddress, getResourceAsStream, getState, getVersion, initializeFrom, isDeployable, isTopLevel, notifyReconfigured, passivate, reconf, reconfigure, rollbackReconfigurationOnFailure, setLibJars, setState
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface de.iip_ecosphere.platform.services.environment.Service

        activate, getDescription, getKind, getName, getNetMgtKeyAddress, getParameterConfigurer, getParameterNames, getVersion, isDeployable, isTopLevel, passivate
      • Methods inherited from interface de.iip_ecosphere.platform.services.environment.switching.ServiceBase

        getId, getState, setState
    • Constructor Detail

      • KodexService

        public KodexService​(de.iip_ecosphere.platform.transport.serialization.TypeTranslator<I,​java.lang.String> inTrans,
                            de.iip_ecosphere.platform.transport.serialization.TypeTranslator<java.lang.String,​O> outTrans,
                            de.iip_ecosphere.platform.transport.connectors.ReceptionCallback<O> callback,
                            de.iip_ecosphere.platform.services.environment.YamlService yaml)
        Creates an instance of the service with the required type translators to/from JSON. Data file is "data.yml".
        Parameters:
        inTrans - the input translator
        outTrans - the output translator
        callback - called when a processed item is received from the service
        yaml - the service description
      • KodexService

        public KodexService​(de.iip_ecosphere.platform.transport.serialization.TypeTranslator<I,​java.lang.String> inTrans,
                            de.iip_ecosphere.platform.transport.serialization.TypeTranslator<java.lang.String,​O> outTrans,
                            de.iip_ecosphere.platform.transport.connectors.ReceptionCallback<O> callback,
                            de.iip_ecosphere.platform.services.environment.YamlService yaml,
                            java.lang.String dataSpec)
        Creates an instance of the service with the required type translators to/from JSON.
        Parameters:
        inTrans - the input translator
        outTrans - the output translator
        callback - called when a processed item is received from the service
        yaml - the service description
        dataSpec - name of the data spec file (within the process home path) to pass to KODEX; related files such as api or actions must be there as well and referenced from the data spec file
    • Method Detail

      • cleanFiles

        static void cleanFiles()
        Cleans up KODEX files.
      • start

        protected de.iip_ecosphere.platform.services.environment.ServiceState start()
                                                                             throws java.util.concurrent.ExecutionException
        Overrides:
        start in class de.iip_ecosphere.platform.services.environment.AbstractService
        Throws:
        java.util.concurrent.ExecutionException
      • getWaitTimeBeforeDestroy

        protected int getWaitTimeBeforeDestroy()
        Overrides:
        getWaitTimeBeforeDestroy in class de.iip_ecosphere.platform.services.environment.AbstractProcessService<I,​java.lang.String,​java.lang.String,​O>
      • migrate

        public void migrate​(java.lang.String resourceId)
                     throws java.util.concurrent.ExecutionException
        Throws:
        java.util.concurrent.ExecutionException
      • update

        public void update​(java.net.URI location)
                    throws java.util.concurrent.ExecutionException
        Throws:
        java.util.concurrent.ExecutionException
      • switchTo

        public void switchTo​(java.lang.String targetId)
                      throws java.util.concurrent.ExecutionException
        Throws:
        java.util.concurrent.ExecutionException
      • reconfigure

        public void reconfigure​(java.util.Map<java.lang.String,​java.lang.String> values)
                         throws java.util.concurrent.ExecutionException
        Specified by:
        reconfigure in interface de.iip_ecosphere.platform.services.environment.Service
        Overrides:
        reconfigure in class de.iip_ecosphere.platform.services.environment.AbstractService
        Throws:
        java.util.concurrent.ExecutionException