public interface IChannel<T>
IChannels are configured by one or more IChannelManagers.
All collected IMessages can be processed by IChannelTasks.| Modifier and Type | Method and Description |
|---|---|
default ISubChannel<?> |
createChildScope(UUID scopeId,
String scopeName,
ISubChannel<?> parentScope,
Map<String,Object> configurationProperties,
Map<String,Object> stateProperties)
create
ISubChannel for IChannel |
ISubChannel |
createChildScope(UUID scopeId,
String scopeName,
ISubChannel parentScope,
Map<String,Object> configurationProperties,
Map<String,Object> stateProperties,
boolean adoptContoller,
boolean adoptServices)
create
ISubChannel for IChannel |
default <T> T |
getAdapter(Class<T> adapterClass)
get registered adapter
|
default <T> T |
getAdapter(Class<T> adapterClass,
Supplier<T> adapterFactoryIfNotExists)
get registered adapter
|
ISubChannel |
getChildScope(UUID scopeId)
returns scope with given
scopeId |
List<ISubChannel> |
getChildScopes()
getter for child scope list.
|
IPropertyBlock |
getConfigurationPropertyBlock()
getter for configuration propertyblock of queue
|
IMessageDispatcher |
getDispatcher()
getter for global dispatchter service
|
String |
getId()
getter for channel id
|
IMessage |
getMessage(String uuid)
returns
IMessage queued with uuid |
DequeSnapshot<IMessage<T>> |
getMessageSnapshot()
return message snapshot
|
DequeSnapshot<IMessage<T>> |
getMessageSnapshotPoll()
return message snapshot-poll (remove returned elements from channel)
|
IChannel<?> |
getRootChannel()
returns root scope
|
IPropertyBlock |
getStatePropertyBlock()
getter for state propertyblock of queue
|
IChannelTask |
getTask(String id)
returns
IChannelTask scheduled under registration id |
IPropertyBlock |
getTaskPropertyBlock(String id)
returns properties of
IChannelTask scheduled under registration id |
default <T> void |
removeAdapter(Class<T> adapterClass)
remove registered adapter
|
boolean |
removeMessage(String uuid)
remove
IMessage queued with uuid |
boolean |
removeMessageList(List<String> uuidList)
remove list of
IMessages queued with one of uuids |
IChannelTask |
removeTask(String id)
remove
IChannelTask scheduled under registration id |
IChannelTask |
rescheduleTask(String id,
long executionTimeStamp,
long timeOutValue,
long heartBeatTimeOut)
reset execution plan for an existing
IChannelTask |
String |
scheduleTask(IChannelTask task)
schedule a anonymous
IChannelTask to IChannel
equivalent to scheduleTask(null,task, null, -1, -1, -1); |
String |
scheduleTask(String id,
IChannelTask task)
schedule a
IChannelTask to IChannel. |
String |
scheduleTask(String id,
IChannelTask task,
IPropertyBlock propertyBlock,
long executionTimeStamp,
long timeOutValue,
long heartBeatTimeOut)
schedule a
IChannelTask to IChannel. |
String |
scheduleTask(String id,
IChannelTask task,
IPropertyBlock propertyBlock,
long executionTimeStamp,
long timeOutValue,
long heartBeatTimeOut,
boolean stopOnTimeOut)
schedule a
IChannelTask to IChannel. |
default <T> void |
setAdapter(Class<T> adapterClass,
T adapter)
register an adapter
|
void |
signal(String signal)
Sends a signal.
|
default void |
storeMessage(T messagePayload)
store a message with default header
|
void |
storeMessage(T messagePayload,
Consumer<MessageHeader> messageHeaderSetter)
store a message
|
default Future<IOnMessageStoreResult> |
storeMessageWithResult(T messagePayload)
store a message with result
|
Future<IOnMessageStoreResult> |
storeMessageWithResult(T messagePayload,
Consumer<MessageHeader> messageHeaderSetter)
store a message with result
|
String getId()
default void storeMessage(T messagePayload) throws ChannelIsFullException
messagePayload - payload of message to store in channelChannelIsFullException - is thrown if message channel exceeds max allowed message sizevoid storeMessage(T messagePayload, Consumer<MessageHeader> messageHeaderSetter) throws ChannelIsFullException
messagePayload - payload of message to store in channelmessageHeaderSetter - consumer to set message header propertiesChannelIsFullException - is thrown if message channel exceeds max allowed message sizedefault Future<IOnMessageStoreResult> storeMessageWithResult(T messagePayload) throws ChannelIsFullException
messagePayload - payload of message to store in channelIOnMessageStoreResultChannelIsFullExceptionFuture<IOnMessageStoreResult> storeMessageWithResult(T messagePayload, Consumer<MessageHeader> messageHeaderSetter) throws ChannelIsFullException
messagePayload - payload of message to store in channelmessageHeaderSetter - consumer to set message header propertiesIOnMessageStoreResultChannelIsFullExceptionIPropertyBlock getConfigurationPropertyBlock()
IPropertyBlock of queue for configuration detailsIPropertyBlock getStatePropertyBlock()
IPropertyBlock of queue for work stateIMessageDispatcher getDispatcher()
IMessageDispatcherIMessage getMessage(String uuid)
IMessage queued with uuiduuid - searchfilteruuid or null if not presentDequeSnapshot<IMessage<T>> getMessageSnapshot()
DequeSnapshot<IMessage<T>> getMessageSnapshotPoll()
default <T> void setAdapter(Class<T> adapterClass, T adapter) throws PropertyIsLockedException
adapterClass - type of adapteradapter - implementation of adapterPropertyIsLockedExceptiondefault <T> T getAdapter(Class<T> adapterClass)
adapterClass - type of adapterdefault <T> T getAdapter(Class<T> adapterClass, Supplier<T> adapterFactoryIfNotExists)
adapterClass - type of adapteradapterFactoryIfNotExists - factory to create adapter if not exists , and store with specified keydefault <T> void removeAdapter(Class<T> adapterClass) throws PropertyIsLockedException
adapterClass - type of adapterPropertyIsLockedExceptionboolean removeMessageList(List<String> uuidList)
IMessages queued with one of uuidsString scheduleTask(IChannelTask task)
IChannelTask to IChannel
equivalent to scheduleTask(null,task, null, -1, -1, -1);task - IChannelTask to scheduleString scheduleTask(String id, IChannelTask task)
IChannelTask to IChannel.id - registration-id for IChannelTask to scheduletask - IChannelTask to scheduleString scheduleTask(String id, IChannelTask task, IPropertyBlock propertyBlock, long executionTimeStamp, long timeOutValue, long heartBeatTimeOut)
IChannelTask to IChannel.id - registration-id for IChannelTask to scheduletask - IChannelTask to schedulepropertyBlock - IChannelTask-properties (factory in IMessageDispatcher)executionTimeStamp - execution time millistimeOutValue - timeout value in ms, before notify for timeoutheartBeatTimeOut - heartbeat-timeout value in ms, before notify for timeoutString scheduleTask(String id, IChannelTask task, IPropertyBlock propertyBlock, long executionTimeStamp, long timeOutValue, long heartBeatTimeOut, boolean stopOnTimeOut)
IChannelTask to IChannel.id - registration-id for IChannelTask to scheduletask - IChannelTask to schedulepropertyBlock - IChannelTask-properties (factory in IMessageDispatcher)executionTimeStamp - execution time millistimeOutValue - timeout value in ms, before notify for timeoutheartBeatTimeOut - heartbeat-timeout value in ms, before notify for timeoutstopOnTimeOut - stop unlinked worker-thread on timeout. This option is NOT necessary to create new worker running other tasks. Attention: can be dangerousIChannelTask rescheduleTask(String id, long executionTimeStamp, long timeOutValue, long heartBeatTimeOut)
IChannelTask
The execution timestamp is ignored if current execution plan requires earlier execution in the future and was requested by trigger, tasks control and periodic service configuration
id - registration-id of IChannelTask in which reset execution planexecutionTimeStamp - new execution time millistimeOutValue - new timeout value in ms, before notify for timeoutheartBeatTimeOut - heartbeat-timeout value in ms, before notify for timeoutIChannelTask or null if not foundIChannelTask getTask(String id)
IChannelTask scheduled under registration idid - registration-id for IChannelTaskIChannelTask scheduled under registration idIChannelTask removeTask(String id)
IChannelTask scheduled under registration idid - registration-id for IChannelTask to removeIChannelTask or null if no scheduled with id foundIPropertyBlock getTaskPropertyBlock(String id)
IChannelTask scheduled under registration idid - registration-id for IChannelTaskIChannelTask scheduled under registration idvoid signal(String signal)
IChannelManager manage this IChannel and implements IOnChannelSignal will notify asynchronously by queueworker.signal - IChannel<?> getRootChannel()
default ISubChannel<?> createChildScope(UUID scopeId, String scopeName, ISubChannel<?> parentScope, Map<String,Object> configurationProperties, Map<String,Object> stateProperties)
ISubChannel for IChannelscopeId - unique id of scope (unique by queue) or null for auto-generationscopeName - human readable name of scope (nullable)parentScope - parent scope to define tree structure for scopesconfigurationProperties - blue print for configuration propertyblock of new scope (nullable)stateProperties - blue print for state propertyblock of new scope (nullable)ISubChannel createChildScope(UUID scopeId, String scopeName, ISubChannel parentScope, Map<String,Object> configurationProperties, Map<String,Object> stateProperties, boolean adoptContoller, boolean adoptServices)
ISubChannel for IChannelscopeId - unique id of scope (unique by queue) or null for auto-generationscopeName - human readable name of scope (nullable)parentScope - parent scope to define tree structure for scopesconfigurationProperties - blue print for configuration propertyblock of new scope (nullable)stateProperties - blue print for state propertyblock of new scope (nullable)adoptContoller - keep controller of parent queueadoptServices - keep services of parent queueList<ISubChannel> getChildScopes()
ISubChannel getChildScope(UUID scopeId)
scopeIdscopeId - id of scope to returnscopeId or null, if scope not foundCopyright © 2020. All rights reserved.