DESY ACOP Beans Home

de.desy.acop.transport
Class ConnectionParameters

java.lang.Object
  extended by de.desy.acop.transport.ConnectionParameters
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ConnectionParameters>

public class ConnectionParameters
extends java.lang.Object
implements java.lang.Comparable<ConnectionParameters>, java.io.Serializable

This objecct holds all parameters necessary to initiate ACOP transport connection.

Author:
Igor Kriznar (igor.kriznarATcosylab.com)
See Also:
Serialized Form

Field Summary
static int ACTUAL_PROPERTY_SIZE
          Predefined value for the property size connection parameter, which means that when property will be connected, then actual remote size for property array will be used.
static int AUTO_PROPERTY_SIZE
          Predefined value for the property size connection parameter, which means that when property will be connected, size of array will be set according to displayer's capabilities.
 
Constructor Summary
ConnectionParameters()
          Creates new instance of ConnectionParameters.
ConnectionParameters(java.lang.String parameters)
          Constructs a new ConnectionParameters.
ConnectionParameters(java.lang.String remoteName, AccessMode accessMode, int accessRate)
          Creates new instance of ConnectionParameters.
ConnectionParameters(java.lang.String remoteName, AccessMode accessMode, int accessRate, int arraySize)
          Constructs new ConnectionParameters object.
ConnectionParameters(java.lang.String remoteName, AccessMode accessMode, int accessRate, int arraySize, java.lang.Object dynamicParameters)
           
ConnectionParameters(java.lang.String remoteName, AccessMode accessMode, int accessRate, java.lang.Object dynamicParameters)
           
ConnectionParameters(java.lang.String parameters, java.lang.Object dynamicParameters)
           
ConnectionParameters(java.lang.String accessProtocol, java.lang.String deviceContext, java.lang.String deviceGroup, java.lang.String deviceName, java.lang.String deviceProperty, AccessMode accessMode, int accessRate)
          Creates new instance of ConnectionParameters.
ConnectionParameters(java.lang.String accessProtocol, java.lang.String deviceContext, java.lang.String deviceGroup, java.lang.String deviceName, java.lang.String deviceProperty, AccessMode accessMode, int accessRate, int propertySize)
          Constructs a new ConnectionParameters.
ConnectionParameters(java.lang.String accessProtocol, java.lang.String deviceContext, java.lang.String deviceGroup, java.lang.String deviceName, java.lang.String deviceProperty, AccessMode accessMode, int accessRate, int propertySize, java.lang.Object dynamicParameters)
           
