org.openpermis.basic
Class InternalSubject

java.lang.Object
  extended by org.openpermis.policy.bean.basic.BasicPart
      extended by org.openpermis.basic.InternalSubject
All Implemented Interfaces:
Serializable, Identifiable, Part, Subject

public class InternalSubject
extends BasicPart
implements Subject

A subject that only knows explicitly assigned roles and issuers.

See Also:
Serialized Form
Since:
0.1.0

Nested Class Summary
private  class InternalSubject.RoleKey
           
private  class InternalSubject.RoleSubjectKey
           
 
Field Summary
private  Map<InternalSubject.RoleKey,Set<Subject>> roleIssuerMap
          A map registering which roles this subject has and who issued them.
private  Map<InternalSubject.RoleSubjectKey,TimePeriod> roleSubjectPeriodMap
          A map registering the validity of role assignments.
private static long serialVersionUID
           
 
Constructor Summary
InternalSubject(URI identity)
          Creates a subject without any roles.
 
Method Summary
 void assignRole(Subject issuer, String roleName, URI hierarchyUri, TimePeriod validity)
          Assigns a role to this subject.
protected  boolean comparablePart(BasicPart part)
          Check if the part specified is comparable to this part.
 Set<Role> getAssignedRoles(TimeStamp timeStamp, Set<Role> roles)
          Returns a subset of all roles held by this subject at the current time.
 Set<Subject> getIssuersOf(Role role)
          Returns the subjects who issued the role to this.
private  InternalSubject.RoleKey getRoleKey(Role role)
           
 TimePeriod getValidityOf(Role role, Subject issuer)
          Returns the TimePeriod of the specific role assignment consisting of issuer and role.
 
Methods inherited from class org.openpermis.policy.bean.basic.BasicPart
appendDetails, appendPartDetails, equalPart, equals, getIdentity, getName, getSerialNumberString, getSimpleClassName, hashCode, hasPartIdentity, hasPartName, isChildCollectionValid, isChildNotNull, isChildNullOrValid, isChildValid, isIdentityValid, isNameValid, isPartValid, isValid, notifyIdentityChange, notifyNameChange, partHashCode, reportProblem, setIdentity, setName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openpermis.policy.Identifiable
getIdentity
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Constant Field Value:
-5706090972924620861L
Since:
0.1.0

roleIssuerMap

private final Map<InternalSubject.RoleKey,Set<Subject>> roleIssuerMap
A map registering which roles this subject has and who issued them.


roleSubjectPeriodMap

private final Map<InternalSubject.RoleSubjectKey,TimePeriod> roleSubjectPeriodMap
A map registering the validity of role assignments.

Constructor Detail

InternalSubject

public InternalSubject(URI identity)
Creates a subject without any roles.

Parameters:
identity - the identity of this subject.
Since:
0.1.0
Method Detail

assignRole

public void assignRole(Subject issuer,
                       String roleName,
                       URI hierarchyUri,
                       TimePeriod validity)
Assigns a role to this subject.

Parameters:
issuer - the Subject assigning the role to this subject.
roleName - the name of the role that is being assigned.
hierarchyUri - the URI of the role hierarchy that contains the role being assigned.
validity - a TimePeriod.
Since:
0.3.0

getRoleKey

private InternalSubject.RoleKey getRoleKey(Role role)
Since:
0.3.0

comparablePart

protected boolean comparablePart(BasicPart part)
Description copied from class: BasicPart
Check if the part specified is comparable to this part.

Specified by:
comparablePart in class BasicPart
Parameters:
part - the part to check.
See Also:
BasicPart
Returns:
true if the part supplied is comparable to this part.
Since:
0.1.0

getAssignedRoles

public Set<Role> getAssignedRoles(TimeStamp timeStamp,
                                  Set<Role> roles)
Description copied from interface: Subject
Returns a subset of all roles held by this subject at the current time.

Specified by:
getAssignedRoles in interface Subject
Parameters:
timeStamp - the current time, a TimeStamp.
roles - a set of Roles.
Returns:
a subset of roles containing only those roles that have been assigned to this subject.
Since:
0.1.0

getIssuersOf

public Set<Subject> getIssuersOf(Role role)
Description copied from interface: Subject
Returns the subjects who issued the role to this.

Specified by:
getIssuersOf in interface Subject
Parameters:
role - a Role. The subject assumes that it previously confirmed with Subject.getAssignedRoles(TimeStamp, Set) to have this role.
Returns:
the subjects who issued the role to this.
Since:
0.1.0

getValidityOf

public TimePeriod getValidityOf(Role role,
                                Subject issuer)
Description copied from interface: Subject
Returns the TimePeriod of the specific role assignment consisting of issuer and role.

Specified by:
getValidityOf in interface Subject
Parameters:
role - a Role that was assigned.
issuer - a Subject that assigned the role.
Returns:
the TimePeriod of the specific role assignment consisting of issuer and role.
Since:
0.3.0


PERMIS Role Based Access Control 0.3.0 (Build 14)
2009/05/08 09:06:22
Copyright (c) 2002-2007 Ergon Informatik AG