dermi.registry.pastry
Class Registry

java.lang.Object
  extended by dermi.registry.pastry.Registry

public class Registry
extends java.lang.Object

This class implements the decentralized object location registry

Version:
1.2
Author:
Carles Pairot , Ruben Mondejar

Nested Class Summary
protected  class Registry.NamingCommand
          Common superclass for data reception commands.
 
Constructor Summary
Registry(rice.p2p.commonapi.Node pn, java.util.Properties bunshinProperties)
          Constructor for the decentralized registry: entry point and local start
Registry(java.lang.String bunshinProperties)
           
 
Method Summary
 void bind(java.lang.String name, java.util.Properties ref)
          Binds the specified name to a remote object.
 java.util.Collection getIncomingLinks(java.lang.String context, Id id)
           
 java.util.Collection getOutgoingLinks(java.lang.String context, Id id)
           
 java.util.Hashtable getReplicaInfo()
           
 java.util.Hashtable getStorageInfo()
           
 boolean insert(Id id, java.io.Serializable props, java.lang.String f)
          Insert object's metadata into the registry
 boolean insert(java.lang.String context, Id id, java.io.Serializable props, java.lang.String f)
           
 void insert(java.lang.String context, java.lang.String tokens, java.lang.String id, java.io.Serializable value)
           
 boolean insertSecure(java.lang.String context, Id id, java.io.Serializable props, java.lang.String f, java.lang.String pass)
           
 boolean insertSecure(java.lang.String context, Id id, java.io.Serializable props, java.lang.String f, java.lang.String pass, boolean getcheck)
           
 void insertURL(java.lang.String context, Id id, java.net.URL url, java.lang.String f)
           
 void leave()
          It left the Bunshin Application
 java.util.Collection list(java.lang.String root)
          Returns the list of objects bound below the specified root
 ERemote lookup(DermiConnection connection, java.lang.String name, java.lang.String communityId, java.lang.String className)
           
 java.io.Serializable lookup(Id id)
          Returns a serializable object from the decentralized registry
 ERemote lookup(java.lang.String name)
          Returns a reference, for the remote object associated with the specified name (or null if not bound)
 java.io.Serializable lookup(java.lang.String context, Id id)
           
 java.io.Serializable lookup(java.lang.String context, Id id, java.lang.String f)
           
 java.io.Serializable lookupSecure(java.lang.String context, Id id, java.lang.String f, java.lang.String pass)
           
 java.net.URL lookupURL(java.lang.String context, Id id, java.lang.String f)
           
 void modify(java.lang.String context, Id id, java.util.Collection values, java.lang.String f, boolean add)
           
 void modify(java.lang.String context, Id id, java.lang.Object value, java.lang.String f, boolean add)
           
 bunshin.util.ResultSortedQueue query(java.lang.String context, java.lang.String query_key)
           
 void rebind(java.lang.String name, java.util.Properties ref)
          Rebinds the specified name in the registry.
 void remove(java.lang.String context, Id id, java.lang.String field)
           
 void remove(java.lang.String context, java.lang.String tokens, java.lang.String id)
           
 void removeRemoteListener(java.lang.String context, Id id, java.lang.String f)
           
 void removeSer(Id id)
           
 void removeSer(java.lang.String key)
           
 void setInfoContext(java.lang.String context, java.lang.String path, java.lang.String url, java.net.URL[] URLsList)
           
 void setRemoteListener(java.lang.String context, Id id, bunshin.RemoteListener listener, java.lang.String f)
           
 void unbind(java.lang.String name)
          Unbinds the specified name from the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Registry

public Registry(java.lang.String bunshinProperties)
         throws RemoteException
Throws:
RemoteException

Registry

public Registry(rice.p2p.commonapi.Node pn,
                java.util.Properties bunshinProperties)
Constructor for the decentralized registry: entry point and local start

Parameters:
pn - Node Bunshin needs the Pastry node to build itself on top of
Method Detail

setInfoContext

public void setInfoContext(java.lang.String context,
                           java.lang.String path,
                           java.lang.String url,
                           java.net.URL[] URLsList)
                    throws RemoteException
Throws:
RemoteException

leave

public void leave()
           throws RemoteException
It left the Bunshin Application

Throws:
RemoteException - If the connection with the event service fails.

remove

public void remove(java.lang.String context,
                   Id id,
                   java.lang.String field)

removeSer

public void removeSer(Id id)

removeSer

public void removeSer(java.lang.String key)

lookup

public ERemote lookup(java.lang.String name)
               throws RemoteException
Returns a reference, for the remote object associated with the specified name (or null if not bound)

Parameters:
name - Name of the remote object in the Registry
Returns:
Eremote Reference to the remote object
Throws:
RemoteException - If the connection fails

