TANGO Java API
( TangORB-7.3.3.jar)

fr.esrf.TangoApi
Class DeviceProxy

java.lang.Object
  extended by fr.esrf.TangoApi.Connection
      extended by fr.esrf.TangoApi.DeviceProxy
All Implemented Interfaces:
ApiDefs

public class DeviceProxy
extends Connection
implements ApiDefs

Class Description: This class manage device connection for Tango objects. It is an api between user and IDL Device object.


Usage example:

Version:
$Revision: 1.18 $
Author:
verdier

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
DeviceProxy()
          Default DeviceProxy constructor.
DeviceProxy(DbDevImportInfo info)
          DeviceProxy constructor.
DeviceProxy(java.lang.String devname)
          DeviceProxy constructor.
DeviceProxy(java.lang.String devname, java.lang.String ior)
          TangoDevice constructor.
DeviceProxy(java.lang.String devname, java.lang.String host, java.lang.String port)
          TangoDevice constructor.
 
Method Summary
 void add_device(DbDevInfo devinfo)
          Add/update this device to the database
 void add_logging_target(java.lang.String target)
          Adds a new logging target to the device.
 void add_logging_target(java.lang.String target_type, java.lang.String target_name)
          Deprecated. use add_logging_target(String target).
 DeviceDataHistory[] attribute_history(java.lang.String attname)
          Return the full history for attribute polled.
 DeviceDataHistory[] attribute_history(java.lang.String attname, int nb)
          Return the history for attribute polled.
 DeviceDataHistory[] command_history(java.lang.String cmdname)
          Return the full history for command polled.
 DeviceDataHistory[] command_history(java.lang.String cmdname, int nb)
          Return the history for command polled.
 int command_inout_asynch(java.lang.String cmdname)
          Asynchronous command_inout.
 int command_inout_asynch(java.lang.String cmdname, boolean forget)
          Asynchronous command_inout.
 void command_inout_asynch(java.lang.String cmdname, CallBack cb)
          Asynchronous command_inout using callback for reply.
 int command_inout_asynch(java.lang.String cmdname, DeviceData data_in)
          Asynchronous command_inout.
 int command_inout_asynch(java.lang.String cmdname, DeviceData data_in, boolean forget)
          Asynchronous command_inout.
 void command_inout_asynch(java.lang.String cmdname, DeviceData argin, CallBack cb)
          Asynchronous command_inout using callback for reply.
 DeviceData command_inout_reply(int id)
          Read Asynchronous command_inout reply.
 DeviceData command_inout_reply(int id, int timeout)
          Read Asynchronous command_inout reply.
 CommandInfo command_query(java.lang.String cmdname)
          return the IDL device command_query for the specified command.
 void delete_attribute_property(DbAttribute attr)
          Delete a list of properties for this object.
 void delete_attribute_property(DbAttribute[] attr)
          Delete a list of properties for this object.
 void delete_attribute_property(java.lang.String attname, java.lang.String propname)
          Delete a property for this object.
 void delete_attribute_property(java.lang.String attname, java.lang.String[] propnames)
          Delete a list of properties for this object.
 void delete_attribute(java.lang.String attname)
          Delete an attribute for this object.
 void delete_device()
          Delete this device from the database
 void delete_property(DbDatum[] properties)
          Delete a list of properties for this device.
 void delete_property(java.lang.String propname)
          Delete a property for this device.
 void delete_property(java.lang.String[] propnames)
          Delete a list of properties for this device.
 java.lang.String[] dev_inform()
          Returns TACO device information.
 void export_device(DbDevExportInfo devinfo)
          Update the export info for this device in the database.
 DeviceProxy get_adm_dev()
           
 java.lang.String get_alias()
          Get alias for the device
 void get_asynch_replies()
          Fire callback methods for all asynchronous requests(cmd and attr) with already arrived replies.
 void get_asynch_replies(int timeout)
          Fire callback methods for all asynchronous requests(cmd and attr) with already arrived replies.
 AttributeInfo[] get_attribute_config()
          Deprecated. use get_attribute_info()
 AttributeInfo get_attribute_config(java.lang.String attname)
          Deprecated. use get_attribute_info(String attname)
 AttributeInfo[] get_attribute_config(java.lang.String[] attnames)
          Deprecated. use get_attribute_info(String[] attnames)
 AttributeInfoEx[] get_attribute_info_ex()
          Get all attributes info for the specified device.
 AttributeInfoEx get_attribute_info_ex(java.lang.String attname)
          Get the attribute info for the specified device.
 AttributeInfoEx[] get_attribute_info_ex(java.lang.String[] attnames)
          Get the extended attributes configuration for the specified device.
 AttributeInfo[] get_attribute_info()
          Get all attributes info for the specified device.
 AttributeInfo get_attribute_info(java.lang.String attname)
          Get the attribute info for the specified device.
 AttributeInfo[] get_attribute_info(java.lang.String[] attnames)
          Get the attributes configuration for the specified device.
 java.lang.String[] get_attribute_list()
          Query the device for attribute config and returns names only.
 int get_attribute_polling_period(java.lang.String attname)
          Returns the polling period (in ms) for specified attribute.
 DbAttribute get_attribute_property(java.lang.String attname)
          Query the database for a device attribute property for this device.
 DbAttribute[] get_attribute_property(java.lang.String[] attnames)
          Query the database for a list of device attribute properties for this device.
 java.lang.String[] get_class_inheritance()
          Returns the class inheritance for the device [0] Device Class [1] Class from the device class is inherited.
 java.lang.String get_class()
          Returns the class for the device
 int get_command_polling_period(DeviceProxy deviceProxy, java.lang.String cmdname)
          Returns the polling period (in ms) for specified command.
 Database get_db_obj()
           
 int get_event_queue_size()
          returns the number of EventData in queue.
 int get_event_queue_size(int event_type)
          returns the number of EventData in queue for specifed type.
 EventData[] get_events()
          returns all EventData in queue.
 EventData[] get_events(int event_type)
          returns all event in queue for specified type.
 DbEventImportInfo get_evt_import_info()
           
 DeviceInfo get_info()
          Query the database for the info of this device.
 long get_last_event_date()
          returns number of milliseconds since EPOCH for the last EventData in queue.
 int get_logging_level()
          get logging level from the device.
 java.lang.String[] get_logging_target()
          get logging target from the device.
 EventData get_next_event()
          returns next EventData in queue.
 EventData get_next_event(int event_type)
          returns next event in queue for specified type.
 java.lang.String[] get_property_list(java.lang.String wildcard)
          Query the database for a list of device properties for the pecified object.
 DbDatum[] get_property(DbDatum[] properties)
          Query the database for a list of device properties for this device.
 DbDatum get_property(java.lang.String propname)
          Query the database for a device property for this device.
 DbDatum[] get_property(java.lang.String[] propnames)
          Query the database for a list of device properties for this device.
 int get_rpc_protocol()
           
 DeviceProxy getAdm_dev()
           
 java.lang.String[] getAttnames_array()
           
 DbDevice getDb_dev()
           
 IDeviceProxyDAO getDeviceProxy()
           
 EventQueue getEventQueue()
           
 java.lang.String getFull_class_name()
           
 LockerInfo getLockerInfo()
          Returns the device lock info
 java.lang.String getLockerStatus()
          Returns the device lock status
 DbDevImportInfo import_device()
          Query the database for the export info of this device.
