net.sf.nxqd
Class NxqdContainer

java.lang.Object
  extended by net.sf.nxqd.NxqdConsumer
      extended by net.sf.nxqd.NxqdContainer

public class NxqdContainer
extends NxqdConsumer

The class NxqdContainer is the for interacting with Nxqd containers, such as adding or deleting documents.

Version:
1.0
Author:
webhiker

Method Summary
 boolean blobExists(String blobId)
          The blobExists method checks if the specified blob exists.
 void deleteBlob(String blobId)
          The deleteBlob method deletes the specified blob from this container using the specified blobId.
 void deleteDocument(String documentId)
          The deleteDocument method deletes the specified document from this container using the specified documentId.
 boolean documentExists(String documentId)
          The documentExists method checks if the specified document exists.
 NxqdBlobValue getBlob(String blobId)
          The getBlob method retrieves the specified blob from the database.
 NxqdXMLValue getDocument(String documentId)
          The getDocument method retrieves the specified document from this container using the specified documentId.
 String getName()
          The getName method returns the name of this Container.
 long getNumDocuments()
          Returns the number of XML Documents in this container.
 List listBlobs()
          The listBlobs method lists the id's of the blobs managed by this container.
 List listDocuments()
          The listDocuments method returns a List containing the document id's managed by the server.
 void putBlob(String blobId, NxqdBlobValue blob)
          The putBlob method stores the specified blob object as a binary resources in the database under the specified id.
 void putDocument(String documentId, NxqdXMLValue document)
          The putDocument method adds the document to this container using the specified documentId.
 
Methods inherited from class net.sf.nxqd.NxqdConsumer
getNxqdManager, setNxqdManager
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public final String getName()
The getName method returns the name of this Container.

Returns:
a String value

getNumDocuments

public long getNumDocuments()
                     throws NxqdException
Returns the number of XML Documents in this container.

Returns:
an long value
Throws:
XmlException - if an error occurs
NxqdException

putDocument

public void putDocument(String documentId,
                        NxqdXMLValue document)
                 throws NxqdException
The putDocument method adds the document to this container using the specified documentId. An exception is thrown if the specified documentId already exists.

Parameters:
documentId - a String value
document - a NxqdXMLValue value
Throws:
NxqdException - if an error occurs

getDocument

public NxqdXMLValue getDocument(String documentId)
                         throws NxqdException
The getDocument method retrieves the specified document from this container using the specified documentId. An exception is thrown if the specified documentId does not exist.

Parameters:
documentId - a String value
Returns:
a NxqdXMLValue value
Throws:
NxqdException - if an error occurs

deleteDocument

public void deleteDocument(String documentId)
                    throws NxqdException
The deleteDocument method deletes the specified document from this container using the specified documentId. An exception is thrown if an error occurred while deleting the document.

Parameters:
documentId - a String value
Throws:
NxqdException - if an error occurs

documentExists

public boolean documentExists(String documentId)
                       throws NxqdException
The documentExists method checks if the specified document exists. It will return true if the document exists, false otherwise. A NxqdException is thrown if other errors occur.

Parameters:
documentId - a String value
Returns:
a boolean value
Throws:
NxqdException - if an error occurs

listDocuments

public List listDocuments()
                   throws NxqdException
The listDocuments method returns a List containing the document id's managed by the server. This list may be empty, but it will never be null, and contains String values.

Returns:
a List value
Throws:
NxqdException - if an error occurs

putBlob

public void putBlob(String blobId,
                    NxqdBlobValue blob)
             throws NxqdException
The putBlob method stores the specified blob object as a binary resources in the database under the specified id.

Parameters:
blobId - a String value
blob - a NxqdBlobValue value
Throws:
NxqdException - if an error occurs

getBlob

public NxqdBlobValue getBlob(String blobId)
                      throws NxqdException
The getBlob method retrieves the specified blob from the database.

Parameters:
blobId - a String value
Returns:
a NxqdBlobValue value
Throws:
NxqdException - if an error occurs

deleteBlob

public void deleteBlob(String blobId)
                throws NxqdException
The deleteBlob method deletes the specified blob from this container using the specified blobId. An exception is thrown if an error occurred while deleting the document.

Parameters:
blobId - a String value
Throws:
NxqdException - if an error occurs

listBlobs

public List listBlobs()
               throws NxqdException
The listBlobs method lists the id's of the blobs managed by this container.

Returns:
a List value
Throws:
NxqdException - if an error occurs

blobExists

public boolean blobExists(String blobId)
                   throws NxqdException
The blobExists method checks if the specified blob exists. It will return true if the blob exists, false otherwise. A NxqdException is thrown if other errors occur.

Parameters:
blobId - a String value
Returns:
a boolean value
Throws:
NxqdException - if an error occurs


Copyright © 2005-2006 nxqd. All Rights Reserved.