public interface FabricComponentAccessor extends FabricEventSink, FabricEventSource, EventTriggerManagerDelegate
Title: Service Event Fabric Core
Description: Defines an accessor to the Fabric Component (Service, Dataspace or Runtime).
Copyright: Copyright (c) 2010
Company: StreamScape Technologies
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
EventScope |
getEventScope()
Returns an event scope of the accessor.
|
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.
|
SLResponse |
invokeCompleteRequest(java.lang.String statement)
Performs the
invokeCompleteRequest(String, long) with a timeout
previously set by the 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
invokeLanguageRequest(com.streamscape.sdo.operation.SLStatement, long) with a timeout
previously set by the 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
invokeLanguageRequest(String, long) with a timeout
previously set by the 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.
|
boolean |
isAvailable()
Checks if the accessed component is available.
|
boolean |
isOpened()
Checks if the accessor is opened.
|
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 |
setRequestTimeout(long timeout)
Sets a time (in milliseconds) of waiting for a response in
invokeRequest methods. |
void |
setStateListener(FabricComponentAccessorStateListener listener)
Performs the
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. |
hasSinkEvents, listSinkEvents
existsActionableEvent, hasActionableEvents, listActionableEvents
addEventTrigger, alterEventTrigger, compileEventTrigger, disableEventTrigger, enableEventTrigger, getEventTriggerDefinition, getEventTriggerDefinitions, getEventTriggerSyntax, getLastError, getTriggerActionTime, getTriggerState, isEventTriggerAutoEnable, removeAllEventTriggers, removeEventTrigger, setEventTriggerAutoEnable
existsEventTrigger, getEventTriggerData, hasEventTriggers, listEventTriggers
java.lang.String getAccessorName()
java.lang.String getName()
EventScope getEventScope()
java.lang.String getNodeName()
null
the accessor will search the component in all nodes.java.lang.String getComponentType()
java.lang.String getComponentName()
ComponentModel getComponentModel()
long getRequestTimeout()
invokeRequest
methods.
void setRequestTimeout(long timeout)
invokeRequest
methods.
timeout <= 0
, the invokeRequest
methods will wait for a response infinitely.timeout
- the timeout (in milliseconds) to be set.boolean autoSwitching()
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.
true
if the accessor will automatically switch to a more suitable component, false
otherwise.boolean isOpened()
true
if the accessor is opened, false
otherwise.void close()
boolean isAvailable()
true
if the accessed component is available, false
otherwise.java.lang.String getActualNodeName()
null
if the accessed component is not available.AccessorSessionReference getSession()
null
if the accessed component is not available.SLResponse invokeLanguageRequest(SLStatement statement) throws FabricComponentAccessorException
invokeLanguageRequest(com.streamscape.sdo.operation.SLStatement, long)
with a timeout
previously set by the setRequestTimeout(long)
method or default timeout (30 seconds).statement
- the DSL statement to be sent.FabricComponentAccessorException
- if the accessor is closed.SLResponse invokeLanguageRequest(SLStatement statement, long timeout) throws FabricComponentAccessorException
statement
- the DSL statement to be sent.timeout
- the waiting time for a response (in milliseconds).FabricComponentAccessorException
- if the accessor is closed.SLResponse invokeLanguageRequest(java.lang.String statement) throws FabricComponentAccessorException
invokeLanguageRequest(String, long)
with a timeout
previously set by the setRequestTimeout(long)
method or default timeout (30 seconds).statement
- the DSL statement to be sent.FabricComponentAccessorException
- if the accessor is closed.SLResponse invokeLanguageRequest(java.lang.String statement, long timeout) throws FabricComponentAccessorException
statement
- the DSL statement to be sent.timeout
- the waiting time for a response (in milliseconds).FabricComponentAccessorException
- if the accessor is closed.SLResponse invokeInterruptRequest(java.lang.String command) throws FabricComponentAccessorException
statement
- the DSL statement to be completer.timeout
- the waiting time for a response (in milliseconds).FabricComponentAccessorException
- if the accessor is closed.SLResponse invokeCompleteRequest(java.lang.String statement) throws FabricComponentAccessorException
invokeCompleteRequest(String, long)
with a timeout
previously set by the setRequestTimeout(long)
method or default timeout (30 seconds).statement
- the DSL statement to be completed.FabricComponentAccessorException
- if the accessor is closed.SLResponse invokeCompleteRequest(java.lang.String command, long timeout) throws FabricComponentAccessorException
statement
- the DSL statement to be completer.timeout
- the waiting time for a response (in milliseconds).FabricComponentAccessorException
- if the accessor is closed.void setAutoSwitching(boolean autoSwitching) throws FabricComponentAccessorException
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
- the value to be set.FabricComponentAccessorException
- if the accessor is closed or
if some other error occurs.boolean switchComponent() throws FabricComponentAccessorException
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.
true
if the switching has been successfully completed, false
otherwise.FabricComponentAccessorException
- if the accessor is closed or
if some other error occurs.boolean resync() throws FabricComponentAccessorException
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 switchComponent()
).true
if the resynchronization has been successfully completed, false
otherwise.FabricComponentAccessorException
- if the accessor is closed or
if some other error occurs.void setStateListener(FabricComponentAccessorStateListener listener)
setStateListener(FabricComponentAccessorStateListener, long)
with a default repeat interval (5 minutes).listener
- the listener to be set.void setStateListener(FabricComponentAccessorStateListener listener, long repeatInterval)
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).listener
- the listener to be set.repeatInterval
- the time interval between consecutive attempts to re-establish a session.Copyright © 2015-2024 StreamScape Technologies. All rights reserved.