public abstract class NodeMapDriver extends AbstractDriver<java.lang.Integer>
builderFactory, diagnosticsContext, executor, log, nodeManager
Modifier | Constructor and Description |
---|---|
protected |
NodeMapDriver(DriverContext driverContext) |
Modifier and Type | Method and Description |
---|---|
void |
buildNode(java.lang.String address,
NodeId nodeId)
For the given address, build an appropriate
Node and at it to the UA address space. |
protected void |
connect()
A chance for implementations to do anything that is needed before moving into
DriverState.Connected . |
protected Request<java.lang.Integer> |
createBrowseRequest(BrowseOperation browseOp)
Create a browse
Request for the given BrowseOperation . |
protected Request<java.lang.Integer> |
createReadRequest(java.util.List<? extends ReadItem> items)
Create a read
Request with the given items. |
protected Request<java.lang.Integer> |
createWriteRequest(java.util.List<? extends WriteItem> items)
Create a write
Request with the given items. |
protected void |
disconnect()
A chance for implementations to do anything that is needed before moving into
DriverState.Disconnected . |
java.util.Map<java.lang.String,BrowseNode> |
getNodeMap() |
java.util.concurrent.locks.ReadWriteLock |
getNodeMapLock() |
protected java.lang.Integer |
getRequestKey(java.lang.Integer message)
Gets the request key for a given message.
|
FolderNode |
getRootNode() |
java.util.concurrent.ScheduledExecutorService |
getScheduledExecutor() |
Sequence |
getTransactionSequence() |
protected abstract void |
initialize()
Gives implementations a chance to initialize.
|
protected boolean |
isBrowsingSupported() |
protected boolean |
isOfflineBrowsingSupported() |
void |
messageDone(java.lang.Integer message) |
protected java.util.List<java.util.List<? extends ReadItem>> |
optimizeRead(java.util.List<? extends ReadItem> items)
Optimize the given list of items into sub-lists, where each sub-list is expected to fit into a single
Request when AbstractDriver.createReadRequest(List) is called. |
void |
shutdown()
Called when a driver should cease all activities and shutdown any open connections.
|
addDriverTag, browse, createSubscribeRequest, currentGuid, findTag, getConcurrentRequests, getDiagnostics, getDriverContext, getDriverMetrics, getDriverState, getDriverStatus, getDriverTagAddressPrefix, getLogger, getName, getRequestDiagnostics, messageArrived, nextGuid, notifyConnectFailed, notifyConnectionLost, notifyConnectSucceeded, notifyDisconnectDone, optimizeSubscribe, optimizeWrite, postRequest, readItems, removeDriverTag, reschedule, setConcurrentRequests, setState, writeItems
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDriverStatusJSLibName, getDriverStatusJSUrl
protected NodeMapDriver(DriverContext driverContext)
protected abstract void initialize()
public Sequence getTransactionSequence()
public void messageDone(java.lang.Integer message)
public java.util.concurrent.locks.ReadWriteLock getNodeMapLock()
public java.util.Map<java.lang.String,BrowseNode> getNodeMap()
public FolderNode getRootNode()
protected void connect()
AbstractDriver
DriverState.Connected
. When
done, AbstractDriver.notifyConnectSucceeded()
or AbstractDriver.notifyConnectFailed(Exception)
must be called.connect
in class AbstractDriver<java.lang.Integer>
protected void disconnect()
AbstractDriver
DriverState.Disconnected
.
When done, AbstractDriver.notifyDisconnectDone()
must be called.disconnect
in class AbstractDriver<java.lang.Integer>
protected Request<java.lang.Integer> createBrowseRequest(BrowseOperation browseOp)
AbstractDriver
Create a browse Request
for the given BrowseOperation
.
If the implementation does not actually need to post a Request
to complete the browse then
BrowseOperation.browseDone(StatusCode, List, Guid)
can be called whenever browsing is complete and a
null value can be returned.
createBrowseRequest
in class AbstractDriver<java.lang.Integer>
browseOp
- The BrowseOperation
for this Request
.Request
for the given BrowseOperation
, or null if
no Request
is necessary to complete the browse.protected Request<java.lang.Integer> createReadRequest(java.util.List<? extends ReadItem> items)
AbstractDriver
Request
with the given items. These items are guaranteed to be a sub-list previously
generated by a call to AbstractDriver.optimizeRead(List)
and should therefore fit into single Request
.createReadRequest
in class AbstractDriver<java.lang.Integer>
items
- The items that make up this Request
.Request
for the given items.protected Request<java.lang.Integer> createWriteRequest(java.util.List<? extends WriteItem> items)
AbstractDriver
Request
with the given items. These items are guaranteed to be a sub-list previously
generated by a call to AbstractDriver.optimizeWrite(List)
and should therefore fit into a single Request
.createWriteRequest
in class AbstractDriver<java.lang.Integer>
items
- The items that make up this write Request
.Request
for the given items.protected java.lang.Integer getRequestKey(java.lang.Integer message)
getRequestKey
in class AbstractDriver<java.lang.Integer>
message
- The message to extract a key from.protected boolean isBrowsingSupported()
isBrowsingSupported
in class AbstractDriver<java.lang.Integer>
protected boolean isOfflineBrowsingSupported()
isOfflineBrowsingSupported
in class AbstractDriver<java.lang.Integer>
protected java.util.List<java.util.List<? extends ReadItem>> optimizeRead(java.util.List<? extends ReadItem> items)
AbstractDriver
Request
when AbstractDriver.createReadRequest(List)
is called.
Things to take into consideration when optimizing might be:
optimizeRead
in class AbstractDriver<java.lang.Integer>
items
- The items to optimize.Request
.public void buildNode(java.lang.String address, NodeId nodeId) throws AddressNotFoundException
Driver
Node
and at it to the UA address space. See DriverContext.getNodeManager()
and DriverContext.getNodeBuilderFactory()
for more information.
If for any reason the node cannot be built AddressNotFoundException
should be thrown.address
- Address of the node that is to be built.nodeId
- The NodeId
to use when building the Node
for this address.AddressNotFoundException
public java.util.concurrent.ScheduledExecutorService getScheduledExecutor()
public void shutdown()
Driver
shutdown
in interface Driver
shutdown
in class AbstractDriver<java.lang.Integer>