edu.stanford.slac.aida.dp.dpModel
Class DpModelI_impl

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by edu.stanford.slac.aida.dp.dpModel.DpModelIPOA
          extended by edu.stanford.slac.aida.dp.dpModel.DpModelI_impl
All Implemented Interfaces:
DpModelIOperations, org.omg.CORBA.portable.InvokeHandler

public class DpModelI_impl
extends DpModelIPOA

This class defines the (new) AIDA Model Data Provider CORBA server implementation, which gets online model data, computed by XAL, out of the Relational Database. DpModelI_impl implements the AIDA Data Provider "DpModelI" CORBA interface, by extending DpModelIPOA.

Aida Parameters: The get methods of this implementation take the following Ai da parameters (given as name/value pairs).

B If given the user wants the rMat from element A (the target) to that given in B parameter value. If A is downstream of B, then the inverse matrix of A->B is returned.

TYPE Can be "database" (equivalent to "computed"), or "design".

POS From where to get the model of sliced elements (QUADS, sliced BENDS etc). May be "beg", "beginning", "mid", "middle", or "end". Default is "end".

POSB If B param is given and is a sliced element, then POSB may be used to indicate to which position, begining, middle, or end, in B, the Rmat of A to B should be computed.

MODE The Modelling MODE for which the data is wanted. Devices can be modelled in more than one modelling mode. A mode identifies a beamline run under particular initial conditions and energy scaling. MODEs are identied by an integer in model//modes.

DGRP Deprecated

KNOWN BUG: Actually the bug is in the DB, not in code. A.t.t.o.w. (29th Sep 2008) the 1st section of a multi-section device like ACCL:IN2:400 has the model as it existed at the EXIT of that element, so ACCL:IN2:400//twiss POS=BEG does NOT get the model as it is entering the cavity!

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., 23-Apr-2009, Greg White, Switch default to acquiring RUN=GOLD., 30-Mar-2009, Greg White, Add support for GOLD. As released, default is still RUN=LATEST., 14-Jan-2009, Greg White, Add handling of MODE, being the combination of beamline and run-time conditions (eg Energy, focusing lattice, initial conditions etc)., 09-Jan-2009, Greg White, Remove code to inverse resulting matrix if A is downstream of B., 05-Dec-2008, Greg White, Fixed Rmatrix for R14 - was giving R13 value in R14., 13-Oct-2008, Greg White, Removed ORDER_BY PSI_X for Rmat gets!, 29-Sept-2008, Greg White, Fixed handling for multi-segment elements like KLYS (eg ACCL:IN20:400). MID gets middle element (eg 4th if 7 sections like L0A___1, L0A___2 ... L0A___7)., 16-July-2008, Greg White, Added A to B., 9-July-2008, initial version.
Author:
Greg White

Field Summary
protected static boolean debug
           
 
Method Summary
 org.omg.PortableServer.POA _default_POA()
           
 boolean get_boolean(java.lang.String target, java.lang.String[] args)
           
 boolean[] get_booleana(java.lang.String target, java.lang.String[] args)
           
 byte get_byte(java.lang.String target, java.lang.String[] args)
           
 byte[] get_bytea(java.lang.String target, java.lang.String[] args)
           
 char get_char(java.lang.String target, java.lang.String[] args)
           
 char[] get_chara(java.lang.String target, java.lang.String[] args)
           
 double get_double(java.lang.String target, java.lang.String[] args)
           
 double[] get_doublea(java.lang.String query, java.lang.String[] args)
          As get:Any, retrives the model parameters for a given element, subject to the AIDA parameters given, returning an array of doubles.
 float get_float(java.lang.String target, java.lang.String[] args)
           
 float[] get_floata(java.lang.String target, java.lang.String[] args)
          Retrives the model parameters for a given element, subject to the AIDA parameters given, and returning an array of floats.
 int get_long(java.lang.String target, java.lang.String[] args)
           
 int[] get_longa(java.lang.String target, java.lang.String[] args)
           
 short get_short(java.lang.String target, java.lang.String[] args)
           
 short[] get_shorta(java.lang.String target, java.lang.String[] args)
           
 java.lang.String get_string(java.lang.String target, java.lang.String[] args)
           
 java.lang.String[] get_stringa(java.lang.String target, java.lang.String[] args)
           
 char get_wchar(java.lang.String target, java.lang.String[] args)
           
 char[] get_wchara(java.lang.String target, java.lang.String[] args)
           
 java.lang.String get_wstring(java.lang.String target, java.lang.String[] args)
           
 org.omg.CORBA.Any get(java.lang.String query, java.lang.String[] args)
          Retrives the model parameters for a given element, subject to the AIDA parameters given, and returning an Any.
 void init()
           
 void set(java.lang.String query, java.lang.String[] args, org.omg.CORBA.AnyHolder value)
           
 void shutdown()
           
 void startMonitor(java.lang.String name)
           
 int status()
           
 void stopMonitor(java.lang.String name)
           
 
Methods inherited from class edu.stanford.slac.aida.dp.dpModel.DpModelIPOA
_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
 

Field Detail

debug

protected static final boolean debug
See Also:
Constant Field Values
Method Detail

_default_POA

public org.omg.PortableServer.POA _default_POA()
Overrides:
_default_POA in class org.omg.PortableServer.Servant

init

public void init()
          throws edu.stanford.slac.except.ServerInitialisationException
Throws:
edu.stanford.slac.except.ServerInitialisationException

get

public org.omg.CORBA.Any get(java.lang.String query,
                             java.lang.String[] args)
                      throws edu.stanford.slac.except.UnableToGetDataException
Retrives the model parameters for a given element, subject to the AIDA parameters given, and returning an Any.

Parameters:
modelledElement/modelledParameter - The name of a modelled element and the model parameter required for the element, given as an AIDA name.
args - Array of name/value string pairs, as described in class comments.
Returns:
DaValue (encapsulated by CORBA Any)
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_doublea

public double[] get_doublea(java.lang.String query,
                            java.lang.String[] args)
                     throws edu.stanford.slac.except.UnableToGetDataException
As get:Any, retrives the model parameters for a given element, subject to the AIDA parameters given, returning an array of doubles.

Parameters:
query - The name of a modelled element and the model parameter required for the element, given as an AIDA name.
args - Array of name/value string pairs, as described in class comments.
Returns:
array of doubles
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_floata

public float[] get_floata(java.lang.String target,
                          java.lang.String[] args)
                   throws edu.stanford.slac.except.UnableToGetDataException
Retrives the model parameters for a given element, subject to the AIDA parameters given, and returning an array of floats.

Parameters:
modelledElement/modelledParameter - The name of a modelled element and the model parameter required for the element, given as an AIDA name.
args - Array of name/value string pairs, as described in class comments.
Returns:
array of floats
Throws:
edu.stanford.slac.except.UnableToGetDataException

set

public void set(java.lang.String query,
                java.lang.String[] args,
                org.omg.CORBA.AnyHolder value)
         throws edu.stanford.slac.except.UnableToSetDataException
Throws:
edu.stanford.slac.except.UnableToSetDataException

startMonitor

public void startMonitor(java.lang.String name)
                  throws edu.stanford.slac.except.MonitorStartupException
Throws:
edu.stanford.slac.except.MonitorStartupException

stopMonitor

public void stopMonitor(java.lang.String name)
                 throws edu.stanford.slac.except.MonitorShutdownException
Throws:
edu.stanford.slac.except.MonitorShutdownException

status

public int status()

shutdown

public void shutdown()

get_byte

public byte get_byte(java.lang.String target,
                     java.lang.String[] args)
              throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_short

public short get_short(java.lang.String target,
                       java.lang.String[] args)
                throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_long

public int get_long(java.lang.String target,
                    java.lang.String[] args)
             throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_boolean

public boolean get_boolean(java.lang.String target,
                           java.lang.String[] args)
                    throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_double

public double get_double(java.lang.String target,
                         java.lang.String[] args)
                  throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_float

public float get_float(java.lang.String target,
                       java.lang.String[] args)
                throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_string

public java.lang.String get_string(java.lang.String target,
                                   java.lang.String[] args)
                            throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_char

public char get_char(java.lang.String target,
                     java.lang.String[] args)
              throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_wstring

public java.lang.String get_wstring(java.lang.String target,
                                    java.lang.String[] args)
                             throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_wchar

public char get_wchar(java.lang.String target,
                      java.lang.String[] args)
               throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_bytea

public byte[] get_bytea(java.lang.String target,
                        java.lang.String[] args)
                 throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_shorta

public short[] get_shorta(java.lang.String target,
                          java.lang.String[] args)
                   throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_longa

public int[] get_longa(java.lang.String target,
                       java.lang.String[] args)
                throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_booleana

public boolean[] get_booleana(java.lang.String target,
                              java.lang.String[] args)
                       throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_stringa

public java.lang.String[] get_stringa(java.lang.String target,
                                      java.lang.String[] args)
                               throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_chara

public char[] get_chara(java.lang.String target,
                        java.lang.String[] args)
                 throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException

get_wchara

public char[] get_wchara(java.lang.String target,
                         java.lang.String[] args)
                  throws edu.stanford.slac.except.UnableToGetDataException
Throws:
edu.stanford.slac.except.UnableToGetDataException