public class DirectServiceAccessor extends java.lang.Object implements ServiceAccessor
Title: Service Event Fabric Core
Description: Implements the ServiceAccessor
defining a direct accessor to a service.
Copyright: Copyright (c) 2020
Company: StreamScape Technologies
Constructor and Description |
---|
DirectServiceAccessor(com.streamscape.sef.dispatcher.ServiceAccessorProxy serviceAccessorProxy) |
Modifier and Type | Method and Description |
---|---|
void |
addEventTrigger(java.lang.String triggerSyntax)
Adds a new event trigger to the component.
|
void |
alterEventTrigger(java.lang.String triggerSyntax)
Alters event trigger.
|
boolean |
autoSwitching()
Checks if the accessor will automatically switch to another suitable component located in a node with a higher weight
(see
FabricNodeReference.getWeight() for details) or in a node from the same cluster as the current node. |
void |
close()
Closes the accessor.
|
void |
compileEventTrigger(java.lang.String triggerName)
Compiles the trigger into a full fledged consumer by validating the script, loading it's trigger
action and initializing the filtering logic.
|
void |
disableEventTrigger(java.lang.String triggerName)
If service is running sets enabled to false and disables a trigger with a given name, halting event processing.
|
void |
enableEventTrigger(java.lang.String triggerName)
If service is running sets enabled to true and enables a trigger with a given name allowing it to process events.
|
boolean |
existsActionableEvent(java.lang.String eventId)
Checks if an event with the specified id is registered as actionable.
|
boolean |
existsEventTrigger(java.lang.String triggerName)
Checks if an event trigger with the specified name exists in the configuration.
|
java.lang.String |
getAccessorName()
Returns the name of the accessor.
|
java.lang.String |
getActualNodeName()
Returns a name of the actual node containing the accessed component.
|
ComponentModel |
getComponentModel()
Returns a model of the accessed component.
|
java.lang.String |
getComponentName()
Returns a name of the accessed component.
|
java.lang.String |
getComponentType()
Returns a type of the accessed component.
|
java.lang.String |
getEventHandlerParameterName(java.lang.String handlerName) |
RPLMethodsCache.RPLMethodInfo |
getEventHandlerRPLMethodInfo(java.lang.String handlerName) |
java.util.List |
getEventHandlers()
Returns a list of all event handlers in the accessed service.
|
EventScope |
getEventScope()
Returns an event scope of the accessor.
|
EventTriggerData |
getEventTriggerData(java.lang.String triggerName)
Returns event trigger data.
|
EventTriggerDefinition |
getEventTriggerDefinition(java.lang.String triggerName)
Returns a trigger definition with a specific name.
|
java.util.List |
getEventTriggerDefinitions()
Returns a list of event trigger definitions in this configuration.
|
java.lang.String |
getEventTriggerSyntax(java.lang.String triggerName)
Returns full event trigger syntax.
|
java.lang.String |
getLastError(java.lang.String triggerName)
Returns last error which occurred on trigger invocation,
null if trigger doesn't exist or no errors occurred.
|
com.streamscape.slex.MFSession |
getMFSession() |
java.lang.String |
getName()
Returns the full name name of the entity.
|
java.lang.String |
getNodeName()
Returns a name of the node that should contain the accessed component.
|
long |
getRequestTimeout()
Returns a time (in milliseconds) of waiting for a response in
invokeRequest methods. |
AccessorSessionReference |
getSession()
Returns the accessor session.
|
TriggerActionTime |
getTriggerActionTime(java.lang.String triggerName)
Returns trigger type.
|
EventTriggerState |
getTriggerState(java.lang.String triggerName)
Returns trigger state, null if trigger doesn't exist
|
boolean |
hasActionableEvents()
Indicates if the component has actionable events.
|
boolean |
hasEventTriggers()
Indicates if the configuration has event triggers.
|
boolean |
hasSinkEvents()
Indicates if the component has any event handlers.
|
void |
invokeAsyncServiceRequest(ImmutableEventDatagram request)
Sends the specified request asynchronously.
|
SLResponse |
invokeCompleteRequest(java.lang.String statement)
Performs the
FabricComponentAccessor.invokeCompleteRequest(String, long) with a timeout
previously set by the FabricComponentAccessor.setRequestTimeout(long) method or default timeout (30 seconds). |
SLResponse |
invokeCompleteRequest(java.lang.String command,
long timeout)
Sends the completion request for specified statement and waits until a response will be received or waiting period will expire.
|
SLResponse |
invokeInterruptRequest(java.lang.String command)
Sends the interruption request for specified statement and waits until a response will be received or waiting period will expire.
|
SLResponse |
invokeLanguageRequest(SLStatement statement)
Performs the
FabricComponentAccessor.invokeLanguageRequest(com.streamscape.sdo.operation.SLStatement, long) with a timeout
previously set by the FabricComponentAccessor.setRequestTimeout(long) method or default timeout (30 seconds). |
SLResponse |
invokeLanguageRequest(SLStatement statement,
long timeout)
Sends the specified statement and waits until a response will be received or waiting period will expire.
|
SLResponse |
invokeLanguageRequest(java.lang.String statement)
Performs the
FabricComponentAccessor.invokeLanguageRequest(String, long) with a timeout
previously set by the FabricComponentAccessor.setRequestTimeout(long) method or default timeout (30 seconds). |
SLResponse |
invokeLanguageRequest(java.lang.String statement,
long timeout)
Sends the specified statement and waits until a response will be received or waiting period will expire.
|
ImmutableEventDatagram |
invokeServiceRequest(EventDatagram request,
RequestDistributionStrategy strategy)
Performs the
ServiceAccessor.invokeServiceRequest(com.streamscape.sdo.EventDatagram, com.streamscape.sdo.enums.RequestDistributionStrategy, long)
with a timeout previously set by the FabricComponentAccessor.setRequestTimeout(long) method or default timeout (30 seconds). |
ImmutableEventDatagram |
invokeServiceRequest(EventDatagram request,
RequestDistributionStrategy strategy,
long timeout)
Sends the specified request and waits until a response will be received or waiting period will expire.
|
ImmutableEventDatagram |
invokeServiceRequest(ImmutableEventDatagram request)
Performs the
ServiceAccessor.invokeServiceRequest(ImmutableEventDatagram, long) with a timeout
previously set by the FabricComponentAccessor.setRequestTimeout(long) method or default timeout (30 seconds). |
ImmutableEventDatagram |
invokeServiceRequest(ImmutableEventDatagram request,
long timeout)
Sends the specified request and waits until a response will be received or waiting period will expire.
|
java.lang.Object |
invokeServiceRequest(java.lang.String eventHandler,
EIMObject eimData,
java.lang.Object data)
Performs the
ServiceAccessor.invokeServiceRequest(String, EIMObject, Object, long) with a timeout
previously set by the FabricComponentAccessor.setRequestTimeout(long) method or default timeout (30 seconds). |
java.lang.Object |
invokeServiceRequest(java.lang.String eventHandler,
EIMObject eimData,
java.lang.Object data,
long timeout)
Invokes the specified event handler and waits until a response will be received or waiting period will expire.
|
java.lang.Object |
invokeServiceRequest(java.lang.String eventHandler,
java.lang.Object data)
Performs the
ServiceAccessor.invokeServiceRequest(String, Object, long) with a timeout
previously set by the FabricComponentAccessor.setRequestTimeout(long) method or default timeout (30 seconds). |
java.lang.Object |
invokeServiceRequest(java.lang.String eventHandler,
java.lang.Object data,
long timeout)
Invokes the specified event handler and waits until a response will be received or waiting period will expire.
|
java.lang.Object |
invokeServiceRequest(java.lang.String eventHandler,
java.lang.Object data,
java.util.Map properties,
long timeout)
Performs the
ServiceAccessor.invokeServiceRequest(String, Object, long) with adding properties for event handler |
boolean |
isAvailable()
Checks if the accessed component is available.
|
boolean |
isEventHandlerValid(java.lang.String handlerName)
Checks if the specified event handler is valid.
|
boolean |
isEventTriggerAutoEnable(java.lang.String triggerName)
Returns event trigger auto-enable flag.
|
boolean |
isOpened()
Checks if the accessor is opened.
|
java.util.List |
listActionableEvents()
Lists all registered actionable events for this component.
|
java.util.List |
listActiveEvents()
Returns a list of all active events in service.
|
java.util.List |
listEventHandlers()
Returns a list of names of all event handlers in the accessed service.
|
java.util.List |
listEventTriggers()
Returns a list of event triggers set on this component.
|
java.util.List |
listSinkEvents()
Lists all registered events processed by this component's handlers.
|
EventHandler |
lookupEventHandler(java.lang.String handlerName)
Finds and returns an event handler with the specified name.
|
EventHandler |
lookupEventHandlerByMethod(java.lang.String methodName)
Finds and returns an event handler corresponding to the specified method of the accessed service.
|
void |
removeAllEventTriggers()
Removes all event triggers from this component.
|
void |
removeEventTrigger(java.lang.String triggerName)
Removes an event trigger from the component.
|
boolean |
resync()
Resynchronizes the accessor.
|
void |
setAutoSwitching(boolean autoSwitching)
Sets a parameter specifying if the accessor will automatically switch to another suitable component located in a node
with a higher weight (see
FabricNodeReference.getWeight() for details) or in a node from the same cluster as the current node. |
void |
setEventTriggerAutoEnable(java.lang.String triggerName,
boolean autoEnable)
Sets event trigger auto-enable flag.
|
void |
setRequestTimeout(long timeout)
Sets a time (in milliseconds) of waiting for a response in
invokeRequest methods. |
void |
setStateListener(FabricComponentAccessorStateListener listener)
Performs the
FabricComponentAccessor.setStateListener(FabricComponentAccessorStateListener, long) with a default repeat interval (5 minutes). |
void |
setStateListener(FabricComponentAccessorStateListener listener,
long repeatInterval)
Sets the specified listener that reacts on changing state of the accessor.
|
boolean |
switchComponent()
Switches to another suitable component located in a node with a higher weight (see
FabricNodeReference.getWeight() for details)
or in a node from the same cluster as the current node. |
public DirectServiceAccessor(com.streamscape.sef.dispatcher.ServiceAccessorProxy serviceAccessorProxy)
public ImmutableEventDatagram invokeServiceRequest(ImmutableEventDatagram request) throws FabricComponentAccessorException, FabricEventSourceException, ServiceFrameworkException
ServiceAccessor
ServiceAccessor.invokeServiceRequest(ImmutableEventDatagram, long)
with a timeout
previously set by the FabricComponentAccessor.setRequestTimeout(long)
method or default timeout (30 seconds).invokeServiceRequest
in interface ServiceAccessor
request
- the request to be sent.FabricComponentAccessorException
- if the accessor is closed or
if the accessed service is not available or
if some other error occurs.FabricEventSourceException
- if some error occurs in the Exchange.ServiceFrameworkException
- if some error occurs during processing of the request in the event handler.public ImmutableEventDatagram invokeServiceRequest(ImmutableEventDatagram request, long timeout) throws FabricComponentAccessorException, FabricEventSourceException, ServiceFrameworkException
ServiceAccessor
This method does not ignore an event selector that can be set for the specified event handler.
invokeServiceRequest
in interface ServiceAccessor
request
- the request to be sent.timeout
- the waiting time for a response (in milliseconds).FabricComponentAccessorException
- if the accessor is closed or
if the accessed service is not available.FabricEventSourceException
- if some error occurs in the Exchange.ServiceFrameworkException
- if some error occurs during processing of the request in the event handler.public java.lang.Object invokeServiceRequest(java.lang.String eventHandler, java.lang.Object data) throws FabricComponentAccessorException, ServiceFrameworkException
ServiceAccessor
ServiceAccessor.invokeServiceRequest(String, Object, long)
with a timeout
previously set by the FabricComponentAccessor.setRequestTimeout(long)
method or default timeout (30 seconds).invokeServiceRequest
in interface ServiceAccessor
eventHandler
- the name of the event to be invoked.data
- the data object to be passed to event handler.FabricComponentAccessorException
- if the accessor is closed or
if the accessed service is not available or
if some other error occurs in the Exchange.ServiceFrameworkException
- if some error occurs during processing of the request in the event handler.public java.lang.Object invokeServiceRequest(java.lang.String eventHandler, java.lang.Object data, long timeout) throws FabricComponentAccessorException, ServiceFrameworkException
ServiceAccessor
This method ignores an event selector that can be set for the specified event handler.
invokeServiceRequest
in interface ServiceAccessor
eventHandler
- the name of the event handler to be invoked.data
- the data object to be passed to event handler.timeout
- the waiting time for a response (in milliseconds).FabricComponentAccessorException
- if the accessor is closed or
if the accessed service is not available or
if some other error occurs in the Exchange.ServiceFrameworkException
- if some error occurs during processing of the request in the event handler.public java.lang.Object invokeServiceRequest(java.lang.String eventHandler, java.lang.Object data, java.util.Map properties, long timeout) throws FabricComponentAccessorException, ServiceFrameworkException
ServiceAccessor
ServiceAccessor.invokeServiceRequest(String, Object, long)
with adding properties for event handlerinvokeServiceRequest
in interface ServiceAccessor
eventHandler
- the name of the event handler to be invoked.data
- the data object to be passed to event handler.properties
- the map of properties to be passed to event handler.timeout
- the waiting time for a response (in milliseconds).FabricComponentAccessorException
- if the accessor is closed or
if the accessed service is not available or
if some other error occurs in the Exchange.ServiceFrameworkException
- if some error occurs during processing of the request in the event handler.public java.lang.Object invokeServiceRequest(java.lang.String eventHandler, EIMObject eimData, java.lang.Object data) throws FabricComponentAccessorException, ServiceFrameworkException
ServiceAccessor
ServiceAccessor.invokeServiceRequest(String, EIMObject, Object, long)
with a timeout
previously set by the FabricComponentAccessor.setRequestTimeout(long)
method or default timeout (30 seconds).invokeServiceRequest
in interface ServiceAccessor
eventHandler
- the name of the event handler to be invoked.eimData
- the EIM data of the event associated with the specified handler.data
- the data object to be passed to event handler.FabricComponentAccessorException
- if the accessor is closed or
if the accessed service is not available or
if some other error occurs in the Exchange.ServiceFrameworkException
- if some error occurs during processing of the request in the event handler.public java.lang.Object invokeServiceRequest(java.lang.String eventHandler, EIMObject eimData, java.lang.Object data, long timeout) throws FabricComponentAccessorException, ServiceFrameworkException
ServiceAccessor
This method ignores an event selector that can be set for the specified event handler.
invokeServiceRequest
in interface ServiceAccessor
eventHandler
- the name of the event handler to be invoked.eimData
- the EIM data of the event associated with the specified handler.data
- the data object to be passed to event handler.timeout
- the waiting time for a response (in milliseconds).FabricComponentAccessorException
- if the accessor is closed or
if the accessed service is not available or
if some other error occurs in the Exchange.ServiceFrameworkException
- if some error occurs during processing of the request in the event handler.public ImmutableEventDatagram invokeServiceRequest(EventDatagram request, RequestDistributionStrategy strategy) throws FabricComponentAccessorException, FabricEventSourceException, ServiceFrameworkException
ServiceAccessor
ServiceAccessor.invokeServiceRequest(com.streamscape.sdo.EventDatagram, com.streamscape.sdo.enums.RequestDistributionStrategy, long)
with a timeout previously set by the FabricComponentAccessor.setRequestTimeout(long)
method or default timeout (30 seconds).invokeServiceRequest
in interface ServiceAccessor
request
- the request to be sent.strategy
- the strategy used for a distribution of the request.FabricComponentAccessorException
- if the accessor is closed or
if the accessed service is not available or
if some other error occurs.FabricEventSourceException
- if some error occurs in the Exchange.ServiceFrameworkException
- if some error occurs during processing of the request in the event handler.public ImmutableEventDatagram invokeServiceRequest(EventDatagram request, RequestDistributionStrategy strategy, long timeout) throws FabricComponentAccessorException, FabricEventSourceException, ServiceFrameworkException
ServiceAccessor
GLOBAL
, the request is sent to all suitable services
(i.e. services with suitable type and name in all Fabric nodes) and the first acknowledgement received by the accessor
is returned as the response.
replyTo
field in the request manually, the accessed service will not
send an automatic acknowledgement on this request. In this case an acknowledgement should be sent by the corresponding event handler
or event trigger manually by the user.
Only AUCTION
distribution strategy is supported at present.
invokeServiceRequest
in interface ServiceAccessor
request
- the request to be sent.strategy
- the strategy used for a distribution of the request.timeout
- the waiting time for a response (in milliseconds).FabricComponentAccessorException
- if the accessor is closed or
if the accessed service is not available.FabricEventSourceException
- if some error occurs in the Exchange.ServiceFrameworkException
- if some error occurs during processing of the request in the event handler.public void invokeAsyncServiceRequest(ImmutableEventDatagram request) throws FabricComponentAccessorException, FabricEventSourceException
ServiceAccessor
GLOBAl
, the request is sent to all suitable services
(i.e. services with suitable type and name in all Fabric nodes).invokeAsyncServiceRequest
in interface ServiceAccessor
request
- the request to be sent.FabricComponentAccessorException
- if the accessor is closed or
if the accessed service is not available.FabricEventSourceException
- if some error occurs in the Exchange.public SLResponse invokeLanguageRequest(SLStatement statement) throws FabricComponentAccessorException
FabricComponentAccessor
FabricComponentAccessor.invokeLanguageRequest(com.streamscape.sdo.operation.SLStatement, long)
with a timeout
previously set by the FabricComponentAccessor.setRequestTimeout(long)
method or default timeout (30 seconds).invokeLanguageRequest
in interface FabricComponentAccessor
statement
- the DSL statement to be sent.FabricComponentAccessorException
- if the accessor is closed.public SLResponse invokeLanguageRequest(SLStatement statement, long timeout) throws FabricComponentAccessorException
FabricComponentAccessor
invokeLanguageRequest
in interface FabricComponentAccessor
statement
- the DSL statement to be sent.timeout
- the waiting time for a response (in milliseconds).FabricComponentAccessorException
- if the accessor is closed.public SLResponse invokeLanguageRequest(java.lang.String statement) throws FabricComponentAccessorException
FabricComponentAccessor
FabricComponentAccessor.invokeLanguageRequest(String, long)
with a timeout
previously set by the FabricComponentAccessor.setRequestTimeout(long)
method or default timeout (30 seconds).invokeLanguageRequest
in interface FabricComponentAccessor
statement
- the DSL statement to be sent.FabricComponentAccessorException
- if the accessor is closed.public SLResponse invokeLanguageRequest(java.lang.String statement, long timeout) throws FabricComponentAccessorException
FabricComponentAccessor
invokeLanguageRequest
in interface FabricComponentAccessor
statement
- the DSL statement to be sent.timeout
- the waiting time for a response (in milliseconds).FabricComponentAccessorException
- if the accessor is closed.public SLResponse invokeInterruptRequest(java.lang.String command) throws FabricComponentAccessorException
FabricComponentAccessor
invokeInterruptRequest
in interface FabricComponentAccessor
FabricComponentAccessorException
- if the accessor is closed.public SLResponse invokeCompleteRequest(java.lang.String statement) throws FabricComponentAccessorException
FabricComponentAccessor
FabricComponentAccessor.invokeCompleteRequest(String, long)
with a timeout
previously set by the FabricComponentAccessor.setRequestTimeout(long)
method or default timeout (30 seconds).invokeCompleteRequest
in interface FabricComponentAccessor
statement
- the DSL statement to be completed.FabricComponentAccessorException
- if the accessor is closed.public SLResponse invokeCompleteRequest(java.lang.String command, long timeout) throws FabricComponentAccessorException
FabricComponentAccessor
invokeCompleteRequest
in interface FabricComponentAccessor
timeout
- the waiting time for a response (in milliseconds).FabricComponentAccessorException
- if the accessor is closed.public EventHandler lookupEventHandler(java.lang.String handlerName) throws FabricComponentAccessorException
ServiceAccessor
lookupEventHandler
in interface ServiceAccessor
handlerName
- the name of the event handler to be searched.null
if such event handler does not exist in the accessed service.FabricComponentAccessorException
- if the accessed service is not available or
if some other error occurs in the Exchange.public EventHandler lookupEventHandlerByMethod(java.lang.String methodName) throws FabricComponentAccessorException
ServiceAccessor
lookupEventHandlerByMethod
in interface ServiceAccessor
methodName
- the name of the handler's method.null
if such event handler does not exist in the accessed service.FabricComponentAccessorException
- if the accessed service is not available or
if some other error occurs in the Exchange.public boolean isEventHandlerValid(java.lang.String handlerName) throws FabricComponentAccessorException
ServiceAccessor
isEventHandlerValid
in interface ServiceAccessor
handlerName
- the name of the event handler to be checked.true
if the specified event handler is valid, false
otherwise.FabricComponentAccessorException
- if the accessed service is not available or
if the specified event handler does not exist or
if some other error occurs in the Exchange.public java.util.List getEventHandlers() throws FabricComponentAccessorException
ServiceAccessor
getEventHandlers
in interface ServiceAccessor
FabricComponentAccessorException
- if the accessed service is not available or
if some other error occurs in the Exchange.public java.util.List listEventHandlers() throws FabricComponentAccessorException
ServiceAccessor
listEventHandlers
in interface ServiceAccessor
FabricComponentAccessorException
- if the accessed service is not available or
if some other error occurs in the Exchange.public java.util.List listActiveEvents() throws FabricComponentAccessorException
ServiceAccessor
listActiveEvents
in interface ServiceAccessor
FabricComponentAccessorException
- if the accessed service is not available or
if some other error occurs in the Exchange.public java.lang.String getEventHandlerParameterName(java.lang.String handlerName) throws FabricComponentAccessorException
getEventHandlerParameterName
in interface ServiceAccessor
FabricComponentAccessorException
public RPLMethodsCache.RPLMethodInfo getEventHandlerRPLMethodInfo(java.lang.String handlerName) throws FabricComponentAccessorException
getEventHandlerRPLMethodInfo
in interface ServiceAccessor
FabricComponentAccessorException
public java.util.List listSinkEvents()
FabricEventSink
listSinkEvents
in interface FabricEventSink
public boolean hasSinkEvents()
FabricEventSink
hasSinkEvents
in interface FabricEventSink
true
if the component has registered events, false
otherwise.public java.util.List listActionableEvents()
FabricEventSource
listActionableEvents
in interface FabricEventSource
public boolean hasActionableEvents()
FabricEventSource
hasActionableEvents
in interface FabricEventSource
true
if the component has actionable events, false
otherwise.public boolean existsActionableEvent(java.lang.String eventId)
FabricEventSource
existsActionableEvent
in interface FabricEventSource
eventId
- the specified event id.true
if an actionable event with the specified id exists, false
otherwise.public java.util.List listEventTriggers()
FabricEventTriggerSource
listEventTriggers
in interface FabricEventTriggerSource
public EventTriggerData getEventTriggerData(java.lang.String triggerName) throws ServiceConfigurationException
FabricEventTriggerSource
getEventTriggerData
in interface FabricEventTriggerSource
ServiceConfigurationException
public boolean hasEventTriggers()
FabricEventTriggerSource
hasEventTriggers
in interface FabricEventTriggerSource
true
if the configuration has event triggers, false
otherwise.public boolean existsEventTrigger(java.lang.String triggerName)
FabricEventTriggerSource
existsEventTrigger
in interface FabricEventTriggerSource
triggerName
- the specified trigger name.true
if an event trigger with the specified name exists, false
otherwise.public java.lang.String getAccessorName()
FabricComponentAccessor
getAccessorName
in interface FabricComponentAccessor
public java.lang.String getName()
FabricComponentAccessor
getName
in interface FabricComponentAccessor
public EventScope getEventScope()
FabricComponentAccessor
getEventScope
in interface FabricComponentAccessor
public java.lang.String getNodeName()
FabricComponentAccessor
null
the accessor will search the component in all nodes.getNodeName
in interface FabricComponentAccessor
public java.lang.String getComponentType()
FabricComponentAccessor
getComponentType
in interface FabricComponentAccessor
public java.lang.String getComponentName()
FabricComponentAccessor
getComponentName
in interface FabricComponentAccessor
public ComponentModel getComponentModel()
FabricComponentAccessor
getComponentModel
in interface FabricComponentAccessor
public long getRequestTimeout()
FabricComponentAccessor
invokeRequest
methods.
getRequestTimeout
in interface FabricComponentAccessor
public void setRequestTimeout(long timeout)
FabricComponentAccessor
invokeRequest
methods.
timeout <= 0
, the invokeRequest
methods will wait for a response infinitely.setRequestTimeout
in interface FabricComponentAccessor
timeout
- the timeout (in milliseconds) to be set.public boolean isOpened()
FabricComponentAccessor
isOpened
in interface FabricComponentAccessor
true
if the accessor is opened, false
otherwise.public void close()
FabricComponentAccessor
close
in interface FabricComponentAccessor
public boolean isAvailable()
FabricComponentAccessor
isAvailable
in interface FabricComponentAccessor
true
if the accessed component is available, false
otherwise.public AccessorSessionReference getSession()
FabricComponentAccessor
getSession
in interface FabricComponentAccessor
null
if the accessed component is not available.public java.lang.String getActualNodeName()
FabricComponentAccessor
getActualNodeName
in interface FabricComponentAccessor
null
if the accessed component is not available.public boolean autoSwitching()
FabricComponentAccessor
FabricNodeReference.getWeight()
for details) or in a node from the same cluster as the current node.
This parameter is applicable only if the nodeName
is not specified.
autoSwitching
in interface FabricComponentAccessor
true
if the accessor will automatically switch to a more suitable component, false
otherwise.public void setAutoSwitching(boolean autoSwitching) throws FabricComponentAccessorException
FabricComponentAccessor
FabricNodeReference.getWeight()
for details) or in a node from the same cluster as the current node.
This parameter is applicable only if the nodeName
is not specified.
setAutoSwitching
in interface FabricComponentAccessor
autoSwitching
- the value to be set.FabricComponentAccessorException
- if the accessor is closed or
if some other error occurs.public boolean switchComponent() throws FabricComponentAccessorException
FabricComponentAccessor
FabricNodeReference.getWeight()
for details)
or in a node from the same cluster as the current node.
available
state, it just tries to connect to a suitable component.
This method is applicable only if the nodeName
is not specified.
switchComponent
in interface FabricComponentAccessor
true
if the switching has been successfully completed, false
otherwise.FabricComponentAccessorException
- if the accessor is closed or
if some other error occurs.public boolean resync() throws FabricComponentAccessorException
FabricComponentAccessor
available
state, it tries to connect to a suitable component.
available
state and the nodeName
is not specified,
it tries to switch to another suitable component located in the node with a higher weight
or in a node from the same cluster as the current node (see FabricComponentAccessor.switchComponent()
).resync
in interface FabricComponentAccessor
true
if the resynchronization has been successfully completed, false
otherwise.FabricComponentAccessorException
- if the accessor is closed or
if some other error occurs.public void setStateListener(FabricComponentAccessorStateListener listener)
FabricComponentAccessor
FabricComponentAccessor.setStateListener(FabricComponentAccessorStateListener, long)
with a default repeat interval (5 minutes).setStateListener
in interface FabricComponentAccessor
listener
- the listener to be set.public void setStateListener(FabricComponentAccessorStateListener listener, long repeatInterval)
FabricComponentAccessor
repeatInterval
is positive, the accessor will periodically try to re-establish a session
in the case if the accessed component is not available (the listener will be periodically invoked after such attempt).
listener
is null
, the previously set listener will be disabled and
re-establishment of a session will be stopped.
repeatInterval
is not positive, re-establishment of a session will be stopped
(if it is active currently).setStateListener
in interface FabricComponentAccessor
listener
- the listener to be set.repeatInterval
- the time interval between consecutive attempts to re-establish a session.public void addEventTrigger(java.lang.String triggerSyntax) throws ServiceConfigurationException
EventTriggerManagerDelegate
addEventTrigger
in interface EventTriggerManagerDelegate
triggerSyntax
- trigger create syntaxServiceConfigurationException
- if some error occurs.public void alterEventTrigger(java.lang.String triggerSyntax) throws ServiceConfigurationException
EventTriggerManagerDelegate
alterEventTrigger
in interface EventTriggerManagerDelegate
triggerSyntax
- trigger alter syntaxServiceConfigurationException
public void enableEventTrigger(java.lang.String triggerName) throws ServiceConfigurationException
EventTriggerManagerDelegate
enableEventTrigger
in interface EventTriggerManagerDelegate
triggerName
- StringServiceConfigurationException
public void disableEventTrigger(java.lang.String triggerName) throws ServiceConfigurationException
EventTriggerManagerDelegate
disableEventTrigger
in interface EventTriggerManagerDelegate
triggerName
- StringServiceConfigurationException
public void removeEventTrigger(java.lang.String triggerName) throws ServiceConfigurationException
EventTriggerManagerDelegate
removeEventTrigger
in interface EventTriggerManagerDelegate
triggerName
- StringServiceConfigurationException
- If a configuration error occurs.public EventTriggerDefinition getEventTriggerDefinition(java.lang.String triggerName) throws ServiceConfigurationException
EventTriggerManagerDelegate
EventTriggerCompiledDefinition
will be returned.getEventTriggerDefinition
in interface EventTriggerManagerDelegate
triggerName
- StringServiceConfigurationException
public java.util.List getEventTriggerDefinitions()
EventTriggerManagerDelegate
EventTriggerCompiledDefinition
will be returned.getEventTriggerDefinitions
in interface EventTriggerManagerDelegate
public void removeAllEventTriggers() throws ServiceConfigurationException, IllegalTriggerStateException
EventTriggerManagerDelegate
removeAllEventTriggers
in interface EventTriggerManagerDelegate
ServiceConfigurationException
IllegalTriggerStateException
- If some trigger is in a state wherein it may not be removed.public void compileEventTrigger(java.lang.String triggerName) throws EventTriggerCompileException, IllegalTriggerStateException
EventTriggerManagerDelegate
compileEventTrigger
in interface EventTriggerManagerDelegate
triggerName
- StringEventTriggerCompileException
- If some type of exception occurred during compile.IllegalTriggerStateException
- If the trigger is in an enabled state.public java.lang.String getLastError(java.lang.String triggerName)
EventTriggerManagerDelegate
getLastError
in interface EventTriggerManagerDelegate
public EventTriggerState getTriggerState(java.lang.String triggerName)
EventTriggerManagerDelegate
getTriggerState
in interface EventTriggerManagerDelegate
public TriggerActionTime getTriggerActionTime(java.lang.String triggerName)
EventTriggerManagerDelegate
getTriggerActionTime
in interface EventTriggerManagerDelegate
public java.lang.String getEventTriggerSyntax(java.lang.String triggerName) throws ServiceConfigurationException
EventTriggerManagerDelegate
getEventTriggerSyntax
in interface EventTriggerManagerDelegate
ServiceConfigurationException
public boolean isEventTriggerAutoEnable(java.lang.String triggerName) throws IllegalTriggerStateException
EventTriggerManagerDelegate
isEventTriggerAutoEnable
in interface EventTriggerManagerDelegate
IllegalTriggerStateException
- if trigger doesn't existpublic void setEventTriggerAutoEnable(java.lang.String triggerName, boolean autoEnable) throws IllegalTriggerStateException, ServiceConfigurationException
EventTriggerManagerDelegate
setEventTriggerAutoEnable
in interface EventTriggerManagerDelegate
IllegalTriggerStateException
- if trigger doesn't existServiceConfigurationException
- if save sco failedpublic com.streamscape.slex.MFSession getMFSession()
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.