ConnectionParameters(java.lang.String accessProtocol, java.lang.String deviceContext, java.lang.String deviceGroup, java.lang.String deviceName, java.lang.String deviceProperty, AccessMode accessMode, int accessRate, java.lang.Object dynamicParameters)
           
 
Method Summary
 int compareTo(ConnectionParameters o)
           
 ConnectionParameters deriveWith(AccessMode mode)
          Returns new ConnectionParameters which resembles this object but has a different access mode.
 ConnectionParameters deriveWith(AccessMode mode, int rate)
          Returnst new ConnectionParameters which resembles this object but has a different acces mode and rate.
 ConnectionParameters deriveWith(int rate)
          Deprecated. use deriveWithAccessRate(int) instead
 ConnectionParameters deriveWithAccessProtocol(java.lang.String accessProtocol)
          Constructs a new ConnectionParameters with the same properties as this object but a different access protocol.
 ConnectionParameters deriveWithAccessRate(int accessRate)
          Constructs a new ConnectionParameters with the same properties as this object but a different access rate.
 ConnectionParameters deriveWithDeviceContext(java.lang.String deviceContext)
          Constructs a new ConnectionParameters with the same properties as this object but a different device context.
 ConnectionParameters deriveWithDeviceGroup(java.lang.String deviceGroup)
          Constructs a new ConnectionParameters with the same properties as this object but a different device group.
 ConnectionParameters deriveWithDeviceName(java.lang.String deviceName)
          Constructs a new ConnectionParameters with the same properties as this object but a different device name.
 ConnectionParameters deriveWithDeviceProperty(java.lang.String deviceProperty)
          Constructs a new ConnectionParameters with the same properties as this object but a different property name.
 ConnectionParameters deriveWithDynamicParameters(java.lang.Object newDynamicParameters)
          Returns new ConnectionParameters which resebles this object but has a different dynamic parameters.
 ConnectionParameters deriveWithPropertySize(int propertySize)
          Returns new ConnectionParameters which resembles this object but has a different property size.
 boolean equals(java.lang.Object o)
           
 AccessMode getAccessMode()
          Returns the accessMode.
 java.lang.String getAccessProtocol()
          Returns the accessProtocol.
 int getAccessRate()
          Returns the accessRate.
 java.lang.String getDeviceContext()
          Returns the deviceContext.
 java.lang.String getDeviceGroup()
          Returns the deviceGroup.
 java.lang.String getDeviceName()
          Returns the deviceName.
 java.lang.String getDeviceProperty()
          Returns the deviceProperty.
 java.lang.Object getDynamicParameters()
          Returns the dynamic parameters.
 int getPropertySize()
          Size of TINE property.
 java.lang.String getRemoteName()
          Return URI ready name for remote TINE property.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ACTUAL_PROPERTY_SIZE

public static int ACTUAL_PROPERTY_SIZE
Predefined value for the property size connection parameter, which means that when property will be connected, then actual remote size for property array will be used.


AUTO_PROPERTY_SIZE

public static int AUTO_PROPERTY_SIZE
Predefined value for the property size connection parameter, which means that when property will be connected, size of array will be set according to displayer's capabilities.

Constructor Detail

ConnectionParameters

public ConnectionParameters()
Creates new instance of ConnectionParameters.


ConnectionParameters

public ConnectionParameters(java.lang.String parameters)
Constructs a new ConnectionParameters. This constructor assume that the given paramete string includes the remote name which is obligatory as well as AccessMode, access rate and property size, which is optional (all three included or excluded). The parameter can also include everything but the property size. All parameters in the string should be separated by comma (eg. PROTOCOL/CONTEXT/SERVER/DEVICE/PROPERTY,AccessMode.POLL,1000,1).

Parameters:
parameters -
See Also:
getPropertySize()

ConnectionParameters

public ConnectionParameters(java.lang.String parameters,
                            java.lang.Object dynamicParameters)
Parameters:
parameters - the parameters (remotename,accessmode,accessrate,propertySize)
dynamicParameters - additional parameters that are required for making a connection
See Also:
ConnectionParameters(String)

ConnectionParameters

public ConnectionParameters(java.lang.String accessProtocol,
                            java.lang.String deviceContext,
                            java.lang.String deviceGroup,
                            java.lang.String deviceName,
                            java.lang.String deviceProperty,
                            AccessMode accessMode,
                            int accessRate)
Creates new instance of ConnectionParameters.

Parameters:
accessProtocol - the access protocol (TINE)
deviceContext - the context
deviceGroup - the server
deviceName - the device name
deviceProperty - the property name
accessMode - the access mode for the connection
accessRate - the polling rate

ConnectionParameters

public ConnectionParameters(java.lang.String accessProtocol,
                            java.lang.String deviceContext,
                            java.lang.String deviceGroup,
                            java.lang.String deviceName,
                            java.lang.String deviceProperty,
                            AccessMode accessMode,
                            int accessRate,
                            java.lang.Object dynamicParameters)
Parameters:
accessProtocol - the access protocol (TINE)
deviceContext - the context
deviceGroup - the server
deviceName - the device name
deviceProperty - the property name
accessMode - the access mode for the connection
accessRate - the polling rate
dynamicParameters - additional parameters to make a connection
See Also:
ConnectionParameters(String, String, String, String, String, AccessMode, int)

