TLink.java. More...
Public Member Functions | |
void | setNotificationTolerance (float absoluteValue, float percentValue) |
Sets the tolerance level for asynchronous event notification. More... | |
int | getLinkStatus () |
Returns the current status for this link. More... | |
String | getContext () |
Returns the context of this link. More... | |
String | getDeviceServer () |
Returns the device server addressed in this link. More... | |
String | getDeviceName () |
Returns the device (module) name addressed in this link. More... | |
String | getProperty () |
Returns the device property addressed in this link. More... | |
String | getFullDeviceName () |
Returns the fully qualified device name addressed in this link. More... | |
String | getFullDeviceNameAndProperty () |
Returns the fully qualified device name and property addressed in this link. More... | |
TDataType | getOutputDataObject () |
Returns the output data object as a TDataType. More... | |
TDataType | getInputDataObject () |
Returns the output data input as a TDataType. More... | |
long | getLastTimeStamp () |
The last link timestamp. More... | |
double | getLastDataTimeStamp () |
The last link timestamp as a TINE double timestamp value. More... | |
String | getLastError () |
The last link status in plain text. More... | |
String | getError (int code) |
The specified error code in plain text. More... | |
int | setErrorValue (double errValue) |
Specifies an error value to fill in associated data buffers in case of link error. More... | |
int | setErrorValue (String errString) |
Specifies an error string to fill in associated data buffers in case of link error. More... | |
TLink (String devname, String devproperty, TDataType dout, TDataType din, int devaccess) | |
Defines a tine Data link. More... | |
TLink (String fullDeviceNameAndProperty, TDataType dout, TDataType din, short devaccess) | |
Defines a tine Data link. More... | |
TLink (String deviceName, String deviceProperty) | |
Defines a read-only tine Data link with default behavior. More... | |
TLink (String fullDeviceNameAndProperty) | |
Defines a read-only tine Data link with default behavior. More... | |
TLink (String globalKeyword, TDataType dout) | |
Defines a tine GLobal Data link. More... | |
int | attach (int mode, TCallback f) |
Attaches the data sets to the created link at the default polling rate (1000 msec) More... | |
int | Twait () |
Stop thread execution until this link has been signalled. | |
int | execute () |
Executes a synchronous link using the data sets supplied at link creation. More... | |
int | executeAndClose () |
Executes a synchronous link using the data sets supplied at link creation and Closes the link upon completion. More... | |
int | execute (int timeout, short appendMode) |
Executes a synchronous link using the data sets supplied at link creation. More... | |
int | execute (int timeout, boolean retryOnError) |
Executes a synchronous link using the data sets supplied at link creation. More... | |
int | executeAndClose (int timeout, short appendMode) |
Executes a synchronous link using the data sets supplied at link creation and Closes the link upon completion. More... | |
int | executeAndListen () |
Executes synchronously, returning the link results. More... | |
int | executeAndListen (int interval) |
Executes synchronously, returning the link results. More... | |
int | executeAndListen (int interval, short mode) |
Executes synchronously, returning the link results. More... | |
int | execute (int timeout, short appendMode, boolean retryOnError) |
Executes a synchronous link using the data sets supplied at link creation. More... | |
int | execute (int timeout) |
Executes a synchronous link using the data sets supplied at link creation. More... | |
int | executeAndClose (int timeout) |
Executes a synchronous link using the data sets supplied at link creation and Closes the link upon completion. More... | |
int | cancel () |
Terminates an active link mdavid: changed and marked as 'deprecated'. More... | |
int | close () |
Terminates an active link. More... | |
int | attach (int mode, TCallback f, int pollrate) |
Attaches the data sets to the created link at the given polling rate. More... | |
synchronized int | attach (int mode, TCallback f, int pollInterval, int notificationId) |
Attaches the data sets to the created link at the given polling rate and signals the callback routine using the give notification parameter. More... | |
int | attach (int mode, TLinkCallback f, int pollrate) |
Attaches the data sets to the created link at the given polling rate and signals the callback routine using a reference to the TLink instance. More... | |
int | attach (int mode, TLinkCallback f, int pollingInterval, Object reference) |
Attaches the data sets to the created link at the given polling rate and signals the callback routine using a reference to the TLink instance. More... | |
int | receive (TCallback f) |
Attaches the data sets to the global link and signals the callback routine using the assigned link id. More... | |
int | receive (TCallback f, int notificationId) |
Attaches the data sets to the global link and signals the callback routine using a reference to the given notifcation ID in the callback. More... | |
int | receive (TLinkCallback f) |
Attaches the data sets to the global link and signals the callback routine using a reference to the referenced TLink object. More... | |
void | waitForLinkCompletion () |
Stops thread execution until this link has completed. More... | |
String | getArrayDelimiter () |
Gets the array delimiter for use in the toString() method of associated TDataType objects. More... | |
void | setArrayDelimiter (String delimiter) |
Sets the array delimiter for use in the toString() method of associated TDataType objects. More... | |
Static Public Member Functions | |
static String[] | splitDeviceAndPropertyFromName (String fullDeviceNameAndProperty) |
returns string array of length 2 with first string = full device name and second string = property More... | |
static String[] | splitContextAndServerAndDeviceAndPropertyFromName (String fullDeviceNameAndProperty) |
returns string array of length 4 with string[0] = context, string[1] = server, string[2] = device, and string[3] = property More... | |
TLink.java.
User interface calls to access tine data links.
The methods presented here deal with linking local application data with remote data sources. Primarily you will need to create a TLink object, passing the necessary identifying parameters of the remote server to which the link is to be established. When the TLink object is instantiated, you will then need to retrieve the data using one of the retrieval methods, e.g. execute() for synchronous acquisition, or attach() for
asynchronous acquisition, or receive() for the acquisition of network globals.
de.desy.tine.client.TLink.TLink | ( | String | devname, |
String | devproperty, | ||
TDataType | dout, | ||
TDataType | din, | ||
int | devaccess | ||
) |
Defines a tine Data link.
This defines a tine Data Link, verifies that the requested deviceName exists and returns a non-null link object if successful. This does not establish the link! You must use either the execute method or the attach method to establish the link.
devname | is the fully specified device name as in /<context>/<server>/<device> or <server>/<device> |
devproperty | is the desired property |
dout | is a reference to the output data object (which will receive the data from the server) |
din | is a reference to the input data object (which will send data to the server) |
devaccess | is the requested control access mode (TMode.CA_READ, TMode.CA_WRITE etc.) |
UnresolvedAddressException | if fullDeviceNameAndProperty does not point to a valid address (i.e. if the address pointed to is unable to be resolved by the system) |
InvalidDataReferenceException | if the output data object used (dout above) is already used as the output data object in another TLink. For instance, TLink("/TEST/Server1/Device1","Property1",dout,null,TAccess.CA_READ) already exists. An attempt to create TLink("/TEST/Server1/Device1","Property2",dout,null,TAccess.CA_READ) will throw this exception as 'dout' is the same object already in use in the |
Example:
de.desy.tine.client.TLink.TLink | ( | String | fullDeviceNameAndProperty, |
TDataType | dout, | ||
TDataType | din, | ||
short | devaccess | ||
) |
Defines a tine Data link.
This defines a tine Data Link, verifies that the requested deviceName exists and returns a non-null link object if successful. This does not establish the link! You must use either the execute method or the attach method to establish the link.
fullDeviceNameAndProperty | is the fully specified, property-appended device name as in /<context>/<server>/<device>/<property> or <server>/<device>/<property> or /<context>/<server>/<device>[<property>] |
dout | is a reference to the output data object (which will receive the data from the server) |
din | is a reference to the input data object (which will send data to the server) |
devaccess | is the requested control access mode (TMode.CA_READ, TMode.CA_WRITE etc.) |
UnresolvedAddressException | if fullDeviceNameAndProperty does not point to a valid address (i.e. if the address pointed to is unable to be resolved by the system) |
InvalidDataReferenceException | if the output data object used (dout above) is already used as the output data object in another TLink. For instance, TLink("/TEST/Server1/Device1","Property1",dout,null,TAccess.CA_READ) already exists. An attempt to create TLink("/TEST/Server1/Device1","Property2",dout,null,TAccess.CA_READ) will throw this exception as 'dout' is the same object already in use in the initial link. |
Example:
de.desy.tine.client.TLink.TLink | ( | String | deviceName, |
String | deviceProperty | ||
) |
Defines a read-only tine Data link with default behavior.
This defines a tine Data Link, verifies that the requested deviceName exists and returns a non-null link object if successful. This does not establish the link! You must use either the execute method or the attach method to establish the link.
devname | is the fully specified device name as in /<context>/<server>/<device> or <server>/<device> |
devproperty | is the desired property |
UnresolvedAddressException | if fullDeviceNameAndProperty does not point to a valid address (i.e. if the address pointed to is unable to be resolved by the system) |
InvalidDataReferenceException | if the output data object used (dout above) is already used as the output data object in another TLink. For instance, TLink("/TEST/Server1/Device1","Property1",dout,null,TAccess.CA_READ) already exists. An attempt to create TLink("/TEST/Server1/Device1","Property2",dout,null,TAccess.CA_READ) will throw this exception as 'dout' is the same object already in use in the |
Example:
de.desy.tine.client.TLink.TLink | ( | String | fullDeviceNameAndProperty | ) |
Defines a read-only tine Data link with default behavior.
This defines a tine Data Link, verifies that the requested deviceName exists and returns a non-null link object if successful. This does not establish the link! You must use either the execute method or the attach method to establish the link.
fullDeviceNameAndProperty | is the fully specified, property-appended device name as in /<context>/<server>/<device>/<property> or <server>/<device>/<property> |
UnresolvedAddressException | if fullDeviceNameAndProperty does not point to a valid address (i.e. if the address pointed to is unable to be resolved by the system) |
InvalidDataReferenceException | if the output data object used (dout above) is already used as the output data object in another TLink. For instance, TLink("/TEST/Server1/Device1","Property1",dout,null,TAccess.CA_READ) already exists. An attempt to create TLink("/TEST/Server1/Device1","Property2",dout,null,TAccess.CA_READ) will throw this exception as 'dout' is the same object already in use in the |
Example:
References de.desy.tine.client.TLink.splitDeviceAndPropertyFromName().
de.desy.tine.client.TLink.TLink | ( | String | globalKeyword, |
TDataType | dout | ||
) |
Defines a tine GLobal Data link.
This defines a tine Data Link and assumes that the requested parameter is a network global, available on the tine multicast group. This method does not establish the link! You must use either the execute method or the attach method to establish the link.
globalKeyword | is the desired network global parameter |
dout | is a reference to the output data object (which will receive the network global data). |
Example:
int de.desy.tine.client.TLink.attach | ( | int | mode, |
TCallback | f | ||
) |
Attaches the data sets to the created link at the default polling rate (1000 msec)
Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter.
mode | is the tine control mode parameter, that is one of TMode.CM_POLL, TMode.CM_REFRESH, TMode.SINGLE, etc. in possible combination with TMode.CM_NETWORK or TMode.CM_CONNECT, etc. |
f | is the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TCallback() class interface. |
Example:
Referenced by de.desy.tine.client.TLink.attach(), de.desy.tine.client.TLink.receive(), and de.desy.tine.dataUtils.TDataTime.systemStartGlobalSynchronization().
synchronized int de.desy.tine.client.TLink.attach | ( | int | mode, |
TCallback | f, | ||
int | pollInterval, | ||
int | notificationId | ||
) |
Attaches the data sets to the created link at the given polling rate and signals the callback routine using the give notification parameter.
Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter.
mode | is the tine control mode parameter, that is one of TMode.CM_POLL, TMode.CM_REFRESH, TMode.SINGLE, etc. in possible combination with TMode.CM_NETWORK or TMode.CM_CONNECT, etc. |
f | is the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TCallback() class interface. |
pollInterval | is the desired polling interval (at the server) in milliseconds. |
notificationId | is the desired identifier to be passed to the supplied callback routine when it is fired. |
Example:
int de.desy.tine.client.TLink.attach | ( | int | mode, |
TCallback | f, | ||
int | pollrate | ||
) |
Attaches the data sets to the created link at the given polling rate.
Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter.
mode | is the tine control mode parameter, that is one of TMode.CM_POLL, TMode.CM_REFRESH, TMode.SINGLE, etc. in possible combination with TMode.CM_NETWORK or TMode.CM_CONNECT, etc. |
f | is the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TCallback() class interface. |
pollrate | is the desired polling rate (at the server) in milliseconds. |
Example:
References de.desy.tine.client.TLink.attach().
int de.desy.tine.client.TLink.attach | ( | int | mode, |
TLinkCallback | f, | ||
int | pollingInterval, | ||
Object | reference | ||
) |
Attaches the data sets to the created link at the given polling rate and signals the callback routine using a reference to the TLink instance.
Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter. This is the preferred AttachLink method to use. The Callback instantiates a TLinkCallback() interface which provides a TLink object as parameter.
mode | is the tine control mode parameter, that is one of TMode.CM_POLL, TMode.CM_REFRESH, TMode.SINGLE, etc. in possible combination with TMode.CM_NETWORK or TMode.CM_CONNECT, etc. |
f | is the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TLinkCallback() class interface. |
pollingInterval | is the desired polling rate (at the server) in milliseconds. |
reference | is an optional reference to any object of the caller's choosing. As the callback returns a reference to the original link, this extra reference can be used to quickly find a table entry position for example. |
int de.desy.tine.client.TLink.attach | ( | int | mode, |
TLinkCallback | f, | ||
int | pollrate | ||
) |
Attaches the data sets to the created link at the given polling rate and signals the callback routine using a reference to the TLink instance.
Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter. This is the preferred AttachLink method to use. The Callback instantiates a TLinkCallback() interface which provides a TLink object as parameter.
mode | is the tine control mode parameter, that is one of TMode.CM_POLL, TMode.CM_REFRESH, TMode.SINGLE, etc. in possible combination with TMode.CM_NETWORK or TMode.CM_CONNECT, etc. |
f | is the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TLinkCallback() class interface. |
pollrate | is the desired polling rate (at the server) in milliseconds. |
Example:
References de.desy.tine.client.TLink.attach().
int de.desy.tine.client.TLink.cancel | ( | ) |
Terminates an active link mdavid: changed and marked as 'deprecated'.
References de.desy.tine.client.TLink.close().
Referenced by de.desy.tine.eventUtils.TEventArchive.getArchiveData().
int de.desy.tine.client.TLink.close | ( | ) |
Terminates an active link.
Synonymous with cancel(). mdavid: changed
References de.desy.tine.client.TLinkFactory.removeTLink().
Referenced by de.desy.tine.queryUtils.TQuery.AcquireAndRegisterStructInfo(), de.desy.tine.addrUtils.ENSTools.addDeviceServerToGroup(), de.desy.tine.client.TLink.cancel(), de.desy.tine.alarmUtils.TAlarmSystem.enableAlarms(), de.desy.tine.client.TLink.executeAndClose(), de.desy.tine.addrUtils.ENSTools.flushNonRespondingServers(), de.desy.tine.queryUtils.TQuery.getAccessLockInformation(), de.desy.tine.alarmUtils.TAlarmSystem.getAlarmDefinitionsFromServer(), de.desy.tine.alarmUtils.TAlarmSystem.getAlarmSystemsMap(), de.desy.tine.histUtils.THistory.getArchivedProperties(), de.desy.tine.alarmUtils.TAlarmSystem.getDisabledAlarms(), de.desy.tine.addrUtils.ENSTools.getGroupsFromGENS(), de.desy.tine.queryUtils.TQuery.getMetaProperties(), de.desy.tine.queryUtils.TQuery.getPropertiesWithPattern(), de.desy.tine.queryUtils.TQuery.getStockProperties(), de.desy.tine.addrUtils.ENSTools.removeDeviceServerFromENS(), de.desy.tine.addrUtils.ENSTools.removeDeviceServerFromGroup(), de.desy.tine.addrUtils.ENSTools.setAllowedDownTime(), and de.desy.tine.client.ez.TineClient.unsubscribeEvent().
int de.desy.tine.client.TLink.execute | ( | ) |
Executes a synchronous link using the data sets supplied at
link creation.
Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for 1000 msec or until the call completes.
Example:
Referenced by de.desy.tine.queryUtils.TQuery.AcquireAndRegisterStructInfo(), de.desy.tine.addrUtils.ENSTools.addDeviceServerToGroup(), de.desy.tine.alarmUtils.TAlarmSystem.enableAlarms(), de.desy.tine.client.TLink.execute(), de.desy.tine.client.TLink.executeAndClose(), de.desy.tine.client.TLink.executeAndListen(), de.desy.tine.addrUtils.ENSTools.flushNonRespondingServers(), de.desy.tine.queryUtils.TQuery.getAccessLockInformation(), de.desy.tine.alarmUtils.TAlarmSystem.getAlarmDefinitionsFromServer(), de.desy.tine.alarmUtils.TAlarmSystem.getAlarmSystemsMap(), de.desy.tine.eventUtils.TEventArchive.getArchiveData(), de.desy.tine.histUtils.THistory.getArchivedProperties(), de.desy.tine.alarmUtils.TAlarmSystem.getDisabledAlarms(), de.desy.tine.addrUtils.ENSTools.getGroupsFromGENS(), de.desy.tine.queryUtils.TQuery.getMetaProperties(), de.desy.tine.queryUtils.TQuery.getPropertiesWithPattern(), de.desy.tine.queryUtils.TQuery.getStockProperties(), de.desy.tine.addrUtils.ENSTools.removeDeviceServerFromENS(), de.desy.tine.addrUtils.ENSTools.removeDeviceServerFromGroup(), and de.desy.tine.addrUtils.ENSTools.setAllowedDownTime().
int de.desy.tine.client.TLink.execute | ( | int | timeout | ) |
Executes a synchronous link using the data sets supplied at
link creation.
Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for the duration of the timeout specified or until the call completes.
timeout | The amount of time in milliseconds to block execution until the call completes. |
Example:
References de.desy.tine.client.TLink.execute().
int de.desy.tine.client.TLink.execute | ( | int | timeout, |
boolean | retryOnError | ||
) |
Executes a synchronous link using the data sets supplied at
link creation.
Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for the duration of the timeout specified or until the call completes.
timeout | The amount of time in milliseconds to block execution until the call completes. |
retryOnError | if 'true' will instruct the tine engine to issue an automatic retry following a connection timeout. |
Example:
References de.desy.tine.client.TLink.execute().
int de.desy.tine.client.TLink.execute | ( | int | timeout, |
short | appendMode | ||
) |
Executes a synchronous link using the data sets supplied at
link creation.
Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for the duration of the timeout specified or until the call completes.
timeout | The amount of time in milliseconds to block execution until the call completes. |
appendMode | will be appended to the tine Control Mode, which is TMode.CM_SINGLE. (e.g. TMode.CM_CONNECT). |
Example:
References de.desy.tine.client.TLink.execute().
int de.desy.tine.client.TLink.execute | ( | int | timeout, |
short | appendMode, | ||
boolean | retryOnError | ||
) |
Executes a synchronous link using the data sets supplied at
link creation.
Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for the duration of the timeout specified or until the call completes.
timeout | The amount of time in milliseconds to block execution until the call completes. |
appendMode | will be appended to the tine Control Mode, which is TMode.CM_SINGLE. (e.g. TMode.CM_CONNECT). |
retryOnError | if 'true' will instruct the tine engine to issue an automatic retry following a connection timeout. |
Example:
References de.desy.tine.definitions.TMode.canClose(), de.desy.tine.client.TLink.executeAndListen(), de.desy.tine.definitions.TMode.getBaseMode(), de.desy.tine.client.TLinkFactory.getBlackListedLinkStatus(), de.desy.tine.dataUtils.TDataType.getData(), de.desy.tine.definitions.TErrorList.getErrorString(), de.desy.tine.client.TLink.getFullDeviceName(), de.desy.tine.client.TLink.getFullDeviceNameAndProperty(), de.desy.tine.client.TLink.getLinkStatus(), de.desy.tine.client.TLink.getOutputDataObject(), de.desy.tine.client.TLink.getProperty(), de.desy.tine.definitions.TErrorList.hasData(), de.desy.tine.definitions.TMode.isActive(), de.desy.tine.definitions.TMode.isConnected(), de.desy.tine.queryUtils.TQuery.isStockProperty(), de.desy.tine.definitions.TAccess.isWrite(), de.desy.tine.dataUtils.TDataType.putData(), de.desy.tine.client.TLink.setErrorValue(), and de.desy.tine.definitions.TErrorList.toString().
int de.desy.tine.client.TLink.executeAndClose | ( | ) |
Executes a synchronous link using the data sets supplied at
link creation and Closes the link upon completion.
Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for the duration of the timeout specified or until the call completes. When the link has completed (successfully or not) the TLink will be automatically closed and hence removed from the link tables, obviating the need for an additional call to closeLink().
Referenced by de.desy.tine.alarmUtils.TAlarmSystem.disableAlarms(), de.desy.tine.alarmUtils.TAlarmSystem.enableAlarms(), de.desy.tine.client.TLink.executeAndClose(), de.desy.tine.alarmUtils.TAlarmSystem.getAlarmDefinitions(), de.desy.tine.addrUtils.ENSTools.getAllowedDeviceSubsystems(), de.desy.tine.addrUtils.ENSTools.getAllowedDownTime(), de.desy.tine.histUtils.THistory.getAnnotation(), de.desy.tine.histUtils.THistory.getAnnotationTimes(), de.desy.tine.histUtils.THistory.getArchivedPropertyList(), de.desy.tine.queryUtils.TQuery.getDeviceContexts(), de.desy.tine.queryUtils.TQuery.getDeviceGroupMembers(), de.desy.tine.queryUtils.TQuery.getDeviceServerReport(), de.desy.tine.eventUtils.TEventArchive.getDeviceServers(), de.desy.tine.addrUtils.ENSTools.getGroupMembersFromGENS(), de.desy.tine.queryUtils.TQuery.getMetaProperties(), de.desy.tine.queryUtils.TQuery.getServerClients(), de.desy.tine.queryUtils.TQuery.getServerInformation(), de.desy.tine.queryUtils.TQuery.getStockProperties(), de.desy.tine.queryUtils.TQuery.pingServer(), de.desy.tine.addrUtils.ENSTools.removeFECFromENS(), de.desy.tine.addrUtils.ENSTools.sendExportInformationToENS(), de.desy.tine.eventUtils.TEventArchive.sendTrigger(), and de.desy.tine.histUtils.THistory.setAnnotation().
int de.desy.tine.client.TLink.executeAndClose | ( | int | timeout | ) |
Executes a synchronous link using the data sets supplied at
link creation and Closes the link upon completion.
Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for the duration of the timeout specified or until the call completes. When the link has completed (successfully or not) the TLink will be automatically closed and hence removed from the link tables, obviating the need for an additional call to closeLink().
timeout | The amount of time in milliseconds to block execution until the call completes. |
References de.desy.tine.client.TLink.executeAndClose().
int de.desy.tine.client.TLink.executeAndClose | ( | int | timeout, |
short | appendMode | ||
) |
Executes a synchronous link using the data sets supplied at
link creation and Closes the link upon completion.
Synchronous. This method executes the link using the data sets and parameters provided at instantiation. The call will block for the duration of the timeout specified or until the call completes. When the link has completed (successfully or not) the TLink will be automatically closed and hence removed from the link tables, obviating the need for an additional call to closeLink().
timeout | The amount of time in milliseconds to block execution until the call completes. |
appendMode | will be appended to the tine Control Mode, which is TMode.CM_SINGLE. (e.g. TMode.CM_CONNECT). |
References de.desy.tine.client.TLink.close(), and de.desy.tine.client.TLink.execute().
int de.desy.tine.client.TLink.executeAndListen | ( | ) |
Executes synchronously, returning the link results.
Upon the initial call an asynchronous 'listener' monitor link is establishes with the update interval given by the 'timeout' parameter. Subsequent calls simply update the output data object with the current contents of the underlying monitor link AND keep the underlying monitor link active.
If a 'dead time' interval of 5 minutes without a subsequent call to executeAndListen() occurs, then monitor link is closed.
For 'simple' applications which 'poll' for data in a timer, the performance can be improved dramatically by replacing calls to the 'execute()' method with 'executeAndListen().
With this simple method, the underlying monitor will use the default monitor interval of 1000 msec and the default mode of TMode.CM_TIMER.
Referenced by de.desy.tine.client.TLink.execute(), and de.desy.tine.client.TLink.executeAndListen().
int de.desy.tine.client.TLink.executeAndListen | ( | int | interval | ) |
Executes synchronously, returning the link results.
Upon the initial call an asynchronous 'listener' monitor link is establishes with the update interval given by the 'timeout' parameter. Subsequent calls simply update the output data object with the current contents of the underlying monitor link AND keep the underlying monitor link active.
If a 'dead time' interval of 5 minutes without a subsequent call to executeAndListen() occurs, then monitor link is closed.
For 'simple' applications which 'poll' for data in a timer, the performance can be improved dramatically by replacing calls to the 'execute()' method with 'executeAndListen().
interval | Is analogous to the timeout parameter in the 'execute()' method family and gives the amount of time in milliseconds to block execution until the initial call completes. It also establishes the monitor interval for the underlying asynchronous link. The underlying monitor will use TMode.CM_TIMER with this method. |
References de.desy.tine.client.TLink.executeAndListen().
int de.desy.tine.client.TLink.executeAndListen | ( | int | interval, |
short | mode | ||
) |
Executes synchronously, returning the link results.
Upon the initial call an asynchronous 'listener' monitor link is establishes with the update interval given by the 'timeout' parameter. Subsequent calls simply update the output data object with the current contents of the underlying monitor link AND keep the underlying monitor link active.
If a 'dead time' interval of 5 minutes without a subsequent call to executeAndListen() occurs, then monitor link is closed.
For 'simple' applications which 'poll' for data in a timer, the performance can be improved dramatically by replacing calls to the 'execute()' method with 'executeAndListen().
interval | Is analogous to the timeout parameter in the 'execute()' method family and gives the amount of time in milliseconds to block execution until the initial call completes. It also establishes the monitor interval for the underlying asynchronous link. |
mode | can be used to completely control the mode of the underlying asynchronous monitor (default is TMode.CM_TIMER). |
References de.desy.tine.client.TLink.execute(), de.desy.tine.definitions.TMode.getBaseMode(), and de.desy.tine.client.TLink.getFullDeviceNameAndProperty().
String de.desy.tine.client.TLink.getArrayDelimiter | ( | ) |
Gets the array delimiter for use in the toString() method of associated TDataType objects.
String de.desy.tine.client.TLink.getContext | ( | ) |
Returns the context of this link.
String de.desy.tine.client.TLink.getDeviceName | ( | ) |
Returns the device (module) name addressed in this link.
String de.desy.tine.client.TLink.getDeviceServer | ( | ) |
Returns the device server addressed in this link.
String de.desy.tine.client.TLink.getError | ( | int | code | ) |
The specified error code in plain text.
code | Is the tine error code for which the error text is desired |
References de.desy.tine.definitions.TErrorList.getErrorString().
Referenced by de.desy.tine.client.TLink.getLastError().
String de.desy.tine.client.TLink.getFullDeviceName | ( | ) |
Returns the fully qualified device name addressed in this link.
Referenced by de.desy.tine.client.TLink.execute(), and de.desy.tine.client.TLink.getFullDeviceNameAndProperty().
String de.desy.tine.client.TLink.getFullDeviceNameAndProperty | ( | ) |
Returns the fully qualified device name and property addressed in this link.
References de.desy.tine.client.TLink.getFullDeviceName().
Referenced by de.desy.tine.client.TLink.execute(), de.desy.tine.client.TLink.executeAndListen(), and de.desy.tine.queryUtils.TQuery.getDeviceServerReport().
TDataType de.desy.tine.client.TLink.getInputDataObject | ( | ) |
Returns the output data input as a TDataType.
double de.desy.tine.client.TLink.getLastDataTimeStamp | ( | ) |
The last link timestamp as a TINE double timestamp value.
String de.desy.tine.client.TLink.getLastError | ( | ) |
The last link status in plain text.
References de.desy.tine.client.TLink.getError().
Referenced by de.desy.tine.client.TAwtAsyncCallback.callback(), de.desy.tine.eventUtils.TEventArchive.getArchiveData(), de.desy.tine.queryUtils.TQuery.getDeviceServerReport(), de.desy.tine.eventUtils.TEventArchive.getDeviceServers(), de.desy.tine.client.TAwtSyncCallback.getErrorString(), and de.desy.tine.client.ez.TineClient.unsubscribeEvent().
long de.desy.tine.client.TLink.getLastTimeStamp | ( | ) |
The last link timestamp.
int de.desy.tine.client.TLink.getLinkStatus | ( | ) |
Returns the current status for this link.
Referenced by de.desy.tine.client.TAwtAsyncCallback.callback(), de.desy.tine.client.TLink.execute(), and de.desy.tine.client.TAwtSyncCallback.getLinkStatus().
TDataType de.desy.tine.client.TLink.getOutputDataObject | ( | ) |
Returns the output data object as a TDataType.
Referenced by de.desy.tine.client.TLink.execute(), de.desy.tine.queryUtils.TQuery.getDeviceServerReport(), and de.desy.tine.eventUtils.TEventArchive.getDeviceServers().
String de.desy.tine.client.TLink.getProperty | ( | ) |
Returns the device property addressed in this link.
Referenced by de.desy.tine.client.TLink.execute().
int de.desy.tine.client.TLink.receive | ( | TCallback | f | ) |
Attaches the data sets to the global link and signals the callback routine using the assigned link id.
Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter. Using the receive() method assumes that the data requested are global available.
f | is the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TCallback() class interface. |
Example:
References de.desy.tine.client.TLink.attach().
int de.desy.tine.client.TLink.receive | ( | TCallback | f, |
int | notificationId | ||
) |
Attaches the data sets to the global link and signals the callback routine using a reference to the given notifcation ID in the callback.
Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter. Using the receive() method assumes that the data requested are global available.
f | is the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TCallback() class interface. |
notificationId | is the desired identifier to be passed to the supplied callback routine when it is fired. |
Example:
References de.desy.tine.client.TLink.attach().
int de.desy.tine.client.TLink.receive | ( | TLinkCallback | f | ) |
Attaches the data sets to the global link and signals the callback routine using a reference to the referenced TLink object.
Asynchronous. This method attaches the data sets to the created link using the calling parameters provided at instantiation. The arriving data will automatically update the output data set and then fire the callback method provided. If the callback is not needed, a null can be passed for this parameter. Using the receive() method assumes that the data requested are global available. This is the preferred receive method to use. The Callback instantiates a TLinkCallback() interface which provides a TLink object as parameter.
f | is the 'callback function' to be called whenever either new data arrive or a change in link status occurs. The callback function should instantiate a class you create which implements the TLinkCallback() class interface. |
Example:
References de.desy.tine.client.TLink.attach().
void de.desy.tine.client.TLink.setArrayDelimiter | ( | String | delimiter | ) |
Sets the array delimiter for use in the toString() method of associated TDataType objects.
delimiter | is the string delimiter to use in separating data variables in a string dump (default ",") |
References de.desy.tine.dataUtils.TDataType.setArrayDelimiter().
int de.desy.tine.client.TLink.setErrorValue | ( | double | errValue | ) |
Specifies an error value to fill in associated data buffers in case of link error.
errValue | Is the error value to use in case of link errors |
0 if successful
Referenced by de.desy.tine.client.TLink.execute().
int de.desy.tine.client.TLink.setErrorValue | ( | String | errString | ) |
Specifies an error string to fill in associated data buffers in case of link error.
errString | Is the string to use in case of link errors |
0 if successful
void de.desy.tine.client.TLink.setNotificationTolerance | ( | float | absoluteValue, |
float | percentValue | ||
) |
Sets the tolerance level for asynchronous event notification.
Link callback notification can be suppressed if changes in the link data do not exceed the tolerance applied in this call. The tolerance can have an absolute part (in the units of the data) and/or a percent part.
absoluteValue | is the absolute tolerance any particular data element is allowed to have before an event notification is called. |
percentValue | is the percent tolerance any particular data element is allowed to have before an event notification is called. |
|
static |
returns string array of length 4 with string[0] = context, string[1] = server, string[2] = device, and string[3] = property
fullDeviceNameAndProperty | is the full string to be parsed into its address parts |
|
static |
returns string array of length 2 with first string = full device name and second string = property
fullDeviceNameAndProperty | is the full string to be parsed into device name and property |
Referenced by de.desy.tine.client.TLink.TLink().
void de.desy.tine.client.TLink.waitForLinkCompletion | ( | ) |
Stops thread execution until this link has completed.
Useful for grouped asynchronous links.