ajanta.naming
Class NREntry

java.lang.Object
  |
  +--ajanta.util.AjantaIdentity
        |
        +--ajanta.naming.NREntry
All Implemented Interfaces:
java.security.Principal, java.io.Serializable
Direct Known Subclasses:
AgentNREntry, AgentServerNREntry

public class NREntry
extends AjantaIdentity
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
NREntry(ajanta.naming.URN name)
          Name Registry Entry object keeps needed information for an entry.
NREntry(ajanta.naming.URN name, java.security.PublicKey e, java.security.PublicKey v)
          Name Registry Entry object keeps needed information for an entry Owner of the acl entry for this nrEntry is the name of the entry
NREntry(ajanta.naming.URN name, java.net.URL location)
          Name Registry Entry object keeps needed information for an entry Owner of the acl entry for this nrEntry is the name of the entry
NREntry(ajanta.naming.URN name, java.net.URL location, java.security.PublicKey encrypt, java.security.PublicKey verify)
          Name Registry Entry object keeps needed information for an entry Owner of the acl entry for this nrEntry is the name of the entry
NREntry(ajanta.naming.URN owner, ajanta.naming.URN name)
          Name Registry Entry object keeps needed information for an entry
NREntry(ajanta.naming.URN owner, ajanta.naming.URN name, java.security.PublicKey e, java.security.PublicKey v)
          Name Registry Entry object keeps needed information for an entry
NREntry(ajanta.naming.URN owner, ajanta.naming.URN name, java.net.URL location)
          Name Registry Entry object keeps needed information for an entry
NREntry(ajanta.naming.URN owner, ajanta.naming.URN name, java.net.URL location, java.security.PublicKey encrypt, java.security.PublicKey verify)
          Name Registry Entry object keeps needed information for an entry
 
Method Summary
 boolean addAclOwner(ajanta.naming.URN caller, ajanta.naming.URN owner)
          Adds an owner.
 boolean addCreateNamePermission(java.security.Principal owner, java.security.Principal prin)
          Sets CREATE_NAME permission for the principle.
 boolean addCreateNamePermission(ajanta.naming.URN owner, ajanta.naming.URN prin)
          Sets CREATE_NAME permission for the principle.
 void addLocation(java.net.URL location)
          Adds a location for the current entry, a urn can have one to many location mapping
 boolean addWritePermission(java.security.Principal owner, java.security.Principal prin)
          Sets WRITE permission for the principle.
 boolean addWritePermission(ajanta.naming.URN owner, ajanta.naming.URN prin)
          Sets WRITE permission for the principle.
 boolean checkCreateNamePermission(java.security.Principal prin)
          Checks if the specified principal has create name permission
 boolean checkWritePermission(java.security.Principal prin)
          Checks if the specified principal has write permission
 java.security.acl.Acl getAcl()
          return the acl for this entry
 java.security.cert.X509Certificate getCertificate()
           
 ajanta.naming.URN getCreationDomain()
          Return the creation domain for this urn.
 java.security.PublicKey getEncryptKey()
          return the encryption key for this entry
 long getLastAccessTime()
          return the last access time for this entry
 long getLastModTime()
          return the last modification time for this entry
 java.net.URL getURL()
          return the first location in the vector list of this urn
 java.util.Vector getURLs()
          returs all the location for this urn
 ajanta.naming.URN getURN()
          return the urn of this entry
 java.security.PublicKey getVerifyKey()
          return the signature varification key for this entry
 boolean isAclOwner(java.security.Principal owner)
          Checks if the passed Principal is a owner
 boolean removeCreateNamePermission(ajanta.naming.URN owner, ajanta.naming.URN prin)
          Reomoves CREATE_NAME permission for the principle.
 boolean removeWritePermission(ajanta.naming.URN owner, ajanta.naming.URN prin)
          Reomoves WRITE permission for the principle.
 void setCertificate(java.security.cert.X509Certificate certificate)
           
 java.lang.String toString()
          String representation
 
Methods inherited from class ajanta.util.AjantaIdentity
getName, getPublicKey, setPublicKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, hashCode
 

Constructor Detail

NREntry

public NREntry(ajanta.naming.URN owner,
               ajanta.naming.URN name)
Name Registry Entry object keeps needed information for an entry

Parameters:
owner - - owner of the acl entry for this nrEntry
name - urn of this entry

NREntry

public NREntry(ajanta.naming.URN name)
Name Registry Entry object keeps needed information for an entry. Owner of the acl entry for this nrEntry is the name of the entry

Parameters:
name - urn of this entry

NREntry

public NREntry(ajanta.naming.URN owner,
               ajanta.naming.URN name,
               java.net.URL location)
Name Registry Entry object keeps needed information for an entry

Parameters:
owner - - owner of the acl entry for this nrEntry
name - urn of this entry
location - - location of this entity

NREntry

public NREntry(ajanta.naming.URN name,
               java.net.URL location)
Name Registry Entry object keeps needed information for an entry Owner of the acl entry for this nrEntry is the name of the entry

Parameters:
name - urn of this entry
location - - location of this entity

NREntry

public NREntry(ajanta.naming.URN owner,
               ajanta.naming.URN name,
               java.net.URL location,
               java.security.PublicKey encrypt,
               java.security.PublicKey verify)
Name Registry Entry object keeps needed information for an entry

Parameters:
owner - - owner of the acl entry for this nrEntry
name - urn of this entry
location - - location of this entity
encrypt - - public key of encruption key pair
verify - - public key of verification key pair

NREntry

public NREntry(ajanta.naming.URN name,
               java.net.URL location,
               java.security.PublicKey encrypt,
               java.security.PublicKey verify)
Name Registry Entry object keeps needed information for an entry Owner of the acl entry for this nrEntry is the name of the entry

Parameters:
name - urn of this entry
location - - location of this entity
encrypt - - public key of encruption key pair
verify - - public key of verification key pair

NREntry

public NREntry(ajanta.naming.URN owner,
               ajanta.naming.URN name,
               java.security.PublicKey e,
               java.security.PublicKey v)
Name Registry Entry object keeps needed information for an entry

Parameters:
owner - - owner of the acl entry for this nrEntry
name - urn of this entry
e - - public key of encruption key pair
v - - public key of verification key pair

NREntry

public NREntry(ajanta.naming.URN name,
               java.security.PublicKey e,
               java.security.PublicKey v)
Name Registry Entry object keeps needed information for an entry Owner of the acl entry for this nrEntry is the name of the entry

Parameters:
name - - urn of this entry
e - - public key of encruption key pair
v - - public key of verification key pair
Method Detail

getURN

public ajanta.naming.URN getURN()
return the urn of this entry

Overrides:
getURN in class AjantaIdentity

addLocation

public void addLocation(java.net.URL location)
Adds a location for the current entry, a urn can have one to many location mapping

Parameters:
location - - url to be added for this name

getURLs

public java.util.Vector getURLs()
returs all the location for this urn


getURL

public java.net.URL getURL()
return the first location in the vector list of this urn


getCreationDomain

public ajanta.naming.URN getCreationDomain()
Return the creation domain for this urn. currently creation domain is encoded as the first substring of a urn


addAclOwner

public boolean addAclOwner(ajanta.naming.URN caller,
                           ajanta.naming.URN owner)
                    throws java.security.acl.NotOwnerException
Adds an owner. Only owners can modify ACL contents. The caller principal must be an owner of the ACL in order to invoke this method. That is, only an owner can add another owner. The initial owner is configured at ACL construction time.

Parameters:
caller - - the principal invoking this method. It must be an owner of the ACL.
owner - - the owner that should be added to the list of owners.
Returns:
true if successful, false if owner is already an owner. Owner will have default Write and CREATE permission
java.security.acl.NotOwnerException

addCreateNamePermission

public boolean addCreateNamePermission(ajanta.naming.URN owner,
                                       ajanta.naming.URN prin)
Sets CREATE_NAME permission for the principle. If the permission is already set do nothing, else set the permission

Parameters:
owner - - owner of the Entry
prin - - the principle who will get the WRITE permission
Returns:
false if owner is not owner of the acl else true.

addCreateNamePermission

public boolean addCreateNamePermission(java.security.Principal owner,
                                       java.security.Principal prin)
Sets CREATE_NAME permission for the principle. If the permission is already set do nothing, else set the permission

Parameters:
owner - - owner of the Entry
prin - - the principle who will get the WRITE permission
Returns:
false if owner is not owner of the acl else true.

addWritePermission

public boolean addWritePermission(ajanta.naming.URN owner,
                                  ajanta.naming.URN prin)
Sets WRITE permission for the principle. If the permission is already set do nothing, else set the permission

Parameters:
owner - - owner of the Entry
prin - - the principle who will get the CREATE_NAME permission
Returns:
false if owner is not owner of the acl else true.

addWritePermission

public boolean addWritePermission(java.security.Principal owner,
                                  java.security.Principal prin)
Sets WRITE permission for the principle. If the permission is already set do nothing, else set the permission

Parameters:
owner - - owner of the Entry
prin - - the principle who will get the CREATE_NAME permission
Returns:
false if owner is not owner of the acl else true.

removeWritePermission

public boolean removeWritePermission(ajanta.naming.URN owner,
                                     ajanta.naming.URN prin)
Reomoves WRITE permission for the principle. If the permission is already set return false, else set the permission

Parameters:
owner - - owner of the Entry
prin - - the principle from whom the WRITE permission will be removed
Returns:
false if owner is not owner of the acl else true.

removeCreateNamePermission

public boolean removeCreateNamePermission(ajanta.naming.URN owner,
                                          ajanta.naming.URN prin)
Reomoves CREATE_NAME permission for the principle. If the permission is already set return false, else set the permission

Parameters:
owner - - owner of the Entry
prin - - the principle from whom the CREATE_NAME permission will be removed
Returns:
false if owner is not owner of the acl else true.

checkCreateNamePermission

public boolean checkCreateNamePermission(java.security.Principal prin)
Checks if the specified principal has create name permission

Parameters:
prin - - the principal who's permission will be checked
Returns:
false if it does not have the CREATE_NAME permission, else true

checkWritePermission

public boolean checkWritePermission(java.security.Principal prin)
Checks if the specified principal has write permission

Parameters:
prin - - the principal who's permission will be checked
Returns:
false if it does not have the WRITE permission, else true

isAclOwner

public boolean isAclOwner(java.security.Principal owner)
Checks if the passed Principal is a owner


getLastAccessTime

public long getLastAccessTime()
return the last access time for this entry


getLastModTime

public long getLastModTime()
return the last modification time for this entry


getVerifyKey

public java.security.PublicKey getVerifyKey()
return the signature varification key for this entry


getEncryptKey

public java.security.PublicKey getEncryptKey()
return the encryption key for this entry


getAcl

public java.security.acl.Acl getAcl()
return the acl for this entry


toString

public java.lang.String toString()
String representation

Specified by:
toString in interface java.security.Principal
Overrides:
toString in class java.lang.Object

setCertificate

public void setCertificate(java.security.cert.X509Certificate certificate)

getCertificate

public java.security.cert.X509Certificate getCertificate()