ConnectionParameters

public ConnectionParameters(java.lang.String accessProtocol,
                            java.lang.String deviceContext,
                            java.lang.String deviceGroup,
                            java.lang.String deviceName,
                            java.lang.String deviceProperty,
                            AccessMode accessMode,
                            int accessRate,
                            int propertySize)
Constructs a new ConnectionParameters.

Parameters:
accessProtocol - the access protocol (TINE)
deviceContext - the context
deviceGroup - the server
deviceName - the device name
deviceProperty - the property name
accessMode - the access mode for the connection
accessRate - the polling rate
propertySize - the size of the requested property data

ConnectionParameters

public ConnectionParameters(java.lang.String accessProtocol,
                            java.lang.String deviceContext,
                            java.lang.String deviceGroup,
                            java.lang.String deviceName,
                            java.lang.String deviceProperty,
                            AccessMode accessMode,
                            int accessRate,
                            int propertySize,
                            java.lang.Object dynamicParameters)
Parameters:
accessProtocol - the access protocol (TINE)
deviceContext - the context
deviceGroup - the server
deviceName - the device name
deviceProperty - the property name
accessMode - the access mode for the connection
accessRate - the polling rate
propertySize - the size of the requested property data
dynamicParameters - additional parameters to make a connection
See Also:
ConnectionParameters(String, String, String, String, String, AccessMode, int, int)

ConnectionParameters

public ConnectionParameters(java.lang.String remoteName,
                            AccessMode accessMode,
                            int accessRate)
Creates new instance of ConnectionParameters.

Parameters:
remoteName - the remote name (context/server/device/property)
accessMode - the access mode for the connection
accessRate - the polling rate

ConnectionParameters

public ConnectionParameters(java.lang.String remoteName,
                            AccessMode accessMode,
                            int accessRate,
                            java.lang.Object dynamicParameters)
Parameters:
remoteName - the remote name (context/server/device/property)
accessMode - the access mode for the connection
accessRate - the polling rate
dynamicParameters - additional parameters to make a connection
See Also:
ConnectionParameters(String, AccessMode, int)

ConnectionParameters

public ConnectionParameters(java.lang.String remoteName,
                            AccessMode accessMode,
                            int accessRate,
                            int arraySize)
Constructs new ConnectionParameters object.

Parameters:
remoteName - the remote name (context/server/device/property)
accessMode - the access mode for the connection
accessRate - the polling rate
arraySize - the size of the requested data array

ConnectionParameters

public ConnectionParameters(java.lang.String remoteName,
                            AccessMode accessMode,
                            int accessRate,
                            int arraySize,
                            java.lang.Object dynamicParameters)
Parameters:
remoteName - the remote name (context/server/device/property)
accessMode - the access mode for the connection
accessRate - the polling rate
arraySize - the size of the requested data array
dynamicParameters - additional parameters to make a connection
See Also:
ConnectionParameters(String, AccessMode, int, int)
Method Detail

getAccessMode

public AccessMode getAccessMode()
Returns the accessMode.

Returns:
Returns the accessMode.

getAccessProtocol

public java.lang.String getAccessProtocol()
Returns the accessProtocol.

Returns:
Returns the accessProtocol.

getAccessRate

public int getAccessRate()
Returns the accessRate.

Returns:
Returns the accessRate.

getDeviceContext

public java.lang.String getDeviceContext()
Returns the deviceContext.

Returns:
Returns the deviceContext.

getDeviceGroup

public java.lang.String getDeviceGroup()
Returns the deviceGroup.

Returns:
Returns the deviceGroup.

getDeviceName

public java.lang.String getDeviceName()
Returns the deviceName.

Returns:
Returns the deviceName.

getDeviceProperty

public java.lang.String getDeviceProperty()
Returns the deviceProperty.

Returns:
Returns the deviceProperty.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getRemoteName

public java.lang.String getRemoteName()
Return URI ready name for remote TINE property.

Returns:
remote TINE name delimitted with / characters

getDynamicParameters

public java.lang.Object getDynamicParameters()
Returns the dynamic parameters. These are the additional parameters, which might be required by the server to establish a connection. In normal conditions this is null, but it can be something like an int array.

Returns:
the dynamic parameters

getPropertySize

public int getPropertySize()
Size of TINE property. 1 means that property will have one value in array. -1 or 0 means that when connected, automatic or actual property size will be used.

Returns:
size or property if it is array
See Also:
ACTUAL_PROPERTY_SIZE, AUTO_PROPERTY_SIZE

compareTo

public int compareTo(ConnectionParameters o)
Specified by:
compareTo in interface java.lang.Comparable<ConnectionParameters>

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

deriveWith

public ConnectionParameters deriveWith(AccessMode mode)
Returns new ConnectionParameters which resembles this object but has a different access mode.

Parameters:
mode - access mode of the new parameters
Returns:
new ConnectionParameters object

deriveWith

public ConnectionParameters deriveWith(AccessMode mode,
                                       int rate)
Returnst new ConnectionParameters which resembles this object but has a different acces mode and rate.

Parameters:
mode - access mode of the new parameters
rate - access rate of the new parameters
Returns:
new COnnectionParameters object

deriveWith

public ConnectionParameters deriveWith(int rate)
Deprecated. use deriveWithAccessRate(int) instead

Returnst new ConnectionParameters which resembles this object but has a different and rate.

Parameters:
rate - access rate of the new parameters
Returns:
new COnnectionParameters object

deriveWithDynamicParameters

public ConnectionParameters deriveWithDynamicParameters(java.lang.Object newDynamicParameters)
Returns new ConnectionParameters which resebles this object but has a different dynamic parameters.

Parameters:
newDynamicParameters - the new dynamic parameters
Returns:
new connection parameters

deriveWithPropertySize

public ConnectionParameters deriveWithPropertySize(int propertySize)
Returns new ConnectionParameters which resembles this object but has a different property size.

Parameters:
propertySize - the new property size
Returns:
new ConnectionParameters object

deriveWithAccessProtocol

public ConnectionParameters deriveWithAccessProtocol(java.lang.String accessProtocol)
Constructs a new ConnectionParameters with the same properties as this object but a different access protocol.

Parameters:
accessProtocol - new access protocol
Returns:
new ConnectionParameters object

deriveWithDeviceContext

public ConnectionParameters deriveWithDeviceContext(java.lang.String deviceContext)
Constructs a new ConnectionParameters with the same properties as this object but a different device context.

Parameters:
deviceContext - new device context
Returns:
new ConnectionParameters object

deriveWithAccessRate

public ConnectionParameters deriveWithAccessRate(int accessRate)
Constructs a new ConnectionParameters with the same properties as this object but a different access rate.

Parameters:
accessRate - new access rate
Returns:
new ConnectionParameters object

deriveWithDeviceGroup

public ConnectionParameters deriveWithDeviceGroup(java.lang.String deviceGroup)
Constructs a new ConnectionParameters with the same properties as this object but a different device group.

Parameters:
deviceGroup - new device group
Returns:
new ConnectionParameters object

deriveWithDeviceName

public ConnectionParameters deriveWithDeviceName(java.lang.String deviceName)
Constructs a new ConnectionParameters with the same properties as this object but a different device name.

Parameters:
deviceName - new device name
Returns:
new ConnectionParameters object

deriveWithDeviceProperty

public ConnectionParameters deriveWithDeviceProperty(java.lang.String deviceProperty)
Constructs a new ConnectionParameters with the same properties as this object but a different property name.

Parameters:
deviceProperty - new property name
Returns:
new ConnectionParameters object


Copyright © 2010. All Rights Reserved.