org.jlab.coda.afecs.sqldb
Class DbCommunications

java.lang.Object
  extended by org.jlab.coda.afecs.sqldb.DbCommunications

public class DbCommunications
extends java.lang.Object

JSA: Thomas Jefferson National Accelerator Facility
This software was developed under a United States Government license,
described in the NOTICE file included as part of this distribution.
Copyright (c), Nov 9, 2009


Method Summary
static boolean checkComponent(java.lang.String component)
           
static boolean checkRunTypesTable(java.lang.String runtype)
          Check if runtype is registered in the runTypes table
static boolean checkSessionsTable(java.lang.String session)
          Check if session is registered in the sessions table.
static void execDBQuery(java.lang.String query)
          Execute query
static void execDBUpdate(java.lang.String query)
          Execute update
static int getRunNumber()
          This methods gets the runNumber from the database "sessions" table for this session.
static int getRunNumber(java.lang.String sess)
          This methods gets the runNumber from the database "sessions" table for the given session.
static java.util.List getRuntypes()
           
static java.lang.String getSession()
          Get the runcontrol session used for SQL queries.
static boolean isConnected()
           
static void recreateConfigTable(java.lang.String runtype)
          Recreate config table with the name runType
static void recreateOptionsTable(java.lang.String runtype)
          Recreate options table for required runtype
static void setRunNumber(int runNumber)
          This method sets the runNumber in the database "sessions" table for this session.
static void setRunNumber(int runNumber, java.lang.String sess)
          This method sets the runNumber in the database "sessions" table for given session.
static void setSession(java.lang.String s)
          Set the runcontrol session relevant to these SQL queries.
static void setSessionConfig(java.lang.String runtype, java.lang.String sess)
          This method sets the config in the database "sessions" table for given session.
static void updaterunTypesTable(java.lang.String runtype)
          Check if runtype is registered in the runTypes table , and if not insert a record.
static void updateSessionsTable(java.lang.String session, java.lang.String node)
          Check if session is registered in the sessions table , and if not insert a record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setSession

public static void setSession(java.lang.String s)
Set the runcontrol session relevant to these SQL queries.


getSession

public static java.lang.String getSession()
Get the runcontrol session used for SQL queries.


isConnected

public static boolean isConnected()

updateSessionsTable

public static void updateSessionsTable(java.lang.String session,
                                       java.lang.String node)
                                throws AException
Check if session is registered in the sessions table , and if not insert a record.

Throws:
AException

checkSessionsTable

public static boolean checkSessionsTable(java.lang.String session)
                                  throws AException
Check if session is registered in the sessions table.

Throws:
AException

updaterunTypesTable

public static void updaterunTypesTable(java.lang.String runtype)
                                throws AException
Check if runtype is registered in the runTypes table , and if not insert a record.

Throws:
AException

checkRunTypesTable

public static boolean checkRunTypesTable(java.lang.String runtype)
                                  throws AException
Check if runtype is registered in the runTypes table

Throws:
AException

getRuntypes

public static java.util.List getRuntypes()

recreateConfigTable

public static void recreateConfigTable(java.lang.String runtype)
                                throws AException
Recreate config table with the name runType

Throws:
AException

recreateOptionsTable

public static void recreateOptionsTable(java.lang.String runtype)
                                 throws AException
Recreate options table for required runtype

Throws:
AException

checkComponent

public static boolean checkComponent(java.lang.String component)
                              throws AException
Throws:
AException

execDBQuery

public static void execDBQuery(java.lang.String query)
                        throws AException
Execute query

Throws:
AException

execDBUpdate

public static void execDBUpdate(java.lang.String query)
                         throws AException
Execute update

Throws:
AException

getRunNumber

public static int getRunNumber()
                        throws AException
This methods gets the runNumber from the database "sessions" table for this session.

Throws:
AException

getRunNumber

public static int getRunNumber(java.lang.String sess)
                        throws AException
This methods gets the runNumber from the database "sessions" table for the given session.

Throws:
AException

setRunNumber

public static void setRunNumber(int runNumber)
                         throws AException
This method sets the runNumber in the database "sessions" table for this session.

Throws:
AException

setRunNumber

public static void setRunNumber(int runNumber,
                                java.lang.String sess)
                         throws AException
This method sets the runNumber in the database "sessions" table for given session.

Throws:
AException

setSessionConfig

public static void setSessionConfig(java.lang.String runtype,
                                    java.lang.String sess)
                             throws AException
This method sets the config in the database "sessions" table for given session.

Throws:
AException