org.openpermis.editor.policy.presenter
Class RoleAssignmentRulePresenter

java.lang.Object
  extended by org.openpermis.editor.policy.presenter.Presenter<M>
      extended by org.openpermis.editor.policy.presenter.PartPresenter<org.openpermis.policy.bean.RoleAssignmentRuleBean>
          extended by org.openpermis.editor.policy.presenter.RoleAssignmentRulePresenter

public class RoleAssignmentRulePresenter
extends PartPresenter<org.openpermis.policy.bean.RoleAssignmentRuleBean>

Presenter for a single RoleAssignmentRuleBean.

Since:
0.3.0

Field Summary
private  org.openpermis.policy.bean.AuthorityBean activeAuthority
          The currently active authority.
private  org.openpermis.policy.bean.DomainBean activeSubjectDomain
          The currently active subject domain.
private  org.openpermis.basic.TimePeriodConstraint constraint
           
private  int delegationDepth
           
private static org.slf4j.Logger LOGGER
           
private  org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.Role> roles
           
private  org.jdesktop.observablecollections.ObservableListListener rolesUpdater
           
 
Constructor Summary
RoleAssignmentRulePresenter(org.openpermis.policy.bean.RoleAssignmentRuleBean model, PolicyContext context)
          Creates a new role assignment rule presenter.
 
Method Summary
 void addAuthority(EditPartCommand<org.openpermis.policy.bean.AuthorityBean> editPartCommand)
          Adds an authority.
 void addSubjectDomain(EditPartCommand<org.openpermis.policy.bean.DomainBean> editPartCommand)
          Adds a subject domain.
private  org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.Role> createRoleList(org.openpermis.policy.bean.RoleAssignmentRuleBean model)
          Creates the initial role list for the specified model.
 org.openpermis.policy.bean.AuthorityBean getActiveAuthority()
          Returns the active authority of this model.
 org.openpermis.policy.bean.DomainBean getActiveSubjectDomain()
          Returns the active subject domain of this model.
 org.openpermis.basic.TimePeriodConstraint getConstraint()
           
 int getDelegationDepth()
          Gets the delegation depth.
private  String getIdentity(org.openpermis.policy.Identifiable identifiable)
          Returns the identity string representation of the specified identifiable.
 org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.Role> getRoles()
          The list of roles of this RoleAssignmentRuleBean.
 void removeActiveAuthority(org.openpermis.policy.bean.AuthorityBean authority)
          Removes the active authority in the whole policy.
 void removeActiveSubjectDomain(org.openpermis.policy.bean.DomainBean subjectDomain)
          Removes the active subject domain in the whole policy.
 void setActiveAuthority(org.openpermis.policy.bean.AuthorityBean newActiveAuthority)
          Sets the active authority of the target of this model.
 void setActiveResourceDomain(org.openpermis.policy.bean.DomainBean activeSubjectDomainBean)
          Sets the active subject domain of the target of this model.
private  void updateActiveAuthority(org.openpermis.policy.bean.AuthorityBean newActiveAuthority)
          Forwards model changes to the listeners of this presenter.
private  void updateActiveSubjectDomain(org.openpermis.policy.bean.DomainBean activeSubjectDomainBean)
          Forwards model changes to the listeners of this presenter.
private  void updateAddedRolesAtPresenter(org.openpermis.policy.bean.RoleCollection modelRoles, org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.Role> list)
           
 void updateAuthority()
          Handler for authority domain changes in a target.
 void updateConstraint()
          Handler for changes in the TimePeriodConstraint of a RoleAssignmentRuleBean bean.
 void updateConstraint(org.openpermis.basic.TimePeriodConstraint newConstraint)
          Sets the constraint.
 void updateConstraintAtModel(org.openpermis.basic.TimePeriodConstraint newConstraint)
          Updates the constraint in the model.
 void updateDelegationDepth()
          Handler for changes in the delegationDepth of a RoleAssignmentRuleBean bean.
 void updateDelegationDepth(int newDelegationDepth)
          Sets the delegation depth.
 void updateDelegationDepthAtModel(int newDelegationDepth)
          Updates the delegation depth in the model.
