gov.noaa.gdsg.xmldbremote.xmldbClient
Class XmldbClientCollection

java.lang.Object
  extended by gov.noaa.gdsg.xmldbremote.xmldbClient.XmldbClientCollection
All Implemented Interfaces:
org.xmldb.api.base.Collection, org.xmldb.api.base.Configurable

public class XmldbClientCollection
extends java.lang.Object
implements org.xmldb.api.base.Collection

This class wraps the SOAP calls into the XML:DB Database API.

Version:
$Id: XmldbClientCollection.java,v 1.2 2004/11/03 23:52:39 mrxtravis Exp $
Author:
tns

Constructor Summary
XmldbClientCollection(gov.noaa.gdsg.xmldbremote.Collection collectionTransport, gov.noaa.gdsg.xmldbremote.NmmrdbSoapBindingStub stub)
          Creates a new instance of Collection
 
Method Summary
 void close()
          Closes the this collection and releases the resources.
 java.lang.String createId()
          Creates a new ID which is used to create a resource.
 org.xmldb.api.base.Resource createResource(java.lang.String id, java.lang.String type)
          Creates a new empty resource with the given id
 org.xmldb.api.base.Collection getChildCollection(java.lang.String name)
          Return the child collection by name
 int getChildCollectionCount()
          Returns the number of child collections.
 gov.noaa.gdsg.xmldbremote.Collection getCollectionTransport()
          Returns the collection transport object associated with this Collection
 java.lang.String getName()
          Returns the name of this collection
 org.xmldb.api.base.Collection getParentCollection()
          Returns the parent collection associated with this collection
 java.lang.String getProperty(java.lang.String str)
          Throws a NOT_IMPLEMETED exception.
 org.xmldb.api.base.Resource getResource(java.lang.String id)
          Returns the resource Idenitifed by the specified string.
 int getResourceCount()
          Returns the number of resource in this record set
 org.xmldb.api.base.Service getService(java.lang.String name, java.lang.String version)
          Returns the specified service.
 org.xmldb.api.base.Service[] getServices()
          Returns all know services associated with this collection.
 boolean isOpen()
          Determines if this collection is open.
 java.lang.String[] listChildCollections()
          Returns a list of child collections
 java.lang.String[] listResources()
          Lists all resources associated with this collection.
 void removeResource(org.xmldb.api.base.Resource resource)
          Removes the specified resource from this collection.
 void setProperty(java.lang.String str, java.lang.String str1)
          Throws a NOT_IMPLEMENTED exception.
 void storeResource(org.xmldb.api.base.Resource resource)
          Stores the specified resource in this collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmldbClientCollection

public XmldbClientCollection(gov.noaa.gdsg.xmldbremote.Collection collectionTransport,
                             gov.noaa.gdsg.xmldbremote.NmmrdbSoapBindingStub stub)
Creates a new instance of Collection

Parameters:
collectionTransport - The transport object used to identify the remote object.
stub - The stub used to call the remote method.
Method Detail

close

public void close()
           throws org.xmldb.api.base.XMLDBException
Closes the this collection and releases the resources.

Specified by:
close in interface org.xmldb.api.base.Collection
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

createId

public java.lang.String createId()
                          throws org.xmldb.api.base.XMLDBException
Creates a new ID which is used to create a resource.

Specified by:
createId in interface org.xmldb.api.base.Collection
Returns:
The created ID.
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

createResource

public org.xmldb.api.base.Resource createResource(java.lang.String id,
                                                  java.lang.String type)
                                           throws org.xmldb.api.base.XMLDBException
Creates a new empty resource with the given id

Specified by:
createResource in interface org.xmldb.api.base.Collection
Parameters:
id - The id of the new resource
type - The type of resource to create
Returns:
A fresh new resource.
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

getChildCollection

public org.xmldb.api.base.Collection getChildCollection(java.lang.String name)
                                                 throws org.xmldb.api.base.XMLDBException
Return the child collection by name

Specified by:
getChildCollection in interface org.xmldb.api.base.Collection
Parameters:
name - The name of the child collection
Returns:
The specified child collection.
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

getChildCollectionCount

public int getChildCollectionCount()
                            throws org.xmldb.api.base.XMLDBException
Returns the number of child collections.

