uk.ac.ic.doc.automed.reps
Class Protocol

java.lang.Object
  |
  +--uk.ac.ic.doc.automed.reps.Protocol

public class Protocol
extends java.lang.Object

The Protocol class describes a generic method of accessing data sources, such as JDBC or ODBC. Each extensional AutoMed Schema can have one or more AccessMethods, each of which holds the parameters required by the protocol in order to access the data source.

Author:
Michael Boyd (mboyd@doc.ic.ac.uk), Nerissa Tong (nnyt98@doc.ic.ac.uk), Peter McBrien (pjm@doc.ic.ac.uk)

Method Summary
static Protocol createProtocol(java.lang.String protocolName)
          Creates a new protocol.
static boolean exists(java.lang.String protocolName)
          Determine if a given named protocol exists in the repository
 java.lang.String getName()
          Returns the name of the protocol.
protected  int getPID()
          Returns the protocol identifier (PID).
static Protocol getProtocol(int pid)
          Returns the Protocol with the given PID.
static Protocol getProtocol(java.lang.String protocolName)
          Returns the Protocol with the given protocolName.
 void remove()
           
static void remove(int pid)
          Removes the protocol with the given protocol PID.
static void remove(java.lang.String protocolName)
          Removes the protocol with the given protocolName.
 void setName(java.lang.String protocolName)
          Sets the name of the protocol to the given string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createProtocol

public static Protocol createProtocol(java.lang.String protocolName)
                               throws IntegrityException
Creates a new protocol.

Parameters:
protocolName - the name of the protocol.
Throws:
IntegrityException - if the protocol already exists in the repository

remove

public static void remove(java.lang.String protocolName)
                   throws STRException,
                          java.sql.SQLException,
                          DataSourceRepositoryException,
                          java.io.IOException
Removes the protocol with the given protocolName.

Parameters:
protocolName - the name of the protocol to be removed.
Throws:
STRException
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException

remove

public static void remove(int pid)
                   throws STRException,
                          java.sql.SQLException,
                          DataSourceRepositoryException,
                          java.io.IOException
Removes the protocol with the given protocol PID.

Parameters:
pid - the identifier of the protocol to be removed.
Throws:
STRException
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException

remove

public void remove()
            throws STRException,
                   java.sql.SQLException,
                   DataSourceRepositoryException,
                   java.io.IOException
STRException
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException

getName

public java.lang.String getName()
Returns the name of the protocol.

Returns:
the name of the protocol.

setName

public void setName(java.lang.String protocolName)
             throws STRException,
                    java.sql.SQLException,
                    DataSourceRepositoryException,
                    java.io.IOException
Sets the name of the protocol to the given string.

Parameters:
protocolName - the string that is to be the protocol's name.
Throws:
STRException
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException

getProtocol

public static Protocol getProtocol(java.lang.String protocolName)
                            throws NotFoundException
Returns the Protocol with the given protocolName.

Parameters:
protocolName - the name of the protocol.
Returns:
the Protocol with the given protocolName.
Throws:
STRException
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException
NotFoundException

exists

public static boolean exists(java.lang.String protocolName)
Determine if a given named protocol exists in the repository

Parameters:
protocolName - String name of protocol

getProtocol

public static Protocol getProtocol(int pid)
                            throws STRException,
                                   java.sql.SQLException,
                                   DataSourceRepositoryException,
                                   java.io.IOException
Returns the Protocol with the given PID.

Parameters:
pid - the identifier of the protocol in the STR.
Returns:
the Protocol with the given pid.
Throws:
STRException
java.sql.SQLException
DataSourceRepositoryException
java.io.IOException

getPID

protected int getPID()
Returns the protocol identifier (PID).

Returns:
the protocol identifier (PID).