org.planx.xmlstore
Interface XMLStore

All Known Implementing Classes:
AbstractXMLStore, DistributedXMLStore, LocalXMLStore, NetworkProxy, OptimisticReadXMLStore, OptimisticWriteXMLStore, ReadCacheXMLStore, ReplicatorXMLStore, TranslatorXMLStore, WriteBufferXMLStore, WriteCacheXMLStore

public interface XMLStore

An XMLStore provides facilities for persisting semi-structured data in the form of Nodes. Once persisted, data can be retrieved again using a Reference.

An XMLStore may assume that load(Reference)s are only applied to References produced by the store itself. However, it likely will not check that this is case. Indeed, many XMLStore decorators will work without any problems even if this is not case, though this is not guaranteed.

Author:
Kasper Bøgebjerg, Henning Niss, Thomas Ambus

Method Summary
 void close()
          The method is used to let the XMLStore properly commit all data to the underlying ressource, release resources, and so forth.
 Node load(Reference ref)
          Loads XML data identified by a reference.
 Reference save(Node node)
          Saves the XML data represented by the specified Node.
 

Method Detail

save

Reference save(Node node)
               throws IOException
Saves the XML data represented by the specified Node. The method returns a unique location independent reference, which can be used to load the node, when needed.

Parameters:
node - representing XML data in the form of semi-structured tree data
Returns:
a reference to the saved node/tree
Throws:
IOException - if an error occurs during disk, network, etc access

load

Node load(Reference ref)
          throws IOException,
                 UnknownReferenceException
Loads XML data identified by a reference. The returned value is semi-structured tree data, represented by a "root node" having 0 or more subtrees each represented by Nodes.

Parameters:
ref - the Reference to the data
Returns:
node representing the loaded XML data
Throws:
IOException - if an error occurs during disk, network, etc access
UnknownReferenceException - if the data referenced is not stored in the XMLStore or the Reference is of a type not supported by the XMLStore

close

void close()
           throws IOException
The method is used to let the XMLStore properly commit all data to the underlying ressource, release resources, and so forth. Once close has been issued on an XMLStore, the store is no longer available for handling requests. Any subsequent request to the store will result in an exception being thrown. An XMLStore implementation has to ensure that this happens.

Throws:
IOException - if it is not possible to properly close the store


Copyright © 2010. All Rights Reserved.