org.openpermis.policy.bean.basic
Class BasicAuthority

java.lang.Object
  extended by org.openpermis.policy.bean.basic.BasicPart
      extended by org.openpermis.policy.bean.basic.BasicPartBean
          extended by org.openpermis.policy.bean.basic.BasicAuthority
All Implemented Interfaces:
Serializable, Authority, AuthorityBean, IdentifiableBean, PartBean, Identifiable, Part, Subject

public class BasicAuthority
extends BasicPartBean
implements AuthorityBean

Basic implementation of an authority bean.

See Also:
Serialized Form
Since:
0.1.0

Constructor Summary
protected BasicAuthority(SerialNumber serialNumber, URI identity)
          Creates an authority with the specified URI.
 
Method Summary
 void accept(List<PartBean> parents, MultiPartBeanVisitor visitor)
          Allows traversing the model according to the visitor pattern.
protected  boolean comparablePart(BasicPart entity)
          Check if the part specified is comparable to this part.
 Set<RoleDefinition> getAssignedRoleDefinitions(TimeStamp timeStamp, TimePeriodConstraint constraint)
          Returns a set of role definitions held by this subject at the current time.
 Set<Role> getAssignedRoles(TimeStamp timeStamp, TimePeriodConstraint constraint, Set<Role> roles)
          Returns a subset of all roles held by this subject at the current time.
 Set<Subject> getIssuersOf(Role roleRef)
          Returns the subjects who issued the role to this.
protected  String getSimpleClassName()
          Returns the simple implementation class name of this class.
 
Methods inherited from class org.openpermis.policy.bean.basic.BasicPartBean
accept, addPropertyChangeListener, equalSerialNumber, findBySerialNumber, firePropertyChange, getPartBeanType, getSerialNumber, getSerialNumberString, instanceOf, notifyIdentityChange, notifyNameChange, removePropertyChangeListener, toShortString
 
Methods inherited from class org.openpermis.policy.bean.basic.BasicPart
appendDetails, appendPartDetails, areIdentitiesUnique, areNamesUnique, checkLocalConsistency, checkLocalPartConsistency, equalPart, equals, getIdentity, getName, hashCode, hasPartIdentity, hasPartName, isIdentityValid, isNameValid, 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
 
Methods inherited from interface org.openpermis.policy.bean.PartBean
accept, addPropertyChangeListener, checkLocalPartConsistency, equalSerialNumber, findBySerialNumber, getPartBeanType, getSerialNumber, instanceOf, removePropertyChangeListener, toShortString
 
Methods inherited from interface org.openpermis.policy.Part
equals, hashCode, toString
 
Methods inherited from interface org.openpermis.policy.bean.IdentifiableBean
setIdentity
 

Constructor Detail

BasicAuthority

protected BasicAuthority(SerialNumber serialNumber,
                         URI identity)
Creates an authority with the specified URI.

Parameters:
serialNumber - the serial number of this part.
identity - the URI that identifies this authority.
Since:
0.1.0
Method Detail

getAssignedRoleDefinitions

public Set<RoleDefinition> getAssignedRoleDefinitions(TimeStamp timeStamp,
                                                      TimePeriodConstraint constraint)
Description copied from interface: Subject
Returns a set of role definitions held by this subject at the current time.

Specified by:
getAssignedRoleDefinitions in interface Subject
Parameters:
timeStamp - the current time, a TimeStamp.
constraint - to constrain the time period of the role assignment.
Returns:
the set of role definitions held by this subject at the current time, never null but may be empty if the subject does not hold any roles.
Since:
0.9.0

getAssignedRoles

public Set<Role> getAssignedRoles(TimeStamp timeStamp,
                                  TimePeriodConstraint constraint,
                                  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.
constraint - to constrain the time period of the role assignment.
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 roleRef)
Description copied from interface: Subject
Returns the subjects who issued the role to this.

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

accept

public void accept(List<PartBean> parents,
                   MultiPartBeanVisitor visitor)
Description copied from interface: PartBean
Allows traversing the model according to the visitor pattern. Visit may be called more than once on each part in the domain model, but it is called exactly once for each tuple (parent path, part).

Each part bean must call method visitor.visit(this)

Specified by:
accept in interface PartBean
Parameters:
parents - the path of parents of this part.
visitor - a PartBeanVisitor.
Since:
0.9.0

comparablePart

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

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

getSimpleClassName

protected String getSimpleClassName()
Description copied from class: BasicPart
Returns the simple implementation class name of this class.

If your implementation represents an interface implementation return the interface simple class name here. In short: return the instance you are checking against in BasicPart.comparablePart(BasicPart).

Overrides:
getSimpleClassName in class BasicPart
Returns:
the simple implementation class name of this class.
Since:
0.1.0


OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:16:59
Copyright (c) 2002-2007 Ergon Informatik AG