Main Page | Features | Central Services | csv-Files | Types | Transfer | Access | API-C | API-.NET | API-Java | Examples | Downloads
page generated on 31.05.2023 - 04:45
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
de.desy.tine.accesslayer.ChannelFactory Class Reference

ChannelFactory provides access to tine channels, by using a common tine layer for all requests that are targeted at the same address. More...

Public Member Functions

void setValue (String address, Object value) throws ConnectionException
 Synchronously sets the value to the given property. More...
 
void setValue (String address, Object value, TDataType outValue, int timeout) throws ConnectionException
 Synchronously sets the value to the given property. More...
 
void setValueAsync (String address, Object value, ChannelCallback callback) throws ConnectionException
 Asynchronously sets the value to the given property. More...
 
void setValueAsync (String address, Object value, TDataType outValue, int timeout, ChannelCallback callback) throws ConnectionException
 Asynchronously sets the value to the given property. More...
 
void setRawValue (String address, TDataType value) throws ConnectionException
 Synchronously sets the value to the given property. More...
 
void setRawValue (String address, TDataType value, TDataType outValue, int timeout) throws ConnectionException
 Synchronously sets the value to the given property. More...
 
void setRawValueAsync (String address, TDataType value, ChannelCallback callback) throws ConnectionException
 Asynchronously sets the value to the given property. More...
 
void setRawValueAsync (String address, TDataType value, TDataType outValue, int timeout, ChannelCallback callback) throws ConnectionException
 Asynchronously sets the value to the given property. More...
 
Object getValue (String address) throws ConnectionException
 Makes a single synchronous connection to the address specified by parameters and returns the value. More...
 
Object getValue (String address, TDataType dataOut, Object dataIn, int timeout) throws ConnectionException
 Makes a single synchronous connection to the address specified by parameters and returns the value. More...
 
Object getValueSync (String address) throws ConnectionException
 Makes a true single synchronous connection to the address specified by parameters and returns the value. More...
 
Object getValueSync (String address, TDataType dataOut, Object dataIn, int timeout) throws ConnectionException
 Makes a true single synchronous connection to the address specified by parameters and returns the value. More...
 
void getValueAsync (String address, ChannelCallback callback) throws ConnectionException
 Makes an asynchronous connection to the tine property specified by the device and property. More...
 
void getValueAsync (String address, ChannelCallback callback, Object dataIn) throws ConnectionException
 Makes an asynchronous connection to the tine property specified by the device and property. More...
 
TDataType getRawValue (String address) throws ConnectionException
 Makes a single synchronous connection to the address specified by parameters and returns the value. More...
 
TDataType getRawValue (String address, TFormat outFormat, int outSize, Object dataIn) throws ConnectionException
 Makes a single synchronous connection to the address specified by parameters and returns the value. More...
 
TDataType getRawValueSync (String address) throws ConnectionException
 Makes a true single synchronous connection (TINE synchronous link) to the address specified by parameters and returns the value. More...
 
TDataType getRawValueSync (String address, TFormat outFormat, int outSize, Object dataIn) throws ConnectionException
 Makes a true single synchronous connection (TINE synchronous link) to the address specified by parameters and returns the value. More...
 
TDataType getRawValue (String address, TFormat outFormat, int outSize, Object dataIn, boolean synchronousCall) throws ConnectionException
 Makes a single synchronous connection to the address specified by parameters and returns the value. More...
 
Channel getChannel (String address, ConnectionMode mode, int rate, ChannelCallback callback) throws ConnectionException
 Creates a channel that receives notifications according to the given connection mode and rate. More...
 
Channel getChannel (String address, ConnectionMode mode, int rate, ChannelCallback callback, Object dataIn) throws ConnectionException
 Creates a channel that receives notifications according to the given connection mode and rate. More...
 
Channel getChannel (String address, TFormat dataOutFormat, int dataOutSize, ConnectionMode mode, int rate, ChannelCallback callback) throws ConnectionException
 Creates a channel that receives notifications according to the given connection mode and rate. More...
 
Channel getChannel (String address, TFormat dataOutFormat, int dataOutSize, Object dataIn, ConnectionMode mode, int rate, ChannelCallback callback) throws ConnectionException
 Creates a channel that receives notifications according to the given connection mode and rate. More...
 
Channel getChannel (String address, TDataType dataOutObject, Object dataIn, ConnectionMode mode, int rate, ChannelCallback callback) throws ConnectionException
 Creates a channel that receives notifications according to the given connection mode and rate. More...
 
void close ()
 Close all active links, interrupt all running threads.
 

Static Public Member Functions

static synchronized ChannelFactory getInstance ()
 

Static Public Attributes

static final String LINK_KEEP_ALIVE_MSEC = "tine.layer.keepAlive"
 The time for how long single read links are kept alive after no longer needed.
 
static final String MAX_KEEP_ALIVE_MSEC = "tine.layer.maxKeepAlive"
 The maximum time how long an links are opened after no longer needed.
 

Detailed Description

ChannelFactory provides access to tine channels, by using a common tine layer for all requests that are targeted at the same address.

Author
Jaka Bobnar

Member Function Documentation

◆ getChannel() [1/5]

Channel de.desy.tine.accesslayer.ChannelFactory.getChannel ( String  address,
ConnectionMode  mode,
int  rate,
ChannelCallback  callback 
) throws ConnectionException

Creates a channel that receives notifications according to the given connection mode and rate.

If connection mode is CHANGE the callback will receive a notification every time the value changes, if the connection mod is POLL the callback will receive notifications at the specified rate, if the mode is single the callback will receive a single notification. The connection is created using the default data format and size.

Parameters
addressthe property to connect to
modethe connection mode
ratethe notification rate in milliseconds
callbackthe callback to receive notifications
Returns
channel connected to the given property that receives notification according to the policy
Exceptions
ConnectionExceptionif there was an error establishing connection

Referenced by de.desy.tine.accesslayer.ChannelFactory.getChannel(), de.desy.tine.accesslayer.ChannelFactory.getRawValue(), and de.desy.tine.accesslayer.ChannelFactory.getValueAsync().

◆ getChannel() [2/5]

Channel de.desy.tine.accesslayer.ChannelFactory.getChannel ( String  address,
ConnectionMode  mode,
int  rate,
ChannelCallback  callback,
Object  dataIn 
) throws ConnectionException

Creates a channel that receives notifications according to the given connection mode and rate.

If connection mode is CHANGE the callback will receive a notification every time the value changes, if the connection mod is POLL the callback will receive notifications at the specified rate, if the mode is single the callback will receive a single notification. The connection is created using the default data format and size.

Parameters
addressthe property to connect to
modethe connection mode
ratethe notification rate in milliseconds
callbackthe callback to receive notifications
dataInthe input data for the monitor
Returns
channel connected to the given property that receives notification according to the policy
Exceptions
ConnectionExceptionif there was an error establishing connection

References de.desy.tine.accesslayer.ChannelFactory.getChannel().

◆ getChannel() [3/5]

Channel de.desy.tine.accesslayer.ChannelFactory.getChannel ( String  address,
TDataType  dataOutObject,
Object  dataIn,
ConnectionMode  mode,
int  rate,
ChannelCallback  callback 
) throws ConnectionException

Creates a channel that receives notifications according to the given connection mode and rate.

If connection mode is CHANGE the callback will receive a notification every time the value changes, if the connection mod is POLL the callback will receive notifications at the specified rate, if the mode is single the callback will receive a single notification. The connection is created using the format and size given in the dataOutObject, which will be assigned the output value upon completion.

Parameters
addressthe property to connect to
dataOutObjectthe object into which the output data will be written
dataInsome channels require input data to successfully read their values; the data are provided by the given parameter
modethe connection mode
ratethe notification rate in milliseconds
callbackthe callback to receive notifications
Returns
channel connected to the given property that receives notification according to the policy
Exceptions
ConnectionExceptionif there was an error establishing connection

References de.desy.tine.accesslayer.ChannelFactory.getChannel(), and de.desy.tine.definitions.TFormat.valueOf().

◆ getChannel() [4/5]

Channel de.desy.tine.accesslayer.ChannelFactory.getChannel ( String  address,
TFormat  dataOutFormat,
int  dataOutSize,
ConnectionMode  mode,
int  rate,
ChannelCallback  callback 
) throws ConnectionException

Creates a channel that receives notifications according to the given connection mode and rate.

If connection mode is CHANGE the callback will receive a notification every time the value changes, if the connection mod is POLL the callback will receive notifications at the specified rate, if the mode is single the callback will receive a single notification. The connection is created using the given format and size. Depending on the server, the request might fail if the format and size are not compatible.

