Class KodexService<I,O>
- java.lang.Object
-
- de.iip_ecosphere.platform.services.environment.AbstractService
-
- de.iip_ecosphere.platform.services.environment.AbstractRunnablesService
-
- de.iip_ecosphere.platform.services.environment.AbstractProcessService<I,java.lang.String,java.lang.String,O>
-
- de.iip_ecosphere.platform.services.environment.AbstractStringProcessService<I,O>
-
- de.iip_ecosphere.platform.security.services.kodex.KodexService<I,O>
-
- Type Parameters:
I- the input typeO- 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
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringdataSpecprivate static booleanDEBUGstatic java.lang.StringVERSIONstatic intWAITING_TIME_OTHERstatic intWAITING_TIME_WIN
-
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 voidcleanFiles()Cleans up KODEX files.protected intgetWaitTimeBeforeDestroy()voidmigrate(java.lang.String resourceId)voidreconfigure(java.util.Map<java.lang.String,java.lang.String> values)protected de.iip_ecosphere.platform.services.environment.ServiceStatestart()voidswitchTo(java.lang.String targetId)voidupdate(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
-
-
-
-
Field Detail
-
WAITING_TIME_WIN
public static final int WAITING_TIME_WIN
- See Also:
- Constant Field Values
-
WAITING_TIME_OTHER
public static final int WAITING_TIME_OTHER
- See Also:
- Constant Field Values
-
VERSION
public static final java.lang.String VERSION
- See Also:
- Constant Field Values
-
DEBUG
private static final boolean DEBUG
- See Also:
- Constant Field Values
-
dataSpec
private java.lang.String dataSpec
-
-
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 translatoroutTrans- the output translatorcallback- called when a processed item is received from the serviceyaml- 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 translatoroutTrans- the output translatorcallback- called when a processed item is received from the serviceyaml- the service descriptiondataSpec- 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:
startin classde.iip_ecosphere.platform.services.environment.AbstractService- Throws:
java.util.concurrent.ExecutionException
-
getWaitTimeBeforeDestroy
protected int getWaitTimeBeforeDestroy()
-
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:
reconfigurein interfacede.iip_ecosphere.platform.services.environment.Service- Overrides:
reconfigurein classde.iip_ecosphere.platform.services.environment.AbstractService- Throws:
java.util.concurrent.ExecutionException
-
-