Specified by:
getChildCollectionCount in interface org.xmldb.api.base.Collection
Returns:
The number of child collections.
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

getName

public java.lang.String getName()
                         throws org.xmldb.api.base.XMLDBException
Returns the name of this collection

Specified by:
getName in interface org.xmldb.api.base.Collection
Returns:
The name.
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

getParentCollection

public org.xmldb.api.base.Collection getParentCollection()
                                                  throws org.xmldb.api.base.XMLDBException
Returns the parent collection associated with this collection

Specified by:
getParentCollection in interface org.xmldb.api.base.Collection
Returns:
The parent Collection.
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

getProperty

public java.lang.String getProperty(java.lang.String str)
                             throws org.xmldb.api.base.XMLDBException
Throws a NOT_IMPLEMETED exception.

Specified by:
getProperty in interface org.xmldb.api.base.Configurable
Parameters:
str - Ignored.
Returns:
Nothing, ever.
Throws:
org.xmldb.api.base.XMLDBException - with ErrorCodes.NOT_IMPLEMENTED.

getResource

public org.xmldb.api.base.Resource getResource(java.lang.String id)
                                        throws org.xmldb.api.base.XMLDBException
Returns the resource Idenitifed by the specified string.

Specified by:
getResource in interface org.xmldb.api.base.Collection
Parameters:
id - The id of the resource to find.
Returns:
The requested Resource.
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

getResourceCount

public int getResourceCount()
                     throws org.xmldb.api.base.XMLDBException
Returns the number of resource in this record set

Specified by:
getResourceCount in interface org.xmldb.api.base.Collection
Returns:
int
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

getService

public org.xmldb.api.base.Service getService(java.lang.String name,
                                             java.lang.String version)
                                      throws org.xmldb.api.base.XMLDBException
Returns the specified service.

Specified by:
getService in interface org.xmldb.api.base.Collection
Parameters:
name - The name of the Service
version - The Service version
Returns:
The specified Service.
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

getServices

public org.xmldb.api.base.Service[] getServices()
                                         throws org.xmldb.api.base.XMLDBException
Returns all know services associated with this collection.

Specified by:
getServices in interface org.xmldb.api.base.Collection
Returns:
All known services
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

isOpen

public boolean isOpen()
               throws org.xmldb.api.base.XMLDBException
Determines if this collection is open.

Specified by:
isOpen in interface org.xmldb.api.base.Collection
Returns:
true if the collection connection is open, false otherwise.
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

listChildCollections

public java.lang.String[] listChildCollections()
                                        throws org.xmldb.api.base.XMLDBException
Returns a list of child collections

Specified by:
listChildCollections in interface org.xmldb.api.base.Collection
Returns:
The list of child collections
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

listResources

public java.lang.String[] listResources()
                                 throws org.xmldb.api.base.XMLDBException
Lists all resources associated with this collection.

Specified by:
listResources in interface org.xmldb.api.base.Collection
Returns:
A list of resources ids.
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

removeResource

public void removeResource(org.xmldb.api.base.Resource resource)
                    throws org.xmldb.api.base.XMLDBException
Removes the specified resource from this collection.

Specified by:
removeResource in interface org.xmldb.api.base.Collection
Parameters:
resource - The resource to remove.
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

setProperty

public void setProperty(java.lang.String str,
                        java.lang.String str1)
                 throws org.xmldb.api.base.XMLDBException
Throws a NOT_IMPLEMENTED exception.

Specified by:
setProperty in interface org.xmldb.api.base.Configurable
Parameters:
str - Ignored
str1 - Ignored.
Throws:
org.xmldb.api.base.XMLDBException - as ErrorCodes.NOT_IMPLEMENTED

storeResource

public void storeResource(org.xmldb.api.base.Resource resource)
                   throws org.xmldb.api.base.XMLDBException
Stores the specified resource in this collection.

Specified by:
storeResource in interface org.xmldb.api.base.Collection
Parameters:
resource - The resource to store.
Throws:
org.xmldb.api.base.XMLDBException - All exception are caught and rethrown as one.

getCollectionTransport

public gov.noaa.gdsg.xmldbremote.Collection getCollectionTransport()
Returns the collection transport object associated with this Collection

Returns:
The collection transport object


Copyright © 2004-2005 DOC > NOAA > NGDC > EDSD. All Rights Reserved.