|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.planx.xmlstore.stores.RemoteXMLStore
public class RemoteXMLStore
A direct connection to a remote XMLStore peer. Used for
peer-to-peer transfers of data. In general, an application
programmer would want to use DistributedXMLStore to get
transparent location of data. However, this class is left exposed
to application programmers for use in cases where the programmer
does not wish to run a local XMLStore peer but rather connect to a
remote XMLStore. Note, that in this case all transfers will go
through the "gateway" XMLStore peer even though the XMLStore might
consist of many XMLStore peers.
See NetworkProtocol for a description of the protocol.
| Constructor Summary | |
|---|---|
RemoteXMLStore(InetAddress addr,
int port)
|
|
RemoteXMLStore(InetSocketAddress sockaddr)
|
|
RemoteXMLStore(String host,
int port)
|
|
| 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. |
ValueReference |
exec(ValueReference code,
ValueReference args)
Execute the code referenced by codeRef supplied
with the argument reference by argsRef. |
NameServer<ValueReference> |
getNameServer()
Returns the NameServer with the largest scope associated
with this XMLStore. |
Node |
load(ValueReference ref)
Loads XML data identified by a reference. |
ValueReference |
save(Node n)
The subtree rooted at the specified Node is sent to the
remote XMLStore and saved there. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RemoteXMLStore(String host,
int port)
throws IOException,
UnknownHostException
IOException
UnknownHostException
public RemoteXMLStore(InetSocketAddress sockaddr)
throws IOException
IOException
public RemoteXMLStore(InetAddress addr,
int port)
throws IOException
IOException| Method Detail |
|---|
public Node load(ValueReference ref)
throws IOException
XMLStoreNodes.
load in interface XMLStore<ValueReference>ref - the Reference to the data
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
public ValueReference save(Node n)
throws IOException
Node is sent to the
remote XMLStore and saved there. A Reference
to the root is returned.
save in interface XMLStore<ValueReference>n - representing XML data in the form of semi-structured tree data
IOException - if an error occurs during disk, network, etc accesspublic NameServer<ValueReference> getNameServer()
XMLStoreNameServer 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).
getNameServer in interface XMLStore<ValueReference>
public ValueReference exec(ValueReference code,
ValueReference args)
throws IOException,
ExecException
ExecXMLStorecodeRef supplied
with the argument reference by argsRef. Returns
a reference to the result of the execution.
exec in interface ExecXMLStore<ValueReference>code - the Reference to a
binary node containing class code implementing StoredCodeargs - reference to arguments
IOException - if an error occurs during loading of code or arguments
ExecException
public void close()
throws IOException
XMLStoreXMLStore 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.
close in interface XMLStore<ValueReference>IOException - if it is not possible to properly close the storepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||