lookup

public ERemote lookup(DermiConnection connection,
                      java.lang.String name,
                      java.lang.String communityId,
                      java.lang.String className)
               throws RemoteException
Throws:
RemoteException

lookup

public java.io.Serializable lookup(Id id)
                            throws RemoteException
Returns a serializable object from the decentralized registry

Parameters:
id - Id Object's Id
Returns:
Serializable Object from the registry returned
Throws:
RemoteException - If unable to connect to the registry

lookup

public java.io.Serializable lookup(java.lang.String context,
                                   Id id)
                            throws RemoteException
Throws:
RemoteException

lookup

public java.io.Serializable lookup(java.lang.String context,
                                   Id id,
                                   java.lang.String f)
                            throws RemoteException
Throws:
RemoteException

lookupSecure

public java.io.Serializable lookupSecure(java.lang.String context,
                                         Id id,
                                         java.lang.String f,
                                         java.lang.String pass)
                                  throws RemoteException
Throws:
RemoteException

lookupURL

public java.net.URL lookupURL(java.lang.String context,
                              Id id,
                              java.lang.String f)
                       throws RemoteException
Throws:
RemoteException

bind

public void bind(java.lang.String name,
                 java.util.Properties ref)
          throws RemoteException
Binds the specified name to a remote object.

Parameters:
name - Name of the remote object to be used (should be unique)
ref - Remote object reference to bind
Throws:
RemoteException - If the connection with the event service fails.

insert

public boolean insert(Id id,
                      java.io.Serializable props,
                      java.lang.String f)
Insert object's metadata into the registry

Parameters:
id - Id Object's Id
props - Properties Metadata to be inserted
boolean - exclusive - Tells whether inserted value overwrites a previously existing one

insert

public boolean insert(java.lang.String context,
                      Id id,
                      java.io.Serializable props,
                      java.lang.String f)

insertSecure

public boolean insertSecure(java.lang.String context,
                            Id id,
                            java.io.Serializable props,
                            java.lang.String f,
                            java.lang.String pass)

insertSecure

public boolean insertSecure(java.lang.String context,
                            Id id,
                            java.io.Serializable props,
                            java.lang.String f,
                            java.lang.String pass,
                            boolean getcheck)

unbind

public void unbind(java.lang.String name)
            throws RemoteException
Unbinds the specified name from the registry.

Parameters:
name - Id of the remote object
Throws:
dermi.NotBoundException - - if the Registry does not contains this Id.
dermi.RemoteException - - if the connection with the event service fails.
RemoteException

rebind

public void rebind(java.lang.String name,
                   java.util.Properties ref)
            throws RemoteException
Rebinds the specified name in the registry.

Parameters:
name - Id of the remote object
ref - remote object reference to bind
Throws:
dermi.RemoteException - - if the connection with the event service fails.
RemoteException

getStorageInfo

public java.util.Hashtable getStorageInfo()

getReplicaInfo

public java.util.Hashtable getReplicaInfo()

list

public java.util.Collection list(java.lang.String root)
                          throws RemoteException
Returns the list of objects bound below the specified root

Parameters:
root - Hierarchical root (in the form "p2p://...")
Returns:
A collection containing the object's list
Throws:
RemoteException

insert

public void insert(java.lang.String context,
                   java.lang.String tokens,
                   java.lang.String id,
                   java.io.Serializable value)
            throws RemoteException
Throws:
RemoteException

query

public bunshin.util.ResultSortedQueue query(java.lang.String context,
                                            java.lang.String query_key)
                                     throws RemoteException
Throws:
RemoteException

remove

public void remove(java.lang.String context,
                   java.lang.String tokens,
                   java.lang.String id)
            throws RemoteException
Throws:
RemoteException

insertURL

public void insertURL(java.lang.String context,
                      Id id,
                      java.net.URL url,
                      java.lang.String f)

modify

public void modify(java.lang.String context,
                   Id id,
                   java.lang.Object value,
                   java.lang.String f,
                   boolean add)

modify

public void modify(java.lang.String context,
                   Id id,
                   java.util.Collection values,
                   java.lang.String f,
                   boolean add)

setRemoteListener

public void setRemoteListener(java.lang.String context,
                              Id id,
                              bunshin.RemoteListener listener,
                              java.lang.String f)

removeRemoteListener

public void removeRemoteListener(java.lang.String context,
                                 Id id,
                                 java.lang.String f)

getIncomingLinks

public java.util.Collection getIncomingLinks(java.lang.String context,
                                             Id id)
                                      throws RemoteException
Throws:
RemoteException

getOutgoingLinks

public java.util.Collection getOutgoingLinks(java.lang.String context,
                                             Id id)
                                      throws RemoteException
Throws:
RemoteException