uk.org.ogsadai.activity.xmldb.commands
Interface CommandContext

All Known Implementing Classes:
CommandContextImpl

public interface CommandContext

A CommandContext allows a command to access the objects that it can interact with. For example, an command to add a new resource might get a collection, using the getCollection method, then get the new resource from an input, using the getInput method, before writing some results to the output, retrieved with the getOutput method.

Author:
The OGSA-DAI Project

Method Summary
 org.xmldb.api.base.Collection getCollection()
          Gets the open Collection that the command will be interact with.
 BlockReader getInput(java.lang.String inputName)
          Get the named input for the Command to interact with.
 BlockWriter getOutput()
          Gets the output for the command to write any results to.
 

Method Detail

getCollection

public org.xmldb.api.base.Collection getCollection()
Gets the open Collection that the command will be interact with.

Returns:
an open Collection object. It is not the command's responsibility to close this.

getInput

public BlockReader getInput(java.lang.String inputName)
                     throws XMLDBStreamNotFoundException
Get the named input for the Command to interact with.

Parameters:
inputName - The name of the input.
Returns:
a BlockReader from which the input can be read.
Throws:
XMLDBStreamNotFoundException - If there is no such input stream.

getOutput

public BlockWriter getOutput()
                      throws XMLDBStreamNotFoundException
Gets the output for the command to write any results to.

Returns:
a BlockWriter to which the output can be written.
Throws:
XMLDBStreamNotFoundException - If there is no output stream.