TANGO Java API
( TangORB-7.3.3.jar)

fr.esrf.TangoApi
Class Connection

java.lang.Object
  extended by fr.esrf.TangoApi.Connection
All Implemented Interfaces:
ApiDefs
Direct Known Subclasses:
Database, DeviceProxy

public class Connection
extends java.lang.Object
implements ApiDefs

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

Version:
$Revision: 1.16 $
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
Connection()
          Connection constructor.
Connection(DbDevImportInfo info)
          Connection constructor.
Connection(java.lang.String devname)
          Connection constructor.
Connection(java.lang.String devname, boolean check_access)
          Connection constructor.
Connection(java.lang.String host, java.lang.String port)
          Connection constructor.
Connection(java.lang.String host, java.lang.String port, boolean auto_reconnect)
          Connection constructor.
Connection(java.lang.String devname, java.lang.String param, int src)
          Connection constructor.
Connection(java.lang.String devname, java.lang.String host, java.lang.String port)
          Connection constructor.
 
Method Summary
 java.lang.String adm_name()
          return the administartion device name.
 java.lang.String[] black_box(int length)
          Execute a info command to a device server.
 void build_connection()
           
 void checkIfTaco(java.lang.String cmdname)
          if not a TACO command then throw a DevFailed Exception.
 void checkIfTango(java.lang.String cmdname)
          if not a TACO command then throw a DevFailed Exception.
 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.
 CommandInfo[] command_list_query()
          Execute a command_list_query command to a device server.
 java.lang.String description()
          return the device connected dexcription.
 void dev_import()
          Really build the device connection.
 boolean equals(Connection connection)
          Returns true if TANGO_HOST and device name of this obejct is identical the specified connection.
 java.lang.String get_class_name()
          return the device connected class name.
 Device get_device()
           
 java.lang.String get_host_name()
          return the device connected host name.
 int get_idl_version()
          Returns the IDL version supported
 java.lang.String get_ior()
           
 java.lang.String get_name()
          return the device connected name.
 java.lang.String get_server_name()
          return the device connected server name.
 DevSource get_source()
          returns the device data source
 java.lang.String get_tango_host()
          return the name of connection (host:port)
 int get_timeout_millis()
          return the timeout value for a device call.
 int get_timeout()
          Deprecated. use get_timeout_millis() instead
 boolean get_transparency_reconnection()
          return the value of transparent_reconnection
 int getAccessControl()
           
 int getDev_timeout()
           
 IConnectionDAO getIConnection()
           
 org.omg.CORBA.Object getObj()
           
 long getPrev_failed_t0()
           
 DevFailed getPrev_failed()
           
 DevInfo_3 info_3()
          Execute a info command to a device server.
 DevInfo info()
          Execute a info command to a device server.
 boolean is_taco()
          return true if device is a taco device
 boolean isAllowedCommand(java.lang.String cmd)
           
 boolean isAlready_connected()
           
 boolean isDevice_is_dbase()
           
 boolean isPrev_failed()
          Return true if prev_failed is not equal to true
 long ping()
          Execute a ping command to a device server.
 void set_source(DevSource new_src)
          Set the device data source
 void set_timeout_millis(int millis)
          Change the timeout value for a device call.
 void set_transparency_reconnection(boolean val)
          set the value of transparent_reconnection
 void setAccessControl(int access)
           
 void setAlready_connected(boolean already_connected)
           
 void setDev_timeout(int dev_timeout)
           
 void setDevice_is_dbase(boolean device_is_dbase)
           
 void setIConnection(IConnectionDAO connection)
           
 void setObj(org.omg.CORBA.Object obj)
           
 void setPrev_failed_t0(long prev_failed_t0)
           
 void setPrev_failed(DevFailed prev_failed)
           
 void throw_dev_failed(java.lang.Exception e, java.lang.String command, boolean from_inout_cmd)
          Build reason and origin of the exception And throw it into a DevFailed exception
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Connection

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

Throws:
DevFailed

Connection

public Connection(java.lang.String host,
                  java.lang.String port)
           throws DevFailed
Connection constructor. It makes a connection on database server.

Parameters:
host - host where database is running.
port - port for database connection.
Throws:
DevFailed

Connection

public Connection(java.lang.String host,
                  java.lang.String port,
                  boolean auto_reconnect)
           throws DevFailed
Connection constructor. It makes a connection on database server.

Parameters:
host - host where database is running.
port - port for database connection.
auto_reconnect - do not reconnect if false.
Throws:
DevFailed

Connection

public Connection(java.lang.String devname)
           throws DevFailed
Connection constructor. It imports the device.

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

Connection

public Connection(DbDevImportInfo info)
           throws DevFailed
Connection constructor. It imports the device.

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

Connection

public Connection(java.lang.String devname,
                  boolean check_access)
           throws DevFailed
Connection constructor. It imports the device. And set check_access.

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

Connection

public Connection(java.lang.String devname,
                  java.lang.String param,
                  int src)
           throws DevFailed
Connection constructor. It imports the device.

Parameters:
devname - name of the device to be imported.
param - String parameter to import device.
src - Source to import device (ior, dbase...)
Throws:
DevFailed

Connection

public Connection(java.lang.String devname,
                  java.lang.String host,
                  java.lang.String port)
           throws DevFailed
Connection constructor. It imports 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

get_device

public Device get_device()

equals

public boolean equals(Connection connection)
Returns true if TANGO_HOST and device name of this obejct is identical the specified connection.

Parameters:
connection - The specified connection to compare.

build_connection

public void build_connection()
                      throws DevFailed
Throws:
DevFailed

get_ior

public java.lang.String get_ior()
                         throws DevFailed
Throws:
DevFailed

dev_import

public void dev_import()
                throws DevFailed
Really build the device connection.

Throws:
DevFailed

set_timeout_millis

public void set_timeout_millis(int millis)
                        throws DevFailed
Change the timeout value for a device call.

Parameters:
millis - New value of the timeout in milliseconds.
Throws:
DevFailed - if orb.create_policy throws an org.omg.CORBA.PolicyError exception.

get_timeout

public int get_timeout()
Deprecated. use get_timeout_millis() instead

return the timeout value for a device call.

Returns:
the value of the timeout in milliseconds.

get_timeout_millis

public int get_timeout_millis()
                       throws DevFailed
return the timeout value for a device call.

Returns:
the value of the timeout in milliseconds.
Throws:
DevFailed

throw_dev_failed

public void throw_dev_failed(java.lang.Exception e,
                             java.lang.String command,
                             boolean from_inout_cmd)
                      throws DevFailed
Build reason and origin of the exception And throw it into a DevFailed exception

Throws:
DevFailed

command_inout

public DeviceData command_inout(java.lang.String command,
                                DeviceData argin)
                         throws DevFailed
Send a command to a device server.

Parameters:
command - Command name to send to the device.
argin - input command argument.
Returns:
the output argument of the command.
Throws:
DevFailed

command_inout

public DeviceData command_inout(java.lang.String command)
                         throws DevFailed
Send a command to a device server.

Parameters:
command - Command name.
Returns:
the output argument of the command.
Throws:
DevFailed

ping

public long ping()
          throws DevFailed
Execute a ping command to a device server.

Returns:
the elapsed time for ping command in microseconds.
Throws:
DevFailed

black_box

public java.lang.String[] black_box(int length)
                             throws DevFailed
Execute a info command to a device server.

Throws:
DevFailed

info_3

public DevInfo_3 info_3()
                 throws DevFailed
Execute a info command to a device server.

Throws:
DevFailed

info

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

Throws:
DevFailed

command_list_query

public CommandInfo[] command_list_query()
                                 throws DevFailed
Execute a command_list_query command to a device server.

Throws:
DevFailed

get_idl_version

public int get_idl_version()
                    throws DevFailed
Returns the IDL version supported

Returns:
the IDL version supported .
Throws:
DevFailed

get_source

public DevSource get_source()
                     throws DevFailed
returns the device data source

Returns:
data source (CACHE_DEV, CACHE or DEV).
Throws:
DevFailed

set_source

public void set_source(DevSource new_src)
                throws DevFailed
Set the device data source

Parameters:
new_src - new data source (CACHE_DEV, CACHE or DEV).
Throws:
DevFailed

get_name

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


get_host_name

public java.lang.String get_host_name()
                               throws DevFailed
return the device connected host name.

Throws:
DevFailed

get_class_name

public java.lang.String get_class_name()
                                throws DevFailed
return the device connected class name.

Throws:
DevFailed

get_server_name

public java.lang.String get_server_name()
                                 throws DevFailed
return the device connected server name.

Throws:
DevFailed

description

public java.lang.String description()
                             throws DevFailed
return the device connected dexcription.

Throws:
DevFailed

adm_name

public java.lang.String adm_name()
                          throws DevFailed
return the administartion device name.

Throws:
DevFailed

get_tango_host

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

Throws:
DevFailed

is_taco

public boolean is_taco()
return true if device is a taco device


checkIfTaco

public void checkIfTaco(java.lang.String cmdname)
                 throws DevFailed
if not a TACO command then throw a DevFailed Exception.

Parameters:
cmdname - command name to be put inside reason and origin fields.
Throws:
DevFailed

checkIfTango

public void checkIfTango(java.lang.String cmdname)
                  throws DevFailed
if not a TACO command then throw a DevFailed Exception.

Parameters:
cmdname - command name to be put inside reason and origin fields.
Throws:
DevFailed

get_transparency_reconnection

public boolean get_transparency_reconnection()
return the value of transparent_reconnection


set_transparency_reconnection

public void set_transparency_reconnection(boolean val)
set the value of transparent_reconnection


getAccessControl

public int getAccessControl()

setAccessControl

public void setAccessControl(int access)

isAllowedCommand

public boolean isAllowedCommand(java.lang.String cmd)
                         throws DevFailed
Throws:
DevFailed

getIConnection

public IConnectionDAO getIConnection()

setIConnection

public void setIConnection(IConnectionDAO connection)

isAlready_connected

public boolean isAlready_connected()

setAlready_connected

public void setAlready_connected(boolean already_connected)

getDev_timeout

public int getDev_timeout()

setDev_timeout

public void setDev_timeout(int dev_timeout)

isDevice_is_dbase

public boolean isDevice_is_dbase()

setDevice_is_dbase

public void setDevice_is_dbase(boolean device_is_dbase)

getObj

public org.omg.CORBA.Object getObj()

setObj

public void setObj(org.omg.CORBA.Object obj)

isPrev_failed

public boolean isPrev_failed()
Return true if prev_failed is not equal to true

Returns:
true if previous call has failed

getPrev_failed

public DevFailed getPrev_failed()

setPrev_failed

public void setPrev_failed(DevFailed prev_failed)

getPrev_failed_t0

public long getPrev_failed_t0()

setPrev_failed_t0

public void setPrev_failed_t0(long prev_failed_t0)

TANGO Java API
( TangORB-7.3.3.jar)