Parameters
addressthe property to connect to
dataOutFormatthe requested output format; channel will provide data in this format
dataOutSizethe requested output size; channel will provide data of this size
modethe connection mode
ratethe notification rate in milliseconds
callbackthe callback to receive notifications
Returns
channel connected to the given property that receives notification according to the policy
Exceptions
ConnectionExceptionif there was an error establishing connection

References de.desy.tine.accesslayer.ChannelFactory.getChannel().

◆ getChannel() [5/5]

Channel de.desy.tine.accesslayer.ChannelFactory.getChannel ( String  address,
TFormat  dataOutFormat,
int  dataOutSize,
Object  dataIn,
ConnectionMode  mode,
int  rate,
ChannelCallback  callback 
) throws ConnectionException

Creates a channel that receives notifications according to the given connection mode and rate.

If connection mode is CHANGE the callback will receive a notification every time the value changes, if the connection mod is POLL the callback will receive notifications at the specified rate, if the mode is single the callback will receive a single notification. The connection is created using the given format and size. Depending on the server, the request might fail if the format and size are not compatible with property type.

Parameters
addressthe property to connect to
dataOutFormatthe requested output format; channel will provide data in this format
dataOutSizethe requested output size; channel will provide data of this size
dataInsome channels require input data to successfully read their values; the data are provided by the given parameter
modethe connection mode
ratethe notification rate in milliseconds
callbackthe callback to receive notifications
Returns
channel connected to the given property that receives notification according to the policy
Exceptions
ConnectionExceptionif there was an error establishing connection

References de.desy.tine.accesslayer.ChannelFactory.getChannel(), and de.desy.tine.definitions.TFormat.valueOf().

◆ getInstance()

static synchronized ChannelFactory de.desy.tine.accesslayer.ChannelFactory.getInstance ( )
static
Returns
the singleton instance of the factory

◆ getRawValue() [1/3]

TDataType de.desy.tine.accesslayer.ChannelFactory.getRawValue ( String  address) throws ConnectionException

Makes a single synchronous connection to the address specified by parameters and returns the value.

If the value read failed a ConnectionException is thrown.

Parameters
devicedevice name to connect to
propertyproperty name to connect to
Returns
the value of the property
Exceptions
ConnectionExceptionif connection failed

Referenced by de.desy.tine.accesslayer.ChannelFactory.getRawValue(), and de.desy.tine.accesslayer.ChannelFactory.getRawValueSync().

◆ getRawValue() [2/3]

TDataType de.desy.tine.accesslayer.ChannelFactory.getRawValue ( String  address,
TFormat  outFormat,
int  outSize,
Object  dataIn 
) throws ConnectionException

Makes a single synchronous connection to the address specified by parameters and returns the value.

If the value read failed a ConnectionException is thrown.

Parameters
addressproperty name to connect to
outFormatrequested data out format
outSizerequested data out size
dataIninput data of the read request
modethe connection mode used
Returns
the value of the property
Exceptions
ConnectionExceptionif connection failed

References de.desy.tine.accesslayer.ChannelFactory.getRawValue().

◆ getRawValue() [3/3]

TDataType de.desy.tine.accesslayer.ChannelFactory.getRawValue ( String  address,
TFormat  outFormat,
int  outSize,
Object  dataIn,
boolean  synchronousCall 
) throws ConnectionException

Makes a single synchronous connection to the address specified by parameters and returns the value.

If the value read failed a ConnectionException is thrown.

Parameters
addressproperty name to connect to
outFormatrequested data out format
outSizerequested data out size
dataIninput data of the read request
modethe connection mode used
synchronousCalltrue to use a synchronous TINE link or false to use asynchronous link but still blocking this thread
Returns
the value of the property
Exceptions
ConnectionExceptionif connection failed

References de.desy.tine.accesslayer.ChannelFactory.getChannel(), de.desy.tine.accesslayer.Channel.getRawValue(), de.desy.tine.accesslayer.Channel.getStatus(), de.desy.tine.accesslayer.Channel.getStatusString(), de.desy.tine.definitions.TErrorList.hasData(), and de.desy.tine.definitions.TErrorList.toString().

◆ getRawValueSync() [1/2]

TDataType de.desy.tine.accesslayer.ChannelFactory.getRawValueSync ( String  address) throws ConnectionException

Makes a true single synchronous connection (TINE synchronous link) to the address specified by parameters and returns the value.

If the value read failed a ConnectionException is thrown.

Parameters
devicedevice name to connect to
propertyproperty name to connect to
Returns
the value of the property
Exceptions
ConnectionExceptionif connection failed

References de.desy.tine.accesslayer.ChannelFactory.getRawValue().

◆ getRawValueSync() [2/2]

TDataType de.desy.tine.accesslayer.ChannelFactory.getRawValueSync ( String  address,
TFormat  outFormat,
int  outSize,
Object  dataIn 
) throws ConnectionException

Makes a true single synchronous connection (TINE synchronous link) to the address specified by parameters and returns the value.

If the value read failed a ConnectionException is thrown.

Parameters
addressproperty name to connect to
outFormatrequested data out format
outSizerequested data out size
dataIninput data of the read request
modethe connection mode used
Returns
the value of the property
Exceptions
ConnectionExceptionif connection failed

References de.desy.tine.accesslayer.ChannelFactory.getRawValue().

◆ getValue() [1/2]

Object de.desy.tine.accesslayer.ChannelFactory.getValue ( String  address) throws ConnectionException

Makes a single synchronous connection to the address specified by parameters and returns the value.

If the value read failed a ConnectionException is thrown.

Parameters
addressproperty name to connect to
Returns
the value of the property
Exceptions
ConnectionExceptionif connection failed

Referenced by de.desy.tine.accesslayer.ChannelFactory.getValue(), and de.desy.tine.accesslayer.ChannelFactory.getValueSync().

◆ getValue() [2/2]

Object de.desy.tine.accesslayer.ChannelFactory.getValue ( String  address,
TDataType  dataOut,
Object  dataIn,
int  timeout 
) throws ConnectionException

Makes a single synchronous connection to the address specified by parameters and returns the value.

If the value read failed a ConnectionException is thrown.

Parameters
addressproperty name to connect to
dataoutthe object to received the output data
dataIninput data of the read request
timeoutthe timeout in milliseconds after which the call will return terminated
Returns
the value of the property
Exceptions
ConnectionExceptionif connection failed

References de.desy.tine.accesslayer.ChannelFactory.getValue().

◆ getValueAsync() [1/2]

void de.desy.tine.accesslayer.ChannelFactory.getValueAsync ( String  address,
ChannelCallback  callback 
) throws ConnectionException

Makes an asynchronous connection to the tine property specified by the device and property.

When the value is received it is forwarded to the given callback. If the connection could not be established an exception is thrown.

Parameters
addressthe property name
callbackcallback to receive notifications
Exceptions
ConnectionExceptionif there was an error establishing the connection

References de.desy.tine.accesslayer.ChannelFactory.getChannel().

◆ getValueAsync() [2/2]

void de.desy.tine.accesslayer.ChannelFactory.getValueAsync ( String  address,
ChannelCallback  callback,
Object  dataIn 
) throws ConnectionException

Makes an asynchronous connection to the tine property specified by the device and property.

When the value is received it is forwarded to the given callback. If the connection could not be established an exception is thrown.

Parameters
addressthe full property name
dataInthe input object of the read request
callbackcallback to receive notifications
Exceptions
ConnectionExceptionif there was an error establishing the connection

References de.desy.tine.accesslayer.ChannelFactory.getChannel().

◆ getValueSync() [1/2]

Object de.desy.tine.accesslayer.ChannelFactory.getValueSync ( String  address) throws ConnectionException

Makes a true single synchronous connection to the address specified by parameters and returns the value.

If the value read failed a ConnectionException is thrown.

Parameters
addressproperty name to connect to
Returns
the value of the property
Exceptions
ConnectionExceptionif connection failed

References de.desy.tine.accesslayer.ChannelFactory.getValue().

◆ getValueSync() [2/2]

Object de.desy.tine.accesslayer.ChannelFactory.getValueSync ( String  address,
TDataType  dataOut,
Object  dataIn,
int  timeout 
) throws ConnectionException

Makes a true single synchronous connection to the address specified by parameters and returns the value.

If the value read failed a ConnectionException is thrown.

Parameters
addressproperty name to connect to
dataoutthe object to received the output data
dataIninput data of the read request
timeoutthe timeout in milliseconds after which the call will return terminated
Returns
the value of the property
Exceptions
ConnectionExceptionif connection failed

References de.desy.tine.accesslayer.ChannelFactory.getValue().

◆ setRawValue() [1/2]