static boolean isCheck_idl()
           
 boolean isLocked()
          Returns true if the device is locked
 boolean isLockedByMe()
          Returns true if the device is locked by this process
 void lock()
          Lock the device
 void lock(int validity)
          Lock the device
static void main(java.lang.String[] args)
          Just a main method to check API methods.
 java.lang.String name()
          return the device name.
 int pending_asynch_call(int reply_model)
          return the still pending asynchronous call for a reply model.
 void poll_attribute(java.lang.String attname, int period)
          Add a attribute to be polled for the device.
 void poll_command(java.lang.String cmdname, int period)
          Add a command to be polled for the device.
 java.lang.String[] polling_status()
          Returns the polling status for the device.
 void put_alias(java.lang.String aliasname)
          Set an alias for a device name
 void put_attribute_property(DbAttribute attr)
          Insert or update an attribute properties for this device.
 void put_attribute_property(DbAttribute[] attr)
          Insert or update a list of attribute properties for this device.
 void put_property(DbDatum prop)
          Insert or update a property for this device The property name and its value are specified by the DbDatum
 void put_property(DbDatum[] properties)
          Insert or update a list of properties for this device The property names and their values are specified by the DbDatum array.
 int read_attribute_asynch(java.lang.String attname)
          Asynchronous read_attribute.
 int read_attribute_asynch(java.lang.String[] attnames)
          Asynchronous read_attribute.
 void read_attribute_asynch(java.lang.String[] attnames, CallBack cb)
          Asynchronous read_attribute using callback for reply.
 void read_attribute_asynch(java.lang.String attname, CallBack cb)
          Asynchronous read_attribute using callback for reply.
 DeviceAttribute[] read_attribute_reply(int id)
          Read Asynchronous read_attribute reply.
 DeviceAttribute[] read_attribute_reply(int id, int timeout)
          Read Asynchronous read_attribute reply.
 AttributeValue read_attribute_value(java.lang.String attname)
          return directly AttributeValue object without creation of DeviceAttribute object
 DeviceAttribute read_attribute(java.lang.String attname)
          Read the attribute value for the specified device.
 DeviceAttribute[] read_attribute(java.lang.String[] attnames)
          Read the attribute values for the specified device.
 void remove_logging_target(java.lang.String target_type, java.lang.String target_name)
          Removes a new logging target to the device.
 void set_attribute_config(AttributeInfo[] attr)
          Deprecated. use set_attribute_info(AttributeInfo[] attr)
 void set_attribute_info(AttributeInfo[] attr)
          Update the attributes info for the specified device.
 void set_attribute_info(AttributeInfoEx[] attr)
          Update the attributes extended info for the specified device.
 void set_evt_import_info(DbEventImportInfo info)
           
 void set_logging_level(int level)
          Set logging level from the device.
 void set_rpc_protocol(int mode)
          Execute the dev_rpc_protocol TACO command to change RPC protocol mode.
 void setAdm_dev(DeviceProxy adm_dev)
           
 void setAttnames_array(java.lang.String[] attnames_array)
           
 void setDb_dev(DbDevice db_dev)
           
 void setDeviceProxy(IDeviceProxyDAO deviceProxy)
           
 void setEventQueue(EventQueue eq)
           
 void setFull_class_name(java.lang.String full_class_name)
           
 DevState state()
          return the device state read from CORBA attribute.
 DevState state(boolean src)
          return the device state.
 java.lang.String status()
          return the device status read from CORBA attribute.
 java.lang.String status(boolean src)
          return the device status.
 void stop_poll_attribute(java.lang.String attname)
          Remove attribute of polled object list
 void stop_poll_command(java.lang.String cmdname)
          Remove command of polled object list
 int subscribe_event(java.lang.String attr_name, int event, CallBack callback, java.lang.String[] filters)
          Subscribe to an event.
 int subscribe_event(java.lang.String attr_name, int event, CallBack callback, java.lang.String[] filters, boolean stateless)
          Subscribe to an event.
 int subscribe_event(java.lang.String attr_name, int event, int max_size, java.lang.String[] filters, boolean stateless)
          Subscribe to event to be stored in an event queue.
 void unexport_device()
          Unexport the device in database.
 int unlock()
          Unlock the device
 void unsubscribe_event(int event_id)
          Unsubscribe to an event.
 boolean use_db()
           
 int write_attribute_asynch(DeviceAttribute attr)
          Asynchronous write_attribute.
 int write_attribute_asynch(DeviceAttribute[] attribs)
          Asynchronous write_attribute.
 int write_attribute_asynch(DeviceAttribute[] attribs, boolean forget)
          Asynchronous write_attribute.
 void write_attribute_asynch(DeviceAttribute[] attribs, CallBack cb)
          Asynchronous write_attribute using callback for reply.
 int write_attribute_asynch(DeviceAttribute attr, boolean forget)
          Asynchronous write_attribute.
 void write_attribute_asynch(DeviceAttribute attr, CallBack cb)
          Asynchronous write_attribute using callback for reply.
 void write_attribute_reply(int id)
          check for Asynchronous write_attribute reply.
 void write_attribute_reply(int id, int timeout)
          check for Asynchronous write_attribute reply.
 void write_attribute(DeviceAttribute devattr)
          Write the attribute value for the specified device.
 void write_attribute(DeviceAttribute[] devattr)
          Write the attribute values for the specified device.
 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.
 