private  void updateDeletedRolesAtPresenter(org.openpermis.policy.bean.RoleCollection modelRoles, org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.Role> list)
           
 void updateResourceDomain()
          Handler for subject domain changes in a target.
 void updateRoles()
          Handler for changes in the roles of a role assignment rule bean.
private  void updateRolesAtModel()
          Writes the roles in the presenter to the model.
private  void updateRolesAtPresenter()
          Writes the roles in the presenter according to the model.
 
Methods inherited from class org.openpermis.editor.policy.presenter.PartPresenter
change, change, containsSerial, createChangeCommand, createCollectionAtPresenter, dispose, execute, getActionPool, getAuthorityPool, getContext, getModelSerialNumber, getObligationPool, getPartBeanFactory, getResourceDomainPool, getRolePool, getSubjectDomainPool, getTargetPool, indexOfBySerial, sameSerial, updateCollectionAtPresenter
 
Methods inherited from class org.openpermis.editor.policy.presenter.Presenter
addPropertyChangeListener, firePropertyChange, getModel, getTitleParameters, removePropertyChangeListener, setTitleParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

private static final org.slf4j.Logger LOGGER
Since:
0.3.0

activeAuthority

private org.openpermis.policy.bean.AuthorityBean activeAuthority
The currently active authority.

Since:
0.3.0

activeSubjectDomain

private org.openpermis.policy.bean.DomainBean activeSubjectDomain
The currently active subject domain.

Since:
0.3.0

roles

private final org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.Role> roles
Since:
0.3.0

rolesUpdater

private final org.jdesktop.observablecollections.ObservableListListener rolesUpdater
Since:
0.3.0

delegationDepth

private int delegationDepth
Since:
0.3.0

constraint

private org.openpermis.basic.TimePeriodConstraint constraint
Since:
0.3.0
Constructor Detail

RoleAssignmentRulePresenter

public RoleAssignmentRulePresenter(org.openpermis.policy.bean.RoleAssignmentRuleBean model,
                                   PolicyContext context)
Creates a new role assignment rule presenter.

Parameters:
model - the RoleAssignmentRuleBean to work on, must not be null.
context - policy context that provides additional information.
Since:
0.3.0
Method Detail

getActiveSubjectDomain

public org.openpermis.policy.bean.DomainBean getActiveSubjectDomain()
Returns the active subject domain of this model.

Returns:
the active subject domain of this model.
Since:
new

setActiveResourceDomain

public void setActiveResourceDomain(org.openpermis.policy.bean.DomainBean activeSubjectDomainBean)
Sets the active subject domain of the target of this model.

Parameters:
activeSubjectDomainBean - the new resource domain.
Since:
0.3.0

updateActiveSubjectDomain

private void updateActiveSubjectDomain(org.openpermis.policy.bean.DomainBean activeSubjectDomainBean)
Forwards model changes to the listeners of this presenter.

Parameters:
activeSubjectDomainBean - the active resource domain to set.
Since:
0.3.0

removeActiveSubjectDomain

public void removeActiveSubjectDomain(org.openpermis.policy.bean.DomainBean subjectDomain)
Removes the active subject domain in the whole policy.

Since:
0.3.0

addSubjectDomain

public void addSubjectDomain(EditPartCommand<org.openpermis.policy.bean.DomainBean> editPartCommand)
Adds a subject domain.

Parameters:
editPartCommand - adding a domain implies opening an editor.
Since:
0.3.0

getActiveAuthority

public org.openpermis.policy.bean.AuthorityBean getActiveAuthority()
Returns the active authority of this model.

Returns:
the active authority of this model.
Since:
new

setActiveAuthority

public void setActiveAuthority(org.openpermis.policy.bean.AuthorityBean newActiveAuthority)
Sets the active authority of the target of this model.

Parameters:
newActiveAuthority - the new authority.
Since:
0.3.0

updateActiveAuthority

private void updateActiveAuthority(org.openpermis.policy.bean.AuthorityBean newActiveAuthority)
Forwards model changes to the listeners of this presenter.

Parameters:
newActiveAuthority - the active authority.
Since:
0.3.0

removeActiveAuthority

public void removeActiveAuthority(org.openpermis.policy.bean.AuthorityBean authority)
Removes the active authority in the whole policy.

Since:
0.3.0

addAuthority

public void addAuthority(EditPartCommand<org.openpermis.policy.bean.AuthorityBean> editPartCommand)
Adds an authority.

Parameters:
editPartCommand - adding an authority implies opening an editor.
Since:
0.3.0

getIdentity

private String getIdentity(org.openpermis.policy.Identifiable identifiable)
Returns the identity string representation of the specified identifiable.

Parameters:
identifiable - the identifiable for which to retrieve the identity.
Returns:
the identity string or an empty string if undefined.
Since:
0.3.0

createRoleList

private org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.Role> createRoleList(org.openpermis.policy.bean.RoleAssignmentRuleBean model)
Creates the initial role list for the specified model.

Parameters:
model - the model to create the list for.
Returns:
the list, never null.
Since:
0.3.0

updateRolesAtModel

private void updateRolesAtModel()
Writes the roles in the presenter to the model.

Since:
0.3.0

updateRolesAtPresenter

private void updateRolesAtPresenter()
Writes the roles in the presenter according to the model.

Since:
0.3.0

updateAddedRolesAtPresenter

private void updateAddedRolesAtPresenter(org.openpermis.policy.bean.RoleCollection modelRoles,
                                         org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.Role> list)
Since:
0.3.0

updateDeletedRolesAtPresenter

private void updateDeletedRolesAtPresenter(org.openpermis.policy.bean.RoleCollection modelRoles,
                                           org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.Role> list)
Since:
0.3.0

getRoles

public org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.Role> getRoles()
The list of roles of this RoleAssignmentRuleBean.

Returns:
the list of roles of this RoleAssignmentRuleBean.
Since:
0.3.0

updateDelegationDepthAtModel

public void updateDelegationDepthAtModel(int newDelegationDepth)
Updates the delegation depth in the model.

Parameters:
newDelegationDepth - the new delegation depth.
Since:
0.3.0

getDelegationDepth

public int getDelegationDepth()
Gets the delegation depth.

Returns:
the delegation depth.
Since:
0.3.0

updateDelegationDepth

public void updateDelegationDepth(int newDelegationDepth)
Sets the delegation depth.

Parameters:
newDelegationDepth - the delegation depth.
Since:
0.3.0

getConstraint

public org.openpermis.basic.TimePeriodConstraint getConstraint()
Since:
0.3.0

updateConstraintAtModel

public void updateConstraintAtModel(org.openpermis.basic.TimePeriodConstraint newConstraint)
Updates the constraint in the model.

Parameters:
newConstraint - the constraint.
Since:
0.3.0

updateConstraint

public void updateConstraint(org.openpermis.basic.TimePeriodConstraint newConstraint)
Sets the constraint.

Parameters:
newConstraint - the constraint.
Since:
0.3.0

updateAuthority

public void updateAuthority()
Handler for authority domain changes in a target.

Since:
0.3.0

updateResourceDomain

public void updateResourceDomain()
Handler for subject domain changes in a target.

Since:
0.3.0

updateRoles

public void updateRoles()
Handler for changes in the roles of a role assignment rule bean.

Since:
new

updateDelegationDepth

public void updateDelegationDepth()
Handler for changes in the delegationDepth of a RoleAssignmentRuleBean bean.

Since:
0.3.0

updateConstraint

public void updateConstraint()
Handler for changes in the TimePeriodConstraint of a RoleAssignmentRuleBean bean.

Since:
0.3.0


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