void de.desy.tine.accesslayer.ChannelFactory.setRawValue ( String  address,
TDataType  value 
) throws ConnectionException

Synchronously sets the value to the given property.

Upon success method does not return anything. If the write fails an exception si thrown, describing the error.

Parameters
addressthe proeprty to write to
valuethe value to write
Exceptions
ConnectionExceptionif write failed for any reason

◆ setRawValue() [2/2]

void de.desy.tine.accesslayer.ChannelFactory.setRawValue ( String  address,
TDataType  value,
TDataType  outValue,
int  timeout 
) throws ConnectionException

Synchronously sets the value to the given property.

Upon success method does not return anything; however the outValue does receive the readback value. If the write fails an exception si thrown, describing the error.

Parameters
addressthe proeprty to write to
valuethe value to write
outValuethe data type that will receive the readback value after write is completed
timeoutthe timeout in milliseconds
Exceptions
ConnectionExceptionif write failed for any reason

◆ setRawValueAsync() [1/2]

void de.desy.tine.accesslayer.ChannelFactory.setRawValueAsync ( String  address,
TDataType  value,
ChannelCallback  callback 
) throws ConnectionException

Asynchronously sets the value to the given property.

Upon completed write the callback is notified, either through ChannelCallback#writeCompleted(Object) or ChannelCallback#writeFailed(Object, int).

Parameters
addressthe property to connect to
valuethe value to set
callbackthe callback to be notified
Exceptions
ConnectionExceptionif establishing the connection failed

◆ setRawValueAsync() [2/2]

void de.desy.tine.accesslayer.ChannelFactory.setRawValueAsync ( String  address,
TDataType  value,
TDataType  outValue,
int  timeout,
ChannelCallback  callback 
) throws ConnectionException

Asynchronously sets the value to the given property.

Upon completed write the callback is notified, either through ChannelCallback#writeCompleted(Object) or ChannelCallback#writeFailed(Object, int). The readback value is also applied to the given outValue parameter.

Parameters
addressthe property to connect to
valuethe value to set
outValuethe data type that will receive the readback value after write is completed
timeoutthe timeout in milliseconds
callbackthe callback to be notified
Exceptions
ConnectionExceptionif establishing the connection failed

◆ setValue() [1/2]

void de.desy.tine.accesslayer.ChannelFactory.setValue ( String  address,
Object  value 
) throws ConnectionException

Synchronously sets the value to the given property.

Upon success method does not return anything. If the write fails an exception si thrown, describing the error.

Parameters
addressthe proeprty to write to
valuethe value to write
Exceptions
ConnectionExceptionif write failed for any reason

◆ setValue() [2/2]

void de.desy.tine.accesslayer.ChannelFactory.setValue ( String  address,
Object  value,
TDataType  outValue,
int  timeout 
) throws ConnectionException

Synchronously sets the value to the given property.

Upon success method does not return anything, but it does read the value and applies it to the given outValue parameter (the action is atomic). If the write fails an exception is thrown, describing the error.

Parameters
addressthe proeprty to write to
valuethe value to write
outValuethe data type that will receive the readback value after write is completed
timeoutthe timeout in milliseconds
Exceptions
ConnectionExceptionif write failed for any reason

◆ setValueAsync() [1/2]

void de.desy.tine.accesslayer.ChannelFactory.setValueAsync ( String  address,
Object  value,
ChannelCallback  callback 
) throws ConnectionException

Asynchronously sets the value to the given property.

Upon completed write the callback is notified, either through ChannelCallback#writeCompleted(Object) or ChannelCallback#writeFailed(Object, int).

Parameters
addressthe property to connect to
valuethe value to set
callbackthe callback to be notified
Exceptions
ConnectionExceptionif establishing the connection failed

◆ setValueAsync() [2/2]

void de.desy.tine.accesslayer.ChannelFactory.setValueAsync ( String  address,
Object  value,
TDataType  outValue,
int  timeout,
ChannelCallback  callback 
) throws ConnectionException

Asynchronously sets the value to the given property.

Upon completed write the callback is notified, either through ChannelCallback#writeCompleted(Object) or ChannelCallback#writeFailed(Object, int). The outValue also receives the readback value.

Parameters
addressthe property to connect to
valuethe value to set
outValuethe data type that will receive the readback value after write is completed
callbackthe callback to be notified
timeoutthe timeout in milliseconds
Exceptions
ConnectionExceptionif establishing the connection failed

The documentation for this class was generated from the following file: