Package org.nuxeo.runtime.stream
Class StreamServiceImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.runtime.stream.StreamServiceImpl
-
- All Implemented Interfaces:
Adaptable
,Component
,Extensible
,TimestampedService
,StreamService
public class StreamServiceImpl extends DefaultComponent implements StreamService
- Since:
- 9.3
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
StreamServiceImpl.ComponentsLifeCycleListener
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_CODEC
protected Boolean
isStreamProcessingDisabled
protected LogManager
logManager
static String
NUXEO_STREAM_DIR_PROP
static String
NUXEO_STREAM_RET_DURATION_PROP
protected Map<String,StreamProcessor>
processors
static String
STREAM_PROCESSING_ENABLED
protected StreamManager
streamManager
protected static String
XP_LOG_CONFIG
protected static String
XP_STREAM_PROCESSOR
-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description StreamServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LogConfig
createChronicleLogConfig(LogConfigDescriptor desc)
protected LogConfig
createKafkaLogConfig(LogConfigDescriptor desc)
protected void
createLogIfNotExists(LogConfigDescriptor config)
int
getApplicationStartedOrder()
The component notification order forComponent.applicationStarted(org.nuxeo.runtime.model.ComponentContext)
.protected Path
getChroniclePath(String basePath)
protected String
getChronicleRetention(String retention)
protected List<LogConfig>
getLogConfigs()
LogManager
getLogManager()
protected Settings
getSettings(StreamProcessorDescriptor descriptor)
StreamManager
getStreamManager()
protected void
initProcessor(StreamProcessorDescriptor descriptor)
protected boolean
isProcessingDisabled()
void
start(ComponentContext context)
Start the component.protected void
startProcessors()
void
stop(ComponentContext context)
Stop the component.void
stopProcessors()
-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterContribution, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted
-
Methods inherited from interface org.nuxeo.runtime.stream.StreamService
getLogManager, getStreamManager
-
-
-
-
Field Detail
-
NUXEO_STREAM_DIR_PROP
public static final String NUXEO_STREAM_DIR_PROP
- See Also:
- Constant Field Values
-
NUXEO_STREAM_RET_DURATION_PROP
public static final String NUXEO_STREAM_RET_DURATION_PROP
- See Also:
- Constant Field Values
-
DEFAULT_CODEC
public static final String DEFAULT_CODEC
- See Also:
- Constant Field Values
-
XP_LOG_CONFIG
protected static final String XP_LOG_CONFIG
- See Also:
- Constant Field Values
-
XP_STREAM_PROCESSOR
protected static final String XP_STREAM_PROCESSOR
- See Also:
- Constant Field Values
-
logManager
protected LogManager logManager
-
streamManager
protected StreamManager streamManager
-
processors
protected final Map<String,StreamProcessor> processors
-
STREAM_PROCESSING_ENABLED
public static final String STREAM_PROCESSING_ENABLED
- Since:
- 11.2
- See Also:
- Constant Field Values
-
isStreamProcessingDisabled
protected Boolean isStreamProcessingDisabled
-
-
Constructor Detail
-
StreamServiceImpl
public StreamServiceImpl()
-
-
Method Detail
-
getApplicationStartedOrder
public int getApplicationStartedOrder()
Description copied from interface:Component
The component notification order forComponent.applicationStarted(org.nuxeo.runtime.model.ComponentContext)
.Components are notified in increasing order. Order 1000 is the default order for components that don't care. Order 100 is the repository initialization.
- Specified by:
getApplicationStartedOrder
in interfaceComponent
- Returns:
- the order, 1000 by default
-
getLogManager
public LogManager getLogManager()
- Specified by:
getLogManager
in interfaceStreamService
-
getStreamManager
public StreamManager getStreamManager()
- Specified by:
getStreamManager
in interfaceStreamService
-
getChronicleRetention
protected String getChronicleRetention(String retention)
-
getChroniclePath
protected Path getChroniclePath(String basePath)
-
createLogIfNotExists
protected void createLogIfNotExists(LogConfigDescriptor config)
-
start
public void start(ComponentContext context)
Description copied from interface:Component
Start the component. This method is called after all the components were resolved and activated- Specified by:
start
in interfaceComponent
- Overrides:
start
in classDefaultComponent
-
getLogConfigs
protected List<LogConfig> getLogConfigs()
-
createKafkaLogConfig
protected LogConfig createKafkaLogConfig(LogConfigDescriptor desc)
-
createChronicleLogConfig
protected LogConfig createChronicleLogConfig(LogConfigDescriptor desc)
-
initProcessor
protected void initProcessor(StreamProcessorDescriptor descriptor)
-
getSettings
protected Settings getSettings(StreamProcessorDescriptor descriptor)
-
stop
public void stop(ComponentContext context) throws InterruptedException
Description copied from interface:Component
Stop the component.- Specified by:
stop
in interfaceComponent
- Overrides:
stop
in classDefaultComponent
- Throws:
InterruptedException
-
startProcessors
protected void startProcessors()
-
stopProcessors
public void stopProcessors()
- Specified by:
stopProcessors
in interfaceStreamService
-
isProcessingDisabled
protected boolean isProcessingDisabled()
-
-