TANGO Java API
( TangORB-7.3.3.jar)

fr.esrf.TangoApi
Class AttributeProxy

java.lang.Object
  extended by fr.esrf.TangoApi.AttributeProxy
All Implemented Interfaces:
ApiDefs, java.io.Serializable

public class AttributeProxy
extends java.lang.Object
implements ApiDefs, java.io.Serializable

Class Description: This class manage device connection for Tango attribute access.

Version:
$Revision: 1.8 $
Author:
verdier
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface fr.esrf.TangoApi.ApiDefs
ALL_ASYNCH, ATT_R, ATT_W, CALLBACK, CMD, D_TCP, D_UDP, FROM_ATTR, FROM_CMD, FROM_DBASE, FROM_IOR, LOGGING_DEBUG, LOGGING_ERROR, LOGGING_FATAL, LOGGING_INFO, LOGGING_OFF, LOGGING_WARN, MISC, NO_TIMEOUT, POLLING, protocol_name, PULL_CALLBACK, PUSH_CALLBACK, TACO, TANGO
 
Constructor Summary
AttributeProxy(java.lang.String attname)
          AttributeProxy constructor.
 
Method Summary
 void delete_property(java.lang.String propname)
          Delete a property for this object.
 void delete_property(java.lang.String[] propnames)
          Delete a list of properties for this object.
 java.lang.String fullName()
          Return full attribute name
 int get_idl_version()
           
 AttributeInfoEx get_info_ex()
          Get the attribute extended info.
 AttributeInfo get_info()
          Get the attribute info.
 int get_polling_period()
          Returns the polling period (in ms) for specified attribute.
 DbAttribute get_property()
          Query the database for a device attribute property for this device.
 DeviceProxy getDeviceProxy()
           
 DeviceDataHistory[] history()
          Return the full history for attribute polled.
 DeviceDataHistory[] history(int nb)
          Return the history for attribute polled.
static void main(java.lang.String[] args)
          Just a main method to check API methods.
 java.lang.String name()
          Return attribute name
 long ping()
          Ping the device proxy of this attribute.
 void poll(int period)
          Add a attribute to be polled for the device.
 void put_property(DbDatum property)
          Insert or update an attribute properties for this device.
 void put_property(DbDatum[] properties)
          Insert or update an attribute properties for this device.
 int read_asynch()
          Asynchronous read_attribute.
 void read_asynch(CallBack cb)
          Asynchronous read_attribute using callback for reply.
 DeviceAttribute[] read_reply(int id)
          Read Asynchronous read_attribute reply.
 DeviceAttribute[] read_reply(int id, int timeout)
          Read Asynchronous read_attribute reply.
 DeviceAttribute read()
          Read the attribute value for the specified device.
 void set_info(AttributeInfo[] attr)
          Update the attributes info for the specified device.
 void set_info(AttributeInfoEx[] attr)
          Update the attributes extended info for the specified device.
 void set_timeout_millis(int millis)
           
 DevState state()
          Check state of the device proxy of this attribute.
 java.lang.String status()
          Check status of the device proxy of this attribute.
 void stop_poll()
          Remove attribute of polled object list
 int subscribe_event(int event, CallBack callback, java.lang.String[] filters)
          Subscribe to an event.
 int write_asynch(DeviceAttribute attr)
          Asynchronous write_attribute.
 int write_asynch(DeviceAttribute attr, boolean forget)
          Asynchronous write_attribute.
 void write_asynch(DeviceAttribute attr, CallBack cb)
          Asynchronous write_attribute using callback for reply.
 DeviceAttribute write_read_attribute(DeviceAttribute devattr)
          Write and then read the attribute values, for the specified device.
 DeviceAttribute[] write_read_attribute(DeviceAttribute[] devattr)
          Write and then read the attribute values, for the specified device.
 void write_reply(int id)
          check for Asynchronous write_attribute reply.
 void write_reply(int id, int timeout)
          check for Asynchronous write_attribute reply.
 void write(DeviceAttribute devattr)
          Write the attribute value for the specified device.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeProxy

public AttributeProxy(java.lang.String attname)
               throws DevFailed
AttributeProxy constructor. It will import the device.

Parameters:
attname - name of the attribute or its alias.
Throws:
DevFailed
Method Detail

set_timeout_millis

public void set_timeout_millis(int millis)
                        throws DevFailed
Throws:
DevFailed

getDeviceProxy

public DeviceProxy getDeviceProxy()

get_idl_version

public int get_idl_version()
                    throws DevFailed
Throws:
DevFailed

fullName

public java.lang.String fullName()
Return full attribute name


name

public java.lang.String name()
Return attribute name


ping

public long ping()
          throws DevFailed
Ping the device proxy of this attribute.

Throws:
DevFailed

state

public DevState state()
               throws DevFailed
Check state of the device proxy of this attribute.

Throws:
DevFailed

status

public java.lang.String status()
                        throws DevFailed
Check status of the device proxy of this attribute.

Throws:
DevFailed

get_property

public DbAttribute get_property()
                         throws DevFailed
Query the database for a device attribute property for this device.

Returns:
property in DbAttribute object.
Throws:
DevFailed

put_property

public void put_property(DbDatum property)
                  throws DevFailed
Insert or update an attribute properties for this device. The property names and their values are specified by the DbAttribute array.

Parameters:
property - attribute property (names and values).
Throws:
DevFailed

put_property

public void put_property(DbDatum[] properties)
                  throws DevFailed
Insert or update an attribute properties for this device. The property names and their values are specified by the DbAttribute array.

Parameters:
properties - attribute properties (names and values).
Throws:
DevFailed

delete_property

public void delete_property(java.lang.String propname)
                     throws DevFailed
Delete a property for this object.

Parameters:
propname - Property name.
Throws:
DevFailed

delete_property

public void delete_property(java.lang.String[] propnames)
                     throws DevFailed
Delete a list of properties for this object.

Parameters:
propnames - Property names.
Throws:
DevFailed

get_info

public AttributeInfo get_info()
                       throws DevFailed
Get the attribute info.

Returns:
the attributes configuration.
Throws:
DevFailed

get_info_ex

public AttributeInfoEx get_info_ex()
                            throws DevFailed
Get the attribute extended info.

Returns:
the attributes configuration.
Throws:
DevFailed

set_info

public void set_info(AttributeInfo[] attr)
              throws DevFailed
Update the attributes info for the specified device.

Parameters:
attr - the attributes info.
Throws:
DevFailed

set_info

public void set_info(AttributeInfoEx[] attr)
              throws DevFailed
Update the attributes extended info for the specified device.

Parameters:
attr - the attributes info.
Throws:
DevFailed

read

public DeviceAttribute read()
                     throws DevFailed
Read the attribute value for the specified device.

Returns:
the attribute value.
Throws:
DevFailed

write

public void write(DeviceAttribute devattr)
           throws DevFailed
Write the attribute value for the specified device.

Parameters:
devattr - attribute name and value.
Throws:
DevFailed

write_read_attribute

public DeviceAttribute write_read_attribute(DeviceAttribute devattr)
                                     throws DevFailed
Write and then read the attribute values, for the specified device.

Parameters:
devattr - attribute names and values.
Throws:
DevFailed

write_read_attribute

public DeviceAttribute[] write_read_attribute(DeviceAttribute[] devattr)
                                       throws DevFailed
Write and then read the attribute values, for the specified device.

Parameters:
devattr - attribute names and values.
Throws:
DevFailed

history

public DeviceDataHistory[] history(int nb)
                            throws DevFailed
Return the history for attribute polled.

Parameters:
nb - nb data to read.
Throws:
DevFailed

history

public DeviceDataHistory[] history()
                            throws DevFailed
Return the full history for attribute polled.

Throws:
DevFailed

poll

public void poll(int period)
          throws DevFailed
Add a attribute to be polled for the device. If already polled, update its polling period.

Parameters:
period - polling period.
Throws:
DevFailed

get_polling_period

public int get_polling_period()
                       throws DevFailed
Returns the polling period (in ms) for specified attribute.

Throws:
DevFailed

stop_poll

public void stop_poll()
               throws DevFailed
Remove attribute of polled object list

Throws:
DevFailed

read_asynch

public int read_asynch()
                throws DevFailed
Asynchronous read_attribute.

Throws:
DevFailed

read_asynch

public void read_asynch(CallBack cb)
                 throws DevFailed
Asynchronous read_attribute using callback for reply.

Parameters:
cb - a CallBack object instance.
Throws:
DevFailed

read_reply

public DeviceAttribute[] read_reply(int id,
                                    int timeout)
                             throws DevFailed,
                                    AsynReplyNotArrived
Read Asynchronous read_attribute reply.

Parameters:
id - asynchronous call id (returned by read_attribute_asynch).
timeout - number of millisonds to wait reply before throw an excption.
Throws:
DevFailed
AsynReplyNotArrived

read_reply

public DeviceAttribute[] read_reply(int id)
                             throws DevFailed,
                                    AsynReplyNotArrived
Read Asynchronous read_attribute reply.

Parameters:
id - asynchronous call id (returned by read_attribute_asynch).
Throws:
DevFailed
AsynReplyNotArrived

write_asynch

public int write_asynch(DeviceAttribute attr)
                 throws DevFailed
Asynchronous write_attribute.

Parameters:
attr - Attribute value (name, writing value...)
Throws:
DevFailed

write_asynch

public int write_asynch(DeviceAttribute attr,
                        boolean forget)
                 throws DevFailed
Asynchronous write_attribute.

Parameters:
attr - Attribute value (name, writing value...)
forget - forget the response if true
Throws:
DevFailed

write_asynch

public void write_asynch(DeviceAttribute attr,
                         CallBack cb)
                  throws DevFailed
Asynchronous write_attribute using callback for reply.

Parameters:
attr - Attribute values (name, writing value...)
cb - a CallBack object instance.
Throws:
DevFailed

write_reply

public void write_reply(int id)
                 throws DevFailed,
                        AsynReplyNotArrived
check for Asynchronous write_attribute reply.

Parameters:
id - asynchronous call id (returned by read_attribute_asynch).
Throws:
DevFailed
AsynReplyNotArrived

write_reply

public void write_reply(int id,
                        int timeout)
                 throws DevFailed,
                        AsynReplyNotArrived
check for Asynchronous write_attribute reply.

Parameters:
id - asynchronous call id (returned by write_attribute_asynch).
timeout - number of millisonds to wait reply before throw an excption.
Throws:
DevFailed
AsynReplyNotArrived

subscribe_event

public int subscribe_event(int event,
                           CallBack callback,
                           java.lang.String[] filters)
                    throws DevFailed
Subscribe to an event.

Parameters:
event - event name.
callback - event callback.
Throws:
DevFailed

main

public static void main(java.lang.String[] args)
Just a main method to check API methods.


TANGO Java API
( TangORB-7.3.3.jar)