issrg.pba.rbac
Class PermisTarget

java.lang.Object
  extended by issrg.pba.rbac.PermisTarget
All Implemented Interfaces:
LDAPEntry, Target, Entry

public class PermisTarget
extends java.lang.Object
implements Target, LDAPEntry

The Permis version of the Target that uses LDAP DNs or URLs. The object also knows what object class it is of, and therefore can be used for performing the target domain match.

Version:
0.2
Author:
A Otenko, E Ball, D W Chadwick

Constructor Summary
protected PermisTarget()
           
  PermisTarget(java.lang.String url)
          This constructor builds a Target based on its URL.
  PermisTarget(java.lang.String Name, java.lang.String[] ObjectClasses)
          This constructor builds a Target based on a distinguished name and a set of object classes.
 
Method Summary
 LDAPDNPrincipal getDN()
          This method returns the distinguished name of the target.
 java.security.Principal getEntryName()
          Does the same as getDN(), if the Target has been initialised with LDAP DN; otherwise, returns the Entry for the URL.
 java.lang.String getName()
          This method returns the LDAP DN of the target as a string e.g.
 java.lang.Object getTargetADI()
          This method returns Target ADI.
 boolean isObjectClass(java.lang.String Class)
          This checks to see if this target is of the indicated ObjectClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermisTarget

protected PermisTarget()

PermisTarget

public PermisTarget(java.lang.String Name,
                    java.lang.String[] ObjectClasses)
             throws RFC2253ParsingException
This constructor builds a Target based on a distinguished name and a set of object classes.

Parameters:
Name - a string describing the LDAP distinguished name of the target
ObjectClasses - an array of strings that are the various LDAP objectclasses that the Target has. These can be represented as user friendly strings e.g. printer or as an OID string e.g. 1.2.3.4.5.6 If the array is null, the Target is of any class (isObjectClass always returns true)
Throws:
RFC2253ParsingException

PermisTarget

public PermisTarget(java.lang.String url)
             throws BadURLException
This constructor builds a Target based on its URL. There must be a URLHandler registered that can create Entry from the URLs.

Parameters:
url - is the URL of the Target.
Throws:
BadURLException
See Also:
CustomisePERMIS#addURLHandler(String), URLHandler#addProtocol(URLHandler)
Method Detail

getName

public java.lang.String getName()
This method returns the LDAP DN of the target as a string e.g. "ou=ISI, o=salford, c=gb"

Returns:
the string representation of the LDAP DN, or the URL (depending on the constructor used)

getDN

public LDAPDNPrincipal getDN()
This method returns the distinguished name of the target.

Specified by:
getDN in interface LDAPEntry
Returns:
the LDAPDNPrincipal representing the X500 name; can be null, if the Target is indetified by a URL

getEntryName

public java.security.Principal getEntryName()
Does the same as getDN(), if the Target has been initialised with LDAP DN; otherwise, returns the Entry for the URL.

Specified by:
getEntryName in interface Entry
Returns:
Principal naming the entry; cannot be null

isObjectClass

public boolean isObjectClass(java.lang.String Class)
This checks to see if this target is of the indicated ObjectClass

Specified by:
isObjectClass in interface LDAPEntry
Parameters:
Class - the ObjectClass to be tested against
Returns:
true if the target is of the specified object class

getTargetADI

public java.lang.Object getTargetADI()
This method returns Target ADI. Targets return LDAPEntry for PermisRBAC objects as their ADI.

Specified by:
getTargetADI in interface Target
Returns:
the reference to the LDAPEntry object that describes the LDAP Entry of the target, or returns an Entry corresponding to the URL