org.openpermis.editor.policy.presenter
Class DecisionPresenter

java.lang.Object
  extended by org.openpermis.editor.policy.presenter.Presenter<M>
      extended by org.openpermis.editor.policy.presenter.PartPresenter<org.openpermis.policy.bean.PolicyBean>
          extended by org.openpermis.editor.policy.presenter.DecisionPresenter
All Implemented Interfaces:
org.openpermis.policy.Identifiable, org.openpermis.Subject

public class DecisionPresenter
extends PartPresenter<org.openpermis.policy.bean.PolicyBean>
implements org.openpermis.Subject

Presentation model for the decision test view.

Since:
0.3.0

Nested Class Summary
private static class DecisionPresenter.Decision
           
(package private)  class DecisionPresenter.ParameterTableModel
           
 
Field Summary
private  org.openpermis.policy.bean.ActionBean action
           
private  org.openpermis.policy.Authority authority
           
private  DecisionPresenter.Decision decision
           
private  org.openpermis.policy.TimeStamp evaluationTimeStamp
           
private  DecisionPresenter.ParameterTableModel parameterTableModel
           
private  org.openpermis.policy.Domain resourceDomain
           
private  org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.Role> selectedRoles
           
private  ObservableListAdapter<org.openpermis.policy.Role> selectedRolesListener
           
 
Constructor Summary
DecisionPresenter(org.openpermis.policy.bean.PolicyBean policy, PolicyContext context)
          Creates a new presenter.
 
Method Summary
private  void chooseDefaultAction()
           
private  void chooseDefaultAuthority()
           
private  void chooseDefaultResourceDomain()
           
private  void chooseDefaults()
           
private  void computeDecision()
           
private  void createSelectedRoles()
           
 org.openpermis.policy.bean.ActionBean getAction()
          Gets the currently selected action.
 Set<org.openpermis.policy.Role> getAssignedRoles(org.openpermis.policy.TimeStamp timeStamp, Set<org.openpermis.policy.Role> roles)
           
 org.openpermis.policy.Authority getAuthority()
          Gets the currently selected authority.
 Color getDecisionColor()
          Gets the current decision as a colour value.
 String getDecisionText()
          Gets the current decision in text form.
 org.openpermis.policy.TimeStamp getEvaluationTimeStamp()
          Gets the current evaluation time for the decision tester.
 URI getIdentity()
           
 Set<org.openpermis.Subject> getIssuersOf(org.openpermis.policy.Role role)
           
 DecisionPresenter.ParameterTableModel getParameterTableModel()
           
 org.openpermis.policy.Domain getResourceDomain()
          Gets the currently selected resource domain.
 org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.Role> getSelectedRoles()
          Gets the list where selected roles get stored.
 org.openpermis.basic.TimePeriod getValidityOf(org.openpermis.policy.Role role, org.openpermis.Subject issuer)
           
 boolean identityMandatory()
           
private  Object parseArgument(Class<?> type, String valueAsString)
           
 void policyChanged()
           
 void setAction(org.openpermis.policy.bean.ActionBean action)
          Selects an action.
 void setAuthority(org.openpermis.policy.Authority authority)
          Sets the selected authority.
 void setEvaluationTimeStamp(org.openpermis.policy.TimeStamp timeStamp)
          Selects an evaluation time for the decision tester.
 void setResourceDomain(org.openpermis.policy.Domain domain)
          Selects a resource domain.
 
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

authority

private org.openpermis.policy.Authority authority
Since:
0.3.0

resourceDomain

private org.openpermis.policy.Domain resourceDomain
Since:
0.3.0

action

private org.openpermis.policy.bean.ActionBean action
Since:
0.3.0

selectedRoles

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

selectedRolesListener

private ObservableListAdapter<org.openpermis.policy.Role> selectedRolesListener
Since:
0.3.0

evaluationTimeStamp

private org.openpermis.policy.TimeStamp evaluationTimeStamp
Since:
0.3.0

decision

private DecisionPresenter.Decision decision
Since:
0.3.0

parameterTableModel

private DecisionPresenter.ParameterTableModel parameterTableModel
Since:
0.3.0
Constructor Detail

DecisionPresenter

public DecisionPresenter(org.openpermis.policy.bean.PolicyBean policy,
                         PolicyContext context)
Creates a new presenter.

Parameters:
policy - the policy whose access rules will be available for testing.
context - editor meta data for the policy.
Since:
0.3.0
Method Detail

chooseDefaults

private void chooseDefaults()
Since:
0.3.0

chooseDefaultAuthority

private void chooseDefaultAuthority()
Since:
0.3.0

chooseDefaultResourceDomain

private void chooseDefaultResourceDomain()
Since:
0.3.0

chooseDefaultAction

private void chooseDefaultAction()
Since:
0.3.0

getAuthority

public org.openpermis.policy.Authority getAuthority()
Gets the currently selected authority.

Returns:
the selected authority.
Since:
0.3.0

setAuthority

public void setAuthority(org.openpermis.policy.Authority authority)
Sets the selected authority.

Parameters:
authority - the selected authority.
Since:
0.3.0

getResourceDomain

public org.openpermis.policy.Domain getResourceDomain()
Gets the currently selected resource domain.

Returns:
the selected resource domain.
Since:
0.3.0

setResourceDomain

public void setResourceDomain(org.openpermis.policy.Domain domain)
Selects a resource domain.

Parameters:
domain - the selected resource domain.
Since:
0.3.0

getAction

public org.openpermis.policy.bean.ActionBean getAction()
Gets the currently selected action.

Returns:
the selected action.
Since:
0.3.0

setAction

public void setAction(org.openpermis.policy.bean.ActionBean action)
Selects an action.

Parameters:
action - the selected action.
Since:
0.3.0

createSelectedRoles

private void createSelectedRoles()
Since:
0.3.0

getSelectedRoles

public org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.Role> getSelectedRoles()
Gets the list where selected roles get stored.

Returns:
the list of selected roles for which access decisions are evaluated.
Since:
0.3.0

getEvaluationTimeStamp

public org.openpermis.policy.TimeStamp getEvaluationTimeStamp()
Gets the current evaluation time for the decision tester.

Returns:
the evaluation time for the decision.
Since:
0.3.0

setEvaluationTimeStamp

public void setEvaluationTimeStamp(org.openpermis.policy.TimeStamp timeStamp)
Selects an evaluation time for the decision tester.

Parameters:
timeStamp - an evaluation time.
Since:
0.3.0

getDecisionText

public String getDecisionText()
Gets the current decision in text form.

Returns:
the decision for the current configuration.
Since:
0.3.0

getDecisionColor

public Color getDecisionColor()
Gets the current decision as a colour value.

Returns:
a colour value.
Since:
0.3.0

computeDecision

private void computeDecision()
Since:
0.3.0

getParameterTableModel

public DecisionPresenter.ParameterTableModel getParameterTableModel()
Since:
0.3.0

parseArgument

private Object parseArgument(Class<?> type,
                             String valueAsString)
Since:
0.3.0

policyChanged

public void policyChanged()
Since:
0.3.0

getAssignedRoles

public Set<org.openpermis.policy.Role> getAssignedRoles(org.openpermis.policy.TimeStamp timeStamp,
                                                        Set<org.openpermis.policy.Role> roles)
Specified by:
getAssignedRoles in interface org.openpermis.Subject
Since:
0.3.0

getIssuersOf

public Set<org.openpermis.Subject> getIssuersOf(org.openpermis.policy.Role role)
Specified by:
getIssuersOf in interface org.openpermis.Subject
Since:
0.3.0

getValidityOf

public org.openpermis.basic.TimePeriod getValidityOf(org.openpermis.policy.Role role,
                                                     org.openpermis.Subject issuer)
Specified by:
getValidityOf in interface org.openpermis.Subject
Since:
0.3.0

getIdentity

public URI getIdentity()
Specified by:
getIdentity in interface org.openpermis.policy.Identifiable
Since:
0.3.0

identityMandatory

public boolean identityMandatory()
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