|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.activity.xmldb.commands.CreateResourceCommand
A Command
to create a new resource within a collection.
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 boolean |
mEmbedded Indicates whether the new resource is embedded in the element or must be retrieved from an input. |
private java.lang.String |
mInputName The input name if new resource is to be retrieved from an input. |
private java.lang.String |
mName The name of the new resource. |
private org.w3c.dom.Node |
mResource The new resource if it is embedded in the command element. |
Constructor Summary | |
CreateResourceCommand() |
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. |
java.lang.String |
getInputName() Gets the input name if the resource content is being read from an input stream. |
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 |
private static final java.lang.String COPYRIGHT_NOTICE
private static final DAILogger LOG
private java.lang.String mCommandName
private java.lang.String mName
private boolean mEmbedded
private java.lang.String mInputName
private org.w3c.dom.Node mResource
Constructor Detail |
public CreateResourceCommand()
Method Detail |
public void initialise(java.lang.String commandName, org.w3c.dom.Element element) throws XMLDBCommandSpecificationException, XMLDBCommandExecutionException
Command
Element
. The details retrieved may determine the behavior of the execute
method.
initialise
in interface Command
commandName
- Command nameelement
- The Element
that corresponds to this command.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 problempublic java.lang.String getInputName()
String
of the input name or null
if the resource content is not being read from an input.public void execute(CommandContext context) throws XMLDBCommandSpecificationException, XMLDBCommandExecutionException
Command
execute
in interface Command
context
- A CommandContext
object from which the current collection, the default output and any inputs can be retrieved.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 problemprivate java.lang.String generateXML()
<createdResource name="RESOURCE"/>
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |