org.planx.xmlstore
Interface XMLStore<R extends Reference>

All Known Subinterfaces:
ExecXMLStore<R>
All Known Implementing Classes:
AbstractXMLStore, DistributedXMLStore, ExecuteXMLStore, LocalXMLStore, OptimisticReadXMLStore, RemoteXMLStore, TranslatorXMLStore

public interface XMLStore<R extends Reference>

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.
 NameServer<R> getNameServer()
          Returns the NameServer with the largest scope associated with this XMLStore.
 Node load(R ref)
          Loads XML data identified by a reference.
 R save(Node node)
          Saves the XML data represented by the specified Node.
 

Method Detail

save

R 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(R 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

getNameServer

NameServer<R> getNameServer()
Returns the NameServer with the largest scope associated with this XMLStore. That is, an XMLStore that stores data in a distributed setting should return a global NameServer for the XMLStore network in which it participates and not a local NameServer (even though it may also have access to such an entity).


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 © 2004-2005 Plan-X. All Rights Reserved.