org.openpermis.editor.policy.presenter
Class TargetPresenter

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

public class TargetPresenter
extends PartPresenter<org.openpermis.policy.bean.TargetBean>

Presenter for a single TargetBean.

Since:
0.1.0

Field Summary
private  org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.bean.ActionBean> actions
          The actions of this target as observable collection.
private  org.jdesktop.observablecollections.ObservableListListener actionsUpdater
          Updater that keeps the model in sync with the observable actions list.
private  org.openpermis.policy.bean.DomainBean activeResourceDomain
          The currently active target access rule.
private static org.slf4j.Logger LOGGER
          The logger object of this class.
 
Constructor Summary
TargetPresenter(org.openpermis.policy.bean.TargetBean model, CommandDispatcher dispatcher, PolicyContext context)
          Creates a new target presenter.
 
Method Summary
 void addAction(EditPartCommand<org.openpermis.policy.bean.ActionBean> editPartCommand)
           
 void addResourceDomain(EditPartCommand<org.openpermis.policy.bean.DomainBean> editPartCommand)
           
private  org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.bean.ActionBean> createActionList(org.openpermis.policy.bean.TargetBean model)
          Creates the initial action list for the specified model.
 org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.bean.ActionBean> getActions()
          The list of actions of this target.
 org.openpermis.policy.bean.DomainBean getActiveResourceDomain()
          Returns the active resource domain of this model.
private  String getIdentity(org.openpermis.policy.bean.DomainBean domain)
          Returns the identity string representation of the specified domain.
 void removeActiveAction(org.openpermis.policy.bean.ActionBean activeAction)
          Removes the active target in the whole policy.
 void removeActiveResourceDomain(org.openpermis.policy.bean.DomainBean resourceDomain)
          Removes the active resource domain in the whole policy.
 void setActiveResourceDomain(org.openpermis.policy.bean.DomainBean activeResourceDomainBean)
          Sets the active resource domain of the target of this model.
 void updateActions()
          Handler for changes in the actions of a target.
private  void updateActionsAtModel()
          Writes the actions in the model according to the presenter.
private  void updateActionsAtPresenter()
          Writes the actions in the presenter according to the model.
private  void updateActiveResourceDomain(org.openpermis.policy.bean.DomainBean activeResourceDomainBean)
          Forwards model changes to the listeners of this presenter.
 void updateResourceDomain()
          Handler for resource domain changes in a target.
 
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
The logger object of this class.

Since:
0.1.0

activeResourceDomain

private org.openpermis.policy.bean.DomainBean activeResourceDomain
The currently active target access rule.

Since:
0.1.0

actions

private final org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.bean.ActionBean> actions
The actions of this target as observable collection.

Since:
0.1.0

actionsUpdater

private final org.jdesktop.observablecollections.ObservableListListener actionsUpdater
Updater that keeps the model in sync with the observable actions list.

Since:
0.1.0
Constructor Detail

TargetPresenter

public TargetPresenter(org.openpermis.policy.bean.TargetBean model,
                       CommandDispatcher dispatcher,
                       PolicyContext context)
Creates a new target presenter.

Parameters:
model - the target to work on, must not be null.
context - policy context that provides additional information.
dispatcher - the dispatcher for commands that change the policy.
Since:
0.1.0
Method Detail

createActionList

private org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.bean.ActionBean> createActionList(org.openpermis.policy.bean.TargetBean model)
Creates the initial action list for the specified model.

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

updateActionsAtModel

private void updateActionsAtModel()
Writes the actions in the model according to the presenter.

Since:
0.1.0

updateActionsAtPresenter

private void updateActionsAtPresenter()
Writes the actions in the presenter according to the model.

Since:
0.1.0

getActions

public org.jdesktop.observablecollections.ObservableList<org.openpermis.policy.bean.ActionBean> getActions()
The list of actions of this target.

Returns:
the list of actions of this target.
Since:
0.1.0

getActiveResourceDomain

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

Returns:
the active resource domain of this model.
Since:
0.1.0

setActiveResourceDomain

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

Parameters:
activeResourceDomainBean - the new resource domain.
Since:
0.1.0

updateActiveResourceDomain

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

Parameters:
activeResourceDomainBean - the active resource domain to set.
Since:
0.1.0

removeActiveResourceDomain

public void removeActiveResourceDomain(org.openpermis.policy.bean.DomainBean resourceDomain)
Removes the active resource domain in the whole policy.

Since:
0.1.0

removeActiveAction

public void removeActiveAction(org.openpermis.policy.bean.ActionBean activeAction)
Removes the active target in the whole policy.

Since:
0.1.0

addResourceDomain

public void addResourceDomain(EditPartCommand<org.openpermis.policy.bean.DomainBean> editPartCommand)
Since:
0.1.0

getIdentity

private String getIdentity(org.openpermis.policy.bean.DomainBean domain)
Returns the identity string representation of the specified domain.

Parameters:
domain - the resource domain for which to retrieve the identity.
Returns:
the identity string or an empty string if undefined.
Since:
0.1.0

addAction

public void addAction(EditPartCommand<org.openpermis.policy.bean.ActionBean> editPartCommand)
Since:
0.1.0

updateResourceDomain

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

Since:
0.1.0

updateActions

public void updateActions()
Handler for changes in the actions of a target.

Since:
0.1.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:22
Copyright (c) 2002-2007 Ergon Informatik AG