ajanta.naming
Class NameRegistryImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--ajanta.naming.NameRegistryImpl
All Implemented Interfaces:
NameRegistry, java.rmi.Remote, java.io.Serializable

public class NameRegistryImpl
extends java.rmi.server.UnicastRemoteObject
implements NameRegistry

See Also:
Serialized Form

Field Summary
protected  ajanta.util.Ticketing tkt
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
NameRegistryImpl(ajanta.naming.URN nameRegistry)
          CONSTRUCTOR
 
Method Summary
 void adminRebindNameRegistry(ajanta.naming.URN urn, ajanta.naming.NREntry entry, ajanta.util.Ticket ticket)
          Administrative rebind to add entries in local name registry.
 ajanta.util.Ticket authenticate(ajanta.naming.URN caller, int nonce, ajanta.util.ContextObject context)
          gets the initial ticket from name registry
 void bind(ajanta.naming.URN urn, ajanta.naming.NREntry entry, ajanta.util.Ticket ticket)
          This call is used to bind an entry to local name registry by a agent server.
 void bind(ajanta.naming.URN urn, ajanta.naming.NREntry entry, ajanta.naming.URN binder, ajanta.util.Ticket ticket)
          This call is used to bind an entry to remote name registry by a namre registry.
 java.security.cert.X509Certificate getCertificate(ajanta.naming.URN urn)
           
 java.net.URL getCodeBaseURL(ajanta.naming.URN urn)
          returns the code base location of an agent server.
 java.security.PublicKey getEncryptKey(ajanta.naming.URN urn)
          return the public key encryption key pair
 java.security.cert.X509Certificate getNRCertificate()
           
 java.security.PublicKey getNRVerifyKey(ajanta.naming.URN urn)
          return the verification key of a name registry for the signature key pair
 java.security.PublicKey getPublicKey(ajanta.naming.URN urn)
          return the public key encryption key pair
 java.net.URL getURL(ajanta.naming.URN urn)
          Returs the first entry of the url list for this entry.
 java.util.Vector getURLs(ajanta.naming.URN urn)
          return the locations associated with this name
 java.security.PublicKey getVerifyKey(ajanta.naming.URN urn)
          return the verification key for the signature key pair
 ajanta.naming.NREntry lookup(ajanta.naming.URN urn)
          Returns the NREntry object associated with the specified name in the registry.
static void main(java.lang.String[] argv)
          main program starts up the server and waits for clients to invoke
 ajanta.naming.URN newURN()
          Return new URN in this Name-Server namespace
 void rebind(ajanta.naming.URN urn, ajanta.naming.NREntry entry, ajanta.util.Ticket ticket)
          This call is used to rebind an entry to local name registry by an agent server.
 void rebind(ajanta.naming.URN urn, ajanta.naming.NREntry entry, ajanta.naming.URN binder, ajanta.util.Ticket ticket)
          This call is used to rebind an entry to remote name registry by a namre registry.
 void rebindAgentServer(ajanta.naming.URN ag, ajanta.naming.URN server, ajanta.util.Ticket ticket)
          updates the agent server location for an agent entry.
 void rebindAgentServer(ajanta.naming.URN ag, ajanta.naming.URN server, ajanta.naming.URN binder, ajanta.util.Ticket ticket)
          updates the agent server location for an agent entry.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

tkt

protected ajanta.util.Ticketing tkt
Constructor Detail

NameRegistryImpl

public NameRegistryImpl(ajanta.naming.URN nameRegistry)
                 throws java.rmi.RemoteException
CONSTRUCTOR

Method Detail

authenticate

public ajanta.util.Ticket authenticate(ajanta.naming.URN caller,
                                       int nonce,
                                       ajanta.util.ContextObject context)
gets the initial ticket from name registry

Specified by:
authenticate in interface NameRegistry
Parameters:
caller - - client urn
nonce - - challenge
context - - any aditional context for the ticket
Returns:
a Ticket from server, which contatins the nonce signed by the name registry

bind

public void bind(ajanta.naming.URN urn,
                 ajanta.naming.NREntry entry,
                 ajanta.util.Ticket ticket)
          throws java.rmi.AlreadyBoundException,
                 java.rmi.RemoteException
This call is used to bind an entry to local name registry by a agent server. binds an entry in the name registry. If an entry for this urn already exists throw an exception. the binder or ticket signer needs to have create name permission in this namespace. On success binder will be a owner of the acl of this entry and have create name and write permission on the entry.

Specified by:
bind in interface NameRegistry
Parameters:
urn - - the urn will be registered
entry - - the entry wich contain an acl
ticket - - needed for authentication. ticket.signer is the binder
Throws:
java.rmi.RemoteException - If remote operation failed
java.rmi.AlreadyBoundException - If name is already bound.

bind

public void bind(ajanta.naming.URN urn,
                 ajanta.naming.NREntry entry,
                 ajanta.naming.URN binder,
                 ajanta.util.Ticket ticket)
          throws java.rmi.AlreadyBoundException,
                 java.rmi.RemoteException
This call is used to bind an entry to remote name registry by a namre registry. binds an entry in the name registry. If an entry for this urn already exists throw an exception. the binder here is server ticket signer, needs to have create name permission in this namespace. On success binder will be a owner of the acl of this entry and have create name and write permission on the entry.

Specified by:
bind in interface NameRegistry
Parameters:
urn - - the urn will be registered
entry - - the entry wich contain an acl
binder - - server's ticket.signer is the binder
ticket - - needed for authentication
java.rmi.AlreadyBoundException
java.rmi.RemoteException

lookup

public ajanta.naming.NREntry lookup(ajanta.naming.URN urn)
                             throws java.rmi.RemoteException
Returns the NREntry object associated with the specified name in the registry. // TAN If the urn looked up is a name-registry ( a URN and its creation domain URN are same), the lookup is not propogated to other remote name registries. // TAN Such a lookup is only valid among name registries.

Specified by:
lookup in interface NameRegistry
Parameters:
urn - - the name of the entry
java.rmi.RemoteException

rebind

public void rebind(ajanta.naming.URN urn,
                   ajanta.naming.NREntry entry,
                   ajanta.util.Ticket ticket)
            throws java.rmi.RemoteException
This call is used to rebind an entry to local name registry by an agent server. If an entry already exists for this urn and the Ticket signer has write permission and is a owner of the acl of the entry, replace the old entry with new entry If no previous entry exists and if the Ticket signer has create name permission, create a new entry. In both cases give the Ticket signer write and create permission on this entry. In the creating new entry case ticket signer will become a owner of the acl as bind.

Specified by:
rebind in interface NameRegistry
Parameters:
urn - - the urn will be registered
entry - - the entry wich contain an acl
ticket - - needed for authentication. ticket.signer is the binder
Throws:
java.rmi.RemoteException - If remote operation failed

adminRebindNameRegistry

public void adminRebindNameRegistry(ajanta.naming.URN urn,
                                    ajanta.naming.NREntry entry,
                                    ajanta.util.Ticket ticket)
                             throws java.rmi.RemoteException
Administrative rebind to add entries in local name registry. The administrative rebind bypass creation domain check for an entry

Specified by:
adminRebindNameRegistry in interface NameRegistry
Parameters:
urn - - the urn will be registered
entry - - the entry wich contain an acl
ticket - - needed for authentication. ticket.signer is the binder
java.rmi.RemoteException

getNRVerifyKey

public java.security.PublicKey getNRVerifyKey(ajanta.naming.URN urn)
                                       throws java.rmi.RemoteException
return the verification key of a name registry for the signature key pair

Specified by:
getNRVerifyKey in interface NameRegistry
java.rmi.RemoteException

rebind

public void rebind(ajanta.naming.URN urn,
                   ajanta.naming.NREntry entry,
                   ajanta.naming.URN binder,
                   ajanta.util.Ticket ticket)
            throws java.rmi.RemoteException
This call is used to rebind an entry to remote name registry by a namre registry. If an entry already exists for this urn and the binder has write permission and is a owner of the acl of the entry, replace the old entry with new entry // NOT IMPLEMENTED, MAY NEED FROM REMOTE BIND // * If an entry already exists for this urn and the Ticket signer // * has write permission but not an owner of the acl, the new entry acl // * is replaced by the old one // If no previous entry exists and if the binder has create name permission, create a new entry. In both cases give the binder write and create permission on this entry. In the creating new entry, binder will become a owner of the acl as bind.

Specified by:
rebind in interface NameRegistry
Parameters:
urn - - the urn will be registered
entry - - the entry wich contain an acl
binder - - server's ticket.signer is the binder
ticket - - needed for authentication.
java.rmi.RemoteException

getURLs

public java.util.Vector getURLs(ajanta.naming.URN urn)
                         throws java.rmi.RemoteException
return the locations associated with this name

Specified by:
getURLs in interface NameRegistry
java.rmi.RemoteException

getURL

public java.net.URL getURL(ajanta.naming.URN urn)
                    throws java.rmi.RemoteException
Returs the first entry of the url list for this entry. Most of the cases it is the only entry

Specified by:
getURL in interface NameRegistry
java.rmi.RemoteException

getCodeBaseURL

public java.net.URL getCodeBaseURL(ajanta.naming.URN urn)
                            throws java.rmi.RemoteException
returns the code base location of an agent server. if the entry is not an agent server entry, throws a remote exception

Specified by:
getCodeBaseURL in interface NameRegistry
java.rmi.RemoteException

getPublicKey

public java.security.PublicKey getPublicKey(ajanta.naming.URN urn)
                                     throws java.rmi.RemoteException
return the public key encryption key pair

java.rmi.RemoteException

getEncryptKey

public java.security.PublicKey getEncryptKey(ajanta.naming.URN urn)
                                      throws java.rmi.RemoteException
return the public key encryption key pair

Specified by:
getEncryptKey in interface NameRegistry
java.rmi.RemoteException

getVerifyKey

public java.security.PublicKey getVerifyKey(ajanta.naming.URN urn)
                                     throws java.rmi.RemoteException
return the verification key for the signature key pair

Specified by:
getVerifyKey in interface NameRegistry
java.rmi.RemoteException

rebindAgentServer

public void rebindAgentServer(ajanta.naming.URN ag,
                              ajanta.naming.URN server,
                              ajanta.util.Ticket ticket)
                       throws java.rmi.RemoteException
updates the agent server location for an agent entry. the new agent server will get create name and write permission on the entry At the same time the previous server if not an owner of the acl, will lose the create name and write permission.

Specified by:
rebindAgentServer in interface NameRegistry
Parameters:
ag - - agent name
server - - the new agentserver location
ticket - - needed for authentication. ticket.signer is the binder
java.rmi.RemoteException

rebindAgentServer

public void rebindAgentServer(ajanta.naming.URN ag,
                              ajanta.naming.URN server,
                              ajanta.naming.URN binder,
                              ajanta.util.Ticket ticket)
                       throws java.rmi.RemoteException
updates the agent server location for an agent entry. the new agent server will get create name and write permission on the entry At the same time the previous server if not an owner of the acl, will lose the create name and write permission

Specified by:
rebindAgentServer in interface NameRegistry
Parameters:
ag - - agent name
server - - the new agentserver location
binder - - server's ticket.signer is the binder
ticket - - needed for authentication. ticket.signer is the binder
java.rmi.RemoteException

newURN

public ajanta.naming.URN newURN()
                         throws java.rmi.RemoteException
Return new URN in this Name-Server namespace

Specified by:
newURN in interface NameRegistry
java.rmi.RemoteException

getCertificate

public java.security.cert.X509Certificate getCertificate(ajanta.naming.URN urn)
                                                  throws java.rmi.RemoteException
Specified by:
getCertificate in interface NameRegistry
Parameters:
urn - URN of entity whose certificate is being requested
Returns:
X509 certificate
java.rmi.RemoteException

getNRCertificate

public java.security.cert.X509Certificate getNRCertificate()
                                                    throws java.rmi.RemoteException
Specified by:
getNRCertificate in interface NameRegistry
java.rmi.RemoteException

main

public static void main(java.lang.String[] argv)
main program starts up the server and waits for clients to invoke