TANGO Database API

fr.esrf.TangoApi
Class Connection

java.lang.Object
  |
  +--fr.esrf.TangoApi.Connection
Direct Known Subclasses:
Database, DeviceProxy

public class Connection
extends java.lang.Object

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

Author:
verdier

Constructor Summary
Connection()
          Connection constructor.
Connection(java.lang.String devname)
          Connection constructor.
Connection(java.lang.String host, java.lang.String port)
          Connection constructor.
 
Method Summary
 DeviceData command_inout(java.lang.String command)
          Send a command to a device server.
 DeviceData command_inout(java.lang.String command, DeviceData argin)
          Send a command to a device server.
 fr.esrf.Tango.DevCmdInfo[] command_list_query()
          Execute a command_list_query command to a device server.
 java.lang.String get_name()
          return the device connected name.
 java.lang.String get_tango_host()
          return the name of connection (host:port)
 int get_timeout()
          return the timeout value for a device call.
 fr.esrf.Tango.DevInfo info()
          Execute a info command to a device server.
 long ping()
          Execute a ping command to a device server.
 fr.esrf.Tango.Device set_timeout(int millis)
          Change the timeout value for a device call.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Connection

public Connection()
           throws fr.esrf.Tango.DevFailed
Connection constructor. It makes a connection on database server.

Connection

public Connection(java.lang.String host,
                  java.lang.String port)
           throws fr.esrf.Tango.DevFailed
Connection constructor. It makes a connection on database server.
Parameters:
host - host where database is running.
port - port for database connection.

Connection

public Connection(java.lang.String devname)
Connection constructor. It imports the device.
Parameters:
devname - name of the device to be imported.
Method Detail

set_timeout

public fr.esrf.Tango.Device set_timeout(int millis)
                                 throws fr.esrf.Tango.DevFailed
Change the timeout value for a device call.
Parameters:
millis - New value of the timeout in milliseconds.
Throws:
DevFaild - if orb.create_policy throws an org.omg.CORBA.PolicyError exception.

get_timeout

public int get_timeout()
return the timeout value for a device call.
Returns:
the value of the timeout in milliseconds.

command_inout

public DeviceData command_inout(java.lang.String command,
                                DeviceData argin)
                         throws fr.esrf.Tango.DevFailed
Send a command to a device server.
Parameters:
command - Command name to send to the device.
data - argin management object.
Throws:
fr.esrf.Tango.DevFailed -  

command_inout

public DeviceData command_inout(java.lang.String command)
                         throws fr.esrf.Tango.DevFailed
Send a command to a device server.
Parameters:
device - Device instance to send the command.
Throws:
fr.esrf.Tango.DevFailed -  

ping

public long ping()
          throws fr.esrf.Tango.DevFailed
Execute a ping command to a device server.
Returns:
the elapsed time for ping command in milliseconds.

info

public fr.esrf.Tango.DevInfo info()
                           throws fr.esrf.Tango.DevFailed
Execute a info command to a device server.

command_list_query

public fr.esrf.Tango.DevCmdInfo[] command_list_query()
                                              throws fr.esrf.Tango.DevFailed
Execute a command_list_query command to a device server.

get_name

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

get_tango_host

public java.lang.String get_tango_host()
return the name of connection (host:port)

TANGO Database API