edu.stanford.slac.aida.sys.daNameServer
Class DaNameServerI_impl

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by edu.stanford.slac.aida.sys.daNameServer.DaNameServerIPOA
          extended by edu.stanford.slac.aida.sys.daNameServer.DaNameServerI_impl
All Implemented Interfaces:
DaNameServerIOperations, org.omg.CORBA.portable.InvokeHandler

public class DaNameServerI_impl
extends DaNameServerIPOA

Defines the Aida Directory Service API implementation.

DaNameServiceI_impl implements the DaNameServerI IDL interface.

Version:
26-Oct-2012, Partha/Greg - Implemented Oracle wallet support., 05-May-2011, Bob Hall. Modified to invoke getPwd to get Oracle password only once during initialization., 04-Apr-2011, Bob Hall. Changed to use getPwd to get Oracle password., 08-Mar-2011, Bob Hall. Modified default connection string to reference slacprod instead of slac-oracle03., Greg White, 6-Nov-2009: Parameterize the DB connection JDBC URL., Greg White, 16-Oct-2008: Add pattern matching and substitution of Transform., Greg White, 18-Jun-2008: Retrieve Statement from ResultSet to close explicitly., Greg White, 13-Jun-2008: Explicitly close ResultSets., Bob Hall, 13-Feb-2008: Changed Oracle password., Greg White, 31-Oct-2007: Fixed population of ref.services in getTargetRef, to support DaObject.getCount() and DaObject.getServices()., Greg White, 6-Dec-2005: Changed N_CONNECTION_STRING for new Oracle server host., Greg White, 21-Jun-2005: added getConnection(), and implemented retry loop if stmt.executeQuery() fails. This should fix JDBC stale connection problems., Greg White, 15-Sep-2004: Convert for Err singleton re-write., Greg White, Sep-2004: Added exception handling., 25-Jan-2004, Greg White: Changed Connecting string from sage to slac-oracle, and SLAC to SLACPROD, 13-Nov-2002, Ron MacKenzie Change import of except from aida to package except.
Author:
Greg White, George McIntyre, Oct-2001

Constructor Summary
DaNameServerI_impl(org.omg.PortableServer.POA poa)
          Constructs and initializes the AIDA Name Server.
 
Method Summary
 org.omg.PortableServer.POA _default_POA()
          Gets the portable object adapter under which this instance was constructed, if non-null, or the default POA.
 java.lang.String GetObjRef(java.lang.String name)
          Retrieves the CORBA IOR for a given Aida server.
 AidaObjectRef getTargetRef(java.lang.String target)
          Gets an Aida reference object for a given target.
 void shutdown()
          Proper server process shutdown.
 int status()
          Returns the status of the server (or it will anyway).
 void StoreObjRef(java.lang.String name, java.lang.String ior)
          Stores a given CORBA IOR for an Aida server in a place where clients can access it.
 
Methods inherited from class edu.stanford.slac.aida.sys.daNameServer.DaNameServerIPOA
_all_interfaces, _invoke, _this, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DaNameServerI_impl

public DaNameServerI_impl(org.omg.PortableServer.POA poa)
Constructs and initializes the AIDA Name Server.

Parameters:
poa - Portable Object Adaptor
Method Detail

_default_POA

public org.omg.PortableServer.POA _default_POA()
Gets the portable object adapter under which this instance was constructed, if non-null, or the default POA.

Overrides:
_default_POA in class org.omg.PortableServer.Servant
Returns:
POA

getTargetRef

public AidaObjectRef getTargetRef(java.lang.String target)
                           throws edu.stanford.slac.except.UndefinedNameException
Gets an Aida reference object for a given target. The reference object can then be used to make efficient data accesses for that target.

Parameters:
target - An Aida accessible data item.
Returns:
A structure specifying the names, locations, and other Aida system information that will help Aida retrieve the data corresponding to this target quickly.
Throws:
edu.stanford.slac.except.UndefinedNameException

StoreObjRef

public void StoreObjRef(java.lang.String name,
                        java.lang.String ior)
Stores a given CORBA IOR for an Aida server in a place where clients can access it.

Parameters:
name - The name of the server under which to store the IOR
ior - The Interoperable Object Reference (IOR) of the proxy object implementing the interface given in the name parameter.

GetObjRef

public java.lang.String GetObjRef(java.lang.String name)
Retrieves the CORBA IOR for a given Aida server.

Parameters:
name - The name of the server for which to get the IOR.
Returns:
The IOR (CORBA Interoperable Object Reference) for the server given by name.

status

public int status()
Returns the status of the server (or it will anyway). This function may also be used as a way for the Watcher to make the IMR restart the server if it is down.

Returns:
stat 0 if this is the first time status was called (that is the server has just been restarted), 1 otherwise.

shutdown

public void shutdown()
Proper server process shutdown. Call this to shutdown the server process remotely.