org.postgresql.pljava.management
Class SQLDeploymentDescriptor

java.lang.Object
  extended by org.postgresql.pljava.management.SQLDeploymentDescriptor

public class SQLDeploymentDescriptor
extends java.lang.Object

This class deals with parsing and executing the deployment descriptor as defined in ISO/IEC 9075-13:2003. It has the following format:


 <descriptor file> ::=
 SQLActions <left bracket> <right bracket> <equal sign>
 { [ <double quote> <action group> <double quote>
   [ <comma> <double quote> <action group> <double quote> ] ] }

 <action group> ::=
     <install actions>
   | <remove actions>
 
 <install actions> ::=
   BEGIN INSTALL [ <command> <semicolon> ]... END INSTALL

 <remove actions> ::=
   BEGIN REMOVE [ <command> <semicolon> ]... END REMOVE

 <command> ::=
     <SQL statement>
   | <implementor block>

 <SQL statement> ::= <SQL token>...
 
 <implementor block> ::=
   BEGIN <implementor name> <SQL token>... END <implementor name>

 <implementor name> ::= <identifier>

 <SQL token> ::= an SQL lexical unit specified by the term "<token>" in
 Subclause 5.2, "<token>" and "<separator>", in ISO/IEC 9075-2.


Constructor Summary
SQLDeploymentDescriptor(java.lang.String descImage, java.lang.String implementorName)
          Parses the deployment descriptor descImage using implementorName as discriminator for implementor specific blocks.
 
Method Summary
 void install(java.sql.Connection conn)
          Executes the INSTALL actions.
 void remove(java.sql.Connection conn)
          Executes the REMOVE actions.
 java.lang.String toString()
          Returns the original image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLDeploymentDescriptor

public SQLDeploymentDescriptor(java.lang.String descImage,
                               java.lang.String implementorName)
                        throws java.text.ParseException
Parses the deployment descriptor descImage using implementorName as discriminator for implementor specific blocks. The install and remove blocks are remembered for later execution with calls to install() and remove().

Parameters:
descImage - The image to parse
implementorName - The discriminator to use for implementor blocks
Throws:
java.text.ParseException - If a parse error is encountered
Method Detail

install

public void install(java.sql.Connection conn)
             throws java.sql.SQLException
Executes the INSTALL actions.

Parameters:
conn - The connection to use for the execution.
Throws:
java.sql.SQLException

remove

public void remove(java.sql.Connection conn)
            throws java.sql.SQLException
Executes the REMOVE actions.

Parameters:
conn - The connection to use for the execution.
Throws:
java.sql.SQLException

toString

public java.lang.String toString()
Returns the original image.

Overrides:
toString in class java.lang.Object


Copyright (c) 2003, 2004, 2005 TADA AB - Taby Sweden. \ Distributed under the terms shown in COPYRIGHT