uk.org.ogsadai.activity.xmldb.commands
Class CreateCollectionCommand

java.lang.Object
  |
  +--uk.org.ogsadai.activity.xmldb.commands.CreateCollectionCommand
All Implemented Interfaces:
Command

public class CreateCollectionCommand
extends java.lang.Object
implements Command

A Command to create a new collection.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private static DAILogger LOG
          Logger object for logging in this class
private  java.lang.String mCommandName
          Command name
private  java.lang.String mName
          The name of the collection to add.
 
Constructor Summary
CreateCollectionCommand()
           
 
Method Summary
 void execute(CommandContext context)
          Executes this command using the specified context.
private  java.lang.String generateXML()
          Fast method of creating the result XML using a simple string buffer.
 void initialise(java.lang.String commandName, org.w3c.dom.Element element)
          Initialises this command by parsing the specified Element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

LOG

private static DAILogger LOG
Logger object for logging in this class


mCommandName

private java.lang.String mCommandName
Command name


mName

private java.lang.String mName
The name of the collection to add.

Constructor Detail

CreateCollectionCommand

public CreateCollectionCommand()
Method Detail

initialise

public void initialise(java.lang.String commandName,
                       org.w3c.dom.Element element)
                throws XMLDBCommandSpecificationException,
                       XMLDBCommandExecutionException
Description copied from interface: Command
Initialises this command by parsing the specified Element. The details retrieved may determine the behavior of the execute method.

Specified by:
initialise in interface Command
Parameters:
commandName - Command name
element - The Element that corresponds to this command.
Throws:
XMLDBCommandSpecificationException - If there is a problem parsing element or initialising the command due to incorrect values in the command provided by a client.
XMLDBCommandExecutionException - If there is an internal problem

execute

public void execute(CommandContext context)
             throws XMLDBCommandSpecificationException,
                    XMLDBCommandExecutionException
Description copied from interface: Command
Executes this command using the specified context. Any output that is generated is written to the default output contained in the context.

Specified by:
execute in interface Command
Parameters:
context - A CommandContext object from which the current collection, the default output and any inputs can be retrieved.
Throws:
XMLDBCommandSpecificationException - If there is a problem during the running of the command due to incorrect values in the command provided by a client.
XMLDBCommandExecutionException - If there is an internal problem

generateXML

private java.lang.String generateXML()
Fast method of creating the result XML using a simple string buffer. Creates an XML fragment of form
 <createdCollection name="COLLECTION"/>
 

Returns:
XML fragment