Methods inherited from class fr.esrf.TangoApi.Connection
adm_name, black_box, build_connection, checkIfTaco, checkIfTango, command_inout, command_inout, command_list_query, description, dev_import, equals, get_class_name, get_device, get_host_name, get_idl_version, get_ior, get_name, get_server_name, get_source, get_tango_host, get_timeout_millis, get_timeout, get_transparency_reconnection, getAccessControl, getDev_timeout, getIConnection, getObj, getPrev_failed_t0, getPrev_failed, info_3, info, is_taco, isAllowedCommand, isAlready_connected, isDevice_is_dbase, isPrev_failed, ping, set_source, set_timeout_millis, set_transparency_reconnection, setAccessControl, setAlready_connected, setDev_timeout, setDevice_is_dbase, setIConnection, setObj, setPrev_failed_t0, setPrev_failed, throw_dev_failed
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceProxy

public DeviceProxy()
            throws DevFailed
Default DeviceProxy constructor. It will do nothing

Throws:
DevFailed

DeviceProxy

public DeviceProxy(DbDevImportInfo info)
            throws DevFailed
DeviceProxy constructor. It will import the device.

Parameters:
info - exported info of the device to be imported.
Throws:
DevFailed

DeviceProxy

public DeviceProxy(java.lang.String devname)
            throws DevFailed
DeviceProxy constructor. It will import the device.

Parameters:
devname - name of the device to be imported.
Throws:
DevFailed

DeviceProxy

public DeviceProxy(java.lang.String devname,
                   java.lang.String ior)
            throws DevFailed
TangoDevice constructor. It will import the device.

Parameters:
devname - name of the device to be imported.
ior - ior string used to import device
Throws:
DevFailed

DeviceProxy

public DeviceProxy(java.lang.String devname,
                   java.lang.String host,
                   java.lang.String port)
            throws DevFailed
TangoDevice constructor. It will import the device.

Parameters:
devname - name of the device to be imported.
host - host where database is running.
port - port for database connection.
Throws:
DevFailed
Method Detail

use_db

public boolean use_db()

get_db_obj

public Database get_db_obj()
                    throws DevFailed
Throws:
DevFailed

name

public java.lang.String name()
return the device name.


status

public java.lang.String status()
                        throws DevFailed
return the device status read from CORBA attribute.

Throws:
DevFailed

status

public java.lang.String status(boolean src)
                        throws DevFailed
return the device status.

Parameters:
src - Source to read status. It could be ApiDefs.FROM_CMD to read it from a command_inout or ApiDefs.FROM_ATTR to read it from CORBA attribute.
Throws:
DevFailed

state

public DevState state()
               throws DevFailed
return the device state read from CORBA attribute.

Throws:
DevFailed

state

public DevState state(boolean src)
               throws DevFailed
return the device state.

Parameters:
src - Source to read state. It could be ApiDefs.FROM_CMD to read it from a command_inout or ApiDefs.FROM_ATTR to read it from CORBA attribute.
Throws:
DevFailed

command_query

public CommandInfo command_query(java.lang.String cmdname)
                          throws DevFailed
return the IDL device command_query for the specified command.

Parameters:
cmdname - command name to be used for the command_query
Returns:
the command information..
Throws:
DevFailed

get_class

public java.lang.String get_class()
                           throws DevFailed
Returns the class for the device

Throws:
DevFailed

get_class_inheritance

public java.lang.String[] get_class_inheritance()
                                         throws DevFailed
Returns the class inheritance for the device

Throws:
DevFailed

put_alias

public void put_alias(java.lang.String aliasname)
               throws DevFailed
Set an alias for a device name

Parameters:
aliasname - alias name.
Throws:
DevFailed

get_alias

public java.lang.String get_alias()
                           throws DevFailed
Get alias for the device

Returns:
the alias name if found.
Throws:
DevFailed

get_info

public DeviceInfo get_info()
                    throws DevFailed
Query the database for the info of this device.

Returns:
the information in a DeviceInfo.
Throws:
DevFailed

import_device

public DbDevImportInfo import_device()
                              throws DevFailed
Query the database for the export info of this device.

Returns:
the information in a DbDevImportInfo.
Throws:
DevFailed

export_device

public void export_device(DbDevExportInfo devinfo)
                   throws DevFailed
Update the export info for this device in the database.

Parameters:
devinfo - Device information to export.
Throws:
DevFailed

unexport_device

public void unexport_device()
                     throws DevFailed
Unexport the device in database.

Throws:
DevFailed

add_device

public void add_device(DbDevInfo devinfo)
                throws DevFailed
Add/update this device to the database

Parameters:
devinfo - The device name, class and server specified in object.
Throws:
DevFailed

delete_device

public void delete_device()
                   throws DevFailed
Delete this device from the database

Throws:
DevFailed

get_property_list

public java.lang.String[] get_property_list(java.lang.String wildcard)
                                     throws DevFailed
Query the database for a list of device properties for the pecified object.

Parameters:
wildcard - propertie's wildcard (* matches any charactere).
Returns:
properties in DbDatum objects.
Throws:
DevFailed

get_property

public DbDatum[] get_property(java.lang.String[] propnames)
                       throws DevFailed
Query the database for a list of device properties for this device.

Parameters:
propnames - list of property names.
Returns:
properties in DbDatum objects.
Throws:
DevFailed

get_property

public DbDatum get_property(java.lang.String propname)
                     throws DevFailed
Query the database for a device property for this device.

Parameters:
propname - property name.
Returns:
property in DbDatum objects.
Throws:
DevFailed

get_property

public DbDatum[] get_property(DbDatum[] properties)
                       throws DevFailed
Query the database for a list of device properties for this device. The property names are specified by the DbDatum array objects.

Parameters:
properties - list of property DbDatum objects.
Returns:
properties in DbDatum objects.
Throws:
DevFailed

put_property

public void put_property(DbDatum prop)
                  throws DevFailed
Insert or update a property for this device The property name and its value are specified by the DbDatum

Parameters:
prop - Property name and value
Throws:
DevFailed

put_property

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

Parameters:
properties - Properties names and values array.
Throws:
DevFailed

delete_property

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

Parameters:
propnames - Property names.
Throws:
DevFailed

delete_property

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

Parameters:
propname - Property name.
Throws:
DevFailed

delete_property

public void delete_property(DbDatum[] properties)
                     throws DevFailed
Delete a list of properties for this device.

Parameters:
properties - Property DbDatum objects.
Throws:
DevFailed

get_attribute_list

public java.lang.String[] get_attribute_list()
                                      throws DevFailed
Query the device for attribute config and returns names only.

Returns:
attributes list for specified device
Throws:
DevFailed

put_attribute_property

public void put_attribute_property(DbAttribute[] attr)
                            throws DevFailed
Insert or update a list of attribute properties for this device. The property names and their values are specified by the DbAttribute array.

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

put_attribute_property

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

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

delete_attribute_property

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

Parameters:
attname - attribute name.
propnames - Property names.
Throws:
DevFailed

delete_attribute_property

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

Parameters:
attname - attribute name.
propname - Property name.
Throws:
DevFailed

delete_attribute_property

public void delete_attribute_property(DbAttribute attr)
                               throws DevFailed
Delete a list of properties for this object.

Parameters:
attr - DbAttribute object for specified attribute.
Throws:
DevFailed

delete_attribute_property

public void delete_attribute_property(DbAttribute[] attr)
                               throws DevFailed
Delete a list of properties for this object.

Parameters:
attr - DbAttribute array object for specified attribute.
Throws:
DevFailed

get_attribute_property

public DbAttribute[] get_attribute_property(java.lang.String[] attnames)
                                     throws DevFailed
Query the database for a list of device attribute properties for this device.

Parameters:
attnames - list of attribute names.
Returns:
properties in DbAttribute objects array.
Throws:
DevFailed

get_attribute_property

public DbAttribute get_attribute_property(java.lang.String attname)
                                   throws DevFailed
Query the database for a device attribute property for this device.

Parameters:
attname - attribute name.
Returns:
property in DbAttribute object.
Throws:
DevFailed

delete_attribute

public void delete_attribute(java.lang.String attname)
                      throws DevFailed
Delete an attribute for this object.

Parameters:
attname - attribute name.
Throws:
DevFailed

get_attribute_info

public AttributeInfo[] get_attribute_info(java.lang.String[] attnames)
                                   throws DevFailed
Get the attributes configuration for the specified device.

Parameters:
attnames - attribute names to request config.
Returns:
the attributes configuration.
Throws:
DevFailed

get_attribute_info_ex

public AttributeInfoEx[] get_attribute_info_ex(java.lang.String[] attnames)
                                        throws DevFailed
Get the extended attributes configuration for the specified device.

Parameters:
attnames - attribute names to request config.
Returns:
the attributes configuration.
Throws:
DevFailed

get_attribute_config

public AttributeInfo[] get_attribute_config(java.lang.String[] attnames)
                                     throws DevFailed
Deprecated. use get_attribute_info(String[] attnames)

Get the attributes configuration for the specified device.

Parameters:
attnames - attribute names to request config.
Returns:
the attributes configuration.
Throws:
DevFailed

get_attribute_info

public AttributeInfo get_attribute_info(java.lang.String attname)
                                 throws DevFailed
Get the attribute info for the specified device.

Parameters:
attname - attribute name to request config.
Returns:
the attribute info.
Throws:
DevFailed

get_attribute_info_ex

public AttributeInfoEx get_attribute_info_ex(java.lang.String attname)
                                      throws DevFailed
Get the attribute info for the specified device.

Parameters:
attname - attribute name to request config.
Returns:
the attribute info.
Throws:
DevFailed

get_attribute_config

public AttributeInfo get_attribute_config(java.lang.String attname)
                                   throws DevFailed
Deprecated. use get_attribute_info(String attname)

Get the attribute configuration for the specified device.

Parameters:
attname - attribute name to request config.
Returns:
the attribute configuration.
Throws:
DevFailed

get_attribute_info

public AttributeInfo[] get_attribute_info()
                                   throws DevFailed
Get all attributes info for the specified device.

Returns:
all attributes info.
Throws:
DevFailed

get_attribute_info_ex

public AttributeInfoEx[] get_attribute_info_ex()
                                        throws DevFailed
Get all attributes info for the specified device.

Returns:
all attributes info.
Throws:
DevFailed

get_attribute_config

public AttributeInfo[] get_attribute_config()
                                     throws DevFailed
Deprecated. use get_attribute_info()

Get all attributes configuration for the specified device.

Returns:
all attributes configuration.
Throws:
DevFailed

set_attribute_info

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

Parameters:
attr - the attributes info.
Throws:
DevFailed

set_attribute_info

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

Parameters:
attr - the attributes info.
Throws:
DevFailed

set_attribute_config

public void set_attribute_config(AttributeInfo[] attr)
                          throws DevFailed
Deprecated. use set_attribute_info(AttributeInfo[] attr)

Update the attributes configuration for the specified device.

Parameters:
attr - the attributes configuration.
Throws:
DevFailed

read_attribute

public DeviceAttribute read_attribute(java.lang.String attname)
                               throws DevFailed
Read the attribute value for the specified device.

Parameters:
attname - attribute name to request value.
Returns:
the attribute value.
Throws:
DevFailed

read_attribute_value

public AttributeValue read_attribute_value(java.lang.String attname)
                                    throws DevFailed
return directly AttributeValue object without creation of DeviceAttribute object

Throws:
DevFailed

read_attribute

public DeviceAttribute[] read_attribute(java.lang.String[] attnames)
                                 throws DevFailed
Read the attribute values for the specified device.

Parameters:
attnames - attribute names to request values.
Returns:
the attribute values.
Throws:
DevFailed

write_attribute

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

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

write_attribute

public void write_attribute(DeviceAttribute[] devattr)
                     throws DevFailed
Write 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

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

get_adm_dev

public DeviceProxy get_adm_dev()
                        throws DevFailed
Throws:
DevFailed

poll_command

public void poll_command(java.lang.String cmdname,
                         int period)
                  throws DevFailed
Add a command to be polled for the device. If already polled, update its polling period.

Parameters:
cmdname - command name to be polled.
period - polling period.
Throws:
DevFailed

poll_attribute

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

Parameters:
attname - attribute name to be polled.
period - polling period.
Throws:
DevFailed

stop_poll_command

public void stop_poll_command(java.lang.String cmdname)
                       throws DevFailed
Remove command of polled object list

Parameters:
cmdname - command name to be removed of polled object list.
Throws:
DevFailed

stop_poll_attribute

public void stop_poll_attribute(java.lang.String attname)
                         throws DevFailed
Remove attribute of polled object list

Parameters:
attname - attribute name to be removed of polled object list.
Throws:
DevFailed

polling_status

public java.lang.String[] polling_status()
                                  throws DevFailed
Returns the polling status for the device.

Throws:
DevFailed

command_history

public DeviceDataHistory[] command_history(java.lang.String cmdname,
                                           int nb)
                                    throws DevFailed
Return the history for command polled.

Parameters:
cmdname - command name to read polled history.
nb - nb data to read.
Throws:
DevFailed

attribute_history

public DeviceDataHistory[] attribute_history(java.lang.String attname,
                                             int nb)
                                      throws DevFailed
Return the history for attribute polled.

Parameters:
attname - attribute name to read polled history.
nb - nb data to read.
Throws:
DevFailed

command_history

public DeviceDataHistory[] command_history(java.lang.String cmdname)
                                    throws DevFailed
Return the full history for command polled.

Parameters:
cmdname - command name to read polled history.
Throws:
DevFailed

attribute_history

public DeviceDataHistory[] attribute_history(java.lang.String attname)
                                      throws DevFailed
Return the full history for attribute polled.

Parameters:
attname - attribute name to read polled history.
Throws:
DevFailed

get_attribute_polling_period

public int get_attribute_polling_period(java.lang.String attname)
                                 throws DevFailed
Returns the polling period (in ms) for specified attribute.

Parameters:
attname - specified attribute name.
Throws:
DevFailed

get_command_polling_period

public int get_command_polling_period(DeviceProxy deviceProxy,
                                      java.lang.String cmdname)
                               throws DevFailed
Returns the polling period (in ms) for specified command.

Parameters:
cmdname - specified attribute name.
Throws:
DevFailed

command_inout_asynch

public int command_inout_asynch(java.lang.String cmdname,
                                DeviceData data_in)
                         throws DevFailed
Asynchronous command_inout.

Parameters:
cmdname - command name.
data_in - input argument command.
Throws:
DevFailed

command_inout_asynch

public int command_inout_asynch(java.lang.String cmdname)
                         throws DevFailed
Asynchronous command_inout.

Parameters:
cmdname - command name.
Throws:
DevFailed

command_inout_asynch

public int command_inout_asynch(java.lang.String cmdname,
                                boolean forget)
                         throws DevFailed
Asynchronous command_inout.

Parameters:
cmdname - command name.
forget - forget the response if true
Throws:
DevFailed

command_inout_asynch

public int command_inout_asynch(java.lang.String cmdname,
                                DeviceData data_in,
                                boolean forget)
                         throws DevFailed
Asynchronous command_inout.

Parameters:
cmdname - command name.
data_in - input argument command.
forget - forget the response if true
Throws:
DevFailed

command_inout_asynch

public void command_inout_asynch(java.lang.String cmdname,
                                 DeviceData argin,
                                 CallBack cb)
                          throws DevFailed
Asynchronous command_inout using callback for reply.

Parameters:
cmdname - Command name.
argin - Input argument command.
cb - a CallBack object instance.
Throws:
DevFailed

command_inout_asynch

public void command_inout_asynch(java.lang.String cmdname,
                                 CallBack cb)
                          throws DevFailed
Asynchronous command_inout using callback for reply.

Parameters:
cmdname - Command name.
cb - a CallBack object instance.
Throws:
DevFailed

command_inout_reply

public DeviceData command_inout_reply(int id,
                                      int timeout)
                               throws DevFailed,
                                      AsynReplyNotArrived
Read Asynchronous command_inout reply.

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

command_inout_reply

public DeviceData command_inout_reply(int id)
                               throws DevFailed,
                                      AsynReplyNotArrived
Read Asynchronous command_inout reply.

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

read_attribute_asynch

public int read_attribute_asynch(java.lang.String attname)
                          throws DevFailed
Asynchronous read_attribute.

Parameters:
attname - Attribute name.
Throws:
DevFailed

read_attribute_asynch

public int read_attribute_asynch(java.lang.String[] attnames)
                          throws DevFailed
Asynchronous read_attribute.

Parameters:
attnames - Attribute names.
Throws:
DevFailed

read_attribute_reply

public DeviceAttribute[] read_attribute_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_attribute_reply

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

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

read_attribute_asynch

public void read_attribute_asynch(java.lang.String attname,
                                  CallBack cb)
                           throws DevFailed
Asynchronous read_attribute using callback for reply.

Parameters:
attname - attribute name.
cb - a CallBack object instance.
Throws:
DevFailed

read_attribute_asynch

public void read_attribute_asynch(java.lang.String[] attnames,
                                  CallBack cb)
                           throws DevFailed
Asynchronous read_attribute using callback for reply.

Parameters:
attnames - attribute names.
cb - a CallBack object instance.
Throws:
DevFailed

write_attribute_asynch

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

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

write_attribute_asynch

public int write_attribute_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_attribute_asynch

public int write_attribute_asynch(DeviceAttribute[] attribs)
                           throws DevFailed
Asynchronous write_attribute.

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

write_attribute_asynch

public int write_attribute_asynch(DeviceAttribute[] attribs,
                                  boolean forget)
                           throws DevFailed
Asynchronous write_attribute.

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

write_attribute_reply

public void write_attribute_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_attribute_reply

public void write_attribute_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

write_attribute_asynch

public void write_attribute_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_attribute_asynch

public void write_attribute_asynch(DeviceAttribute[] attribs,
                                   CallBack cb)
                            throws DevFailed
Asynchronous write_attribute using callback for reply.

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

pending_asynch_call

public int pending_asynch_call(int reply_model)
return the still pending asynchronous call for a reply model.

Parameters:
reply_model - ApiDefs.ALL_ASYNCH, POLLING or CALLBACK.

get_asynch_replies

public void get_asynch_replies()
Fire callback methods for all asynchronous requests(cmd and attr) with already arrived replies.


get_asynch_replies

public void get_asynch_replies(int timeout)
Fire callback methods for all asynchronous requests(cmd and attr) with already arrived replies.


add_logging_target

public void add_logging_target(java.lang.String target_type,
                               java.lang.String target_name)
                        throws DevFailed
Deprecated. use add_logging_target(String target).

Adds a new logging target to the device.

Throws:
DevFailed

add_logging_target

public void add_logging_target(java.lang.String target)
                        throws DevFailed
Adds a new logging target to the device.

Parameters:
target - The target for logging (e.g. file::/tmp/logging_device).
Throws:
DevFailed

remove_logging_target

public void remove_logging_target(java.lang.String target_type,
                                  java.lang.String target_name)
                           throws DevFailed
Removes a new logging target to the device.

Throws:
DevFailed

get_logging_target

public java.lang.String[] get_logging_target()
                                      throws DevFailed
get logging target from the device.

Throws:
DevFailed

get_logging_level

public int get_logging_level()
                      throws DevFailed
get logging level from the device.

Returns:
device's logging level: (ApiDefs.LOGGING_OFF, ApiDefs.LOGGING_FATAL, ApiDefs.LOGGING_ERROR, ApiDefs.LOGGING_INFO, ApiDefs.LOGGING_DEBUG)
Throws:
DevFailed

set_logging_level

public void set_logging_level(int level)
                       throws DevFailed
Set logging level from the device.

Parameters:
level - device's logging level: (ApiDefs.LOGGING_OFF, ApiDefs.LOGGING_FATAL, ApiDefs.LOGGING_ERROR, ApiDefs.LOGGING_INFO, ApiDefs.LOGGING_DEBUG)
Throws:
DevFailed

lock

public void lock()
          throws DevFailed
Lock the device

Throws:
DevFailed

lock

public void lock(int validity)
          throws DevFailed
Lock the device

Parameters:
validity - Lock validity (in seconds)
Throws:
DevFailed

unlock

public int unlock()
           throws DevFailed
Unlock the device

Returns:
the device lock counter
Throws:
DevFailed

isLocked

public boolean isLocked()
                 throws DevFailed
Returns true if the device is locked

Throws:
DevFailed

isLockedByMe

public boolean isLockedByMe()
                     throws DevFailed
Returns true if the device is locked by this process

Throws:
DevFailed

getLockerStatus

public java.lang.String getLockerStatus()
                                 throws DevFailed
Returns the device lock status

Throws:
DevFailed

getLockerInfo

public LockerInfo getLockerInfo()
                         throws DevFailed
Returns the device lock info

Throws:
DevFailed

dev_inform

public java.lang.String[] dev_inform()
                              throws DevFailed
Returns TACO device information.

Returns:
TACO device information as String array.
  • Device name.
  • Class name
  • Device type
  • Device server name
  • Host name
    Throws:
    DevFailed

  • set_rpc_protocol

    public void set_rpc_protocol(int mode)
                          throws DevFailed
    Execute the dev_rpc_protocol TACO command to change RPC protocol mode.

    Parameters:
    mode - RPC protocol mode to be seted (TangoApi.TacoDevice.D_TCP or TangoApi.TacoDevice.D_UDP).
    Throws:
    DevFailed

    get_rpc_protocol

    public int get_rpc_protocol()
                         throws DevFailed
    Returns:
    mode RPC protocol mode used
    Throws:
    DevFailed

    main

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


    subscribe_event

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

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

    subscribe_event

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

    Parameters:
    attr_name - attribute name.
    event - event name.
    callback - event callback.
    stateless - If true, do not throw exception if connection failed.
    Throws:
    DevFailed

    subscribe_event

    public int subscribe_event(java.lang.String attr_name,
                               int event,
                               int max_size,
                               java.lang.String[] filters,
                               boolean stateless)
                        throws DevFailed
    Subscribe to event to be stored in an event queue.

    Parameters:
    attr_name - attribute name.
    event - event name.
    max_size - event queue maximum size.
    stateless - If true, do not throw exception if connection failed.
    Throws:
    DevFailed

    setEventQueue

    public void setEventQueue(EventQueue eq)

    getEventQueue

    public EventQueue getEventQueue()

    get_event_queue_size

    public int get_event_queue_size()
    returns the number of EventData in queue.


    get_event_queue_size

    public int get_event_queue_size(int event_type)
    returns the number of EventData in queue for specifed type.

    Parameters:
    event_type - Specified event type.

    get_next_event

    public EventData get_next_event()
                             throws DevFailed
    returns next EventData in queue.

    Throws:
    DevFailed

    get_next_event

    public EventData get_next_event(int event_type)
                             throws DevFailed
    returns next event in queue for specified type.

    Parameters:
    event_type - Specified event type.
    Throws:
    DevFailed

    get_last_event_date

    public long get_last_event_date()
                             throws DevFailed
    returns number of milliseconds since EPOCH for the last EventData in queue.

    Throws:
    DevFailed

    get_events

    public EventData[] get_events()
    returns all EventData in queue.


    get_events

    public EventData[] get_events(int event_type)
    returns all event in queue for specified type.

    Parameters:
    event_type - Specified event type.

    unsubscribe_event

    public void unsubscribe_event(int event_id)
                           throws DevFailed
    Unsubscribe to an event.

    Parameters:
    event_id - event identifier.
    Throws:
    DevFailed

    getDeviceProxy

    public IDeviceProxyDAO getDeviceProxy()

    setDeviceProxy

    public void setDeviceProxy(IDeviceProxyDAO deviceProxy)

    getAdm_dev

    public DeviceProxy getAdm_dev()

    setAdm_dev

    public void setAdm_dev(DeviceProxy adm_dev)

    getAttnames_array

    public java.lang.String[] getAttnames_array()

    setAttnames_array

    public void setAttnames_array(java.lang.String[] attnames_array)

    getDb_dev

    public DbDevice getDb_dev()

    setDb_dev

    public void setDb_dev(DbDevice db_dev)

    getFull_class_name

    public java.lang.String getFull_class_name()

    setFull_class_name

    public void setFull_class_name(java.lang.String full_class_name)

    isCheck_idl

    public static boolean isCheck_idl()

    get_evt_import_info

    public DbEventImportInfo get_evt_import_info()

    set_evt_import_info

    public void set_evt_import_info(DbEventImportInfo info)

    TANGO Java API
    ( TangORB-7.3.3.jar)