org.openpermis.editor.policy.presenter
Class PartPresenter<M extends org.openpermis.policy.bean.PartBean>

java.lang.Object
  extended by org.openpermis.editor.policy.presenter.Presenter<M>
      extended by org.openpermis.editor.policy.presenter.PartPresenter<M>
Type Parameters:
M - the type of part bean of this presenter.
Direct Known Subclasses:
ActionPresenter, AuthorityPresenter, DecisionPresenter, DomainPresenter, ObligationPresenter, PolicyPresenter, ProblemListPresenter, RoleAssignmentPresenter, RoleAssignmentRuleListPresenter, RoleAssignmentRulePresenter, RoleHierarchyListPresenter, RoleHierarchyPresenter, TargetAccessRuleListPresenter, TargetAccessRulePresenter, TargetPresenter

public abstract class PartPresenter<M extends org.openpermis.policy.bean.PartBean>
extends Presenter<M>

Abstract base class for all presenters that work on a part bean.

Since:
0.1.0

Constructor Summary
PartPresenter(M model, PolicyContext context)
          Creates a new part presenter for the specified model.
 
Method Summary
protected  void change(org.openpermis.policy.bean.PartBean part, String property, Object value)
          Performs a change on a part.
protected  void change(String property, Object value)
          Performs a change on the model of this presenter.
protected
<T extends org.openpermis.policy.bean.PartBean>
boolean
containsSerial(Iterable<T> collection, T part)
          Checks if a collection contains a partbean.
protected  Command createChangeCommand(org.openpermis.policy.bean.PartBean part, String property, Object value)
          Creates a command that performs a change on a part.
protected
<P> org.jdesktop.observablecollections.ObservableList<P>
createCollectionAtPresenter(Iterable<P> modelCollection)
          Creates the initial presenter list for the specified model list.
 void dispose()
          Disposes this presenter.
protected  void execute(Command command)
          Executes a command using the built-in dispatcher.
 PolicyPartPool<org.openpermis.policy.bean.ActionBean> getActionPool()
          Returns the policy pool.
 PolicyPartPool<org.openpermis.policy.bean.AuthorityBean> getAuthorityPool()
          Returns the policy pool for authorities.
 PolicyContext getContext()
          Returns the policy context.
 org.openpermis.policy.bean.SerialNumber getModelSerialNumber()
          Returns the serial number of the model attached to this presenter.
 PolicyPartPool<org.openpermis.policy.bean.ObligationBean> getObligationPool()
          Returns the policy pool for obligations.
protected  org.openpermis.policy.bean.PartBeanFactory getPartBeanFactory()
          Returns the part bean factory to use when creating new parts.
 PolicyPartPool<org.openpermis.policy.bean.DomainBean> getResourceDomainPool()
          Returns the policy pool.
 PolicyRoleRefPool getRolePool()
          Returns the role pool.
 PolicyPartPool<org.openpermis.policy.bean.DomainBean> getSubjectDomainPool()
          Returns the policy pool.
 PolicyPartPool<org.openpermis.policy.bean.TargetBean> getTargetPool()
          Returns the policy pool.
protected
<T extends org.openpermis.policy.bean.PartBean>
int
indexOfBySerial(List<T> list, T part)
          Gets index of a PartBean in a collection.
protected  boolean sameSerial(org.openpermis.policy.bean.PartBean one, org.openpermis.policy.bean.PartBean two)
          Check if the part beans are equivalent with respect to serial number.
protected
<P extends org.openpermis.policy.bean.PartBean>
void
updateCollectionAtPresenter(Iterable<P> modelCollection, org.jdesktop.observablecollections.ObservableList<P> presenterCollection, org.jdesktop.observablecollections.ObservableListListener listener)
          Writes the parts in the presenter according to the model.
 
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
 

Constructor Detail

PartPresenter

public PartPresenter(M model,
                     PolicyContext context)
Creates a new part presenter for the specified model.

Parameters:
model - the part bean that this presenter works on, must not be null.
context - the context of the policy.
Since:
0.1.0
Method Detail

sameSerial

protected boolean sameSerial(org.openpermis.policy.bean.PartBean one,
                             org.openpermis.policy.bean.PartBean two)
Check if the part beans are equivalent with respect to serial number.

Parameters:
one - the first bean.
two - the second bean.
Returns:
true if they are equivalent.
Since:
0.1.0

containsSerial

protected <T extends org.openpermis.policy.bean.PartBean> boolean containsSerial(Iterable<T> collection,
                                                                                 T part)
Checks if a collection contains a partbean.

Returns:
true if exists, false else
Since:
0.1.0

indexOfBySerial

protected <T extends org.openpermis.policy.bean.PartBean> int indexOfBySerial(List<T> list,
                                                                              T part)
Gets index of a PartBean in a collection.

Returns:
index>=0 if exists, -1 else
Since:
0.1.0

getModelSerialNumber

public final org.openpermis.policy.bean.SerialNumber getModelSerialNumber()
Returns the serial number of the model attached to this presenter.

Returns:
the serial number of the model attached to this presenter.
Since:
0.1.0

getPartBeanFactory

protected org.openpermis.policy.bean.PartBeanFactory getPartBeanFactory()
Returns the part bean factory to use when creating new parts.

Returns:
the part bean factory to use when creating new parts.
Since:
0.1.0

getContext

public PolicyContext getContext()
Returns the policy context.

Returns:
Returns the policy context.
Since:
0.1.0

getActionPool

public PolicyPartPool<org.openpermis.policy.bean.ActionBean> getActionPool()
Returns the policy pool.

Returns:
Returns the policy pool.
Since:
0.1.0

getObligationPool

public PolicyPartPool<org.openpermis.policy.bean.ObligationBean> getObligationPool()
Returns the policy pool for obligations.

Returns:
Returns the policy pool for obligations.
Since:
0.3.0

getAuthorityPool

public PolicyPartPool<org.openpermis.policy.bean.AuthorityBean> getAuthorityPool()
Returns the policy pool for authorities.

Returns:
the policy pool for authorities.
Since:
0.3.0

getResourceDomainPool

public PolicyPartPool<org.openpermis.policy.bean.DomainBean> getResourceDomainPool()
Returns the policy pool.

Returns:
Returns the policy pool.
Since:
0.1.0

getSubjectDomainPool

public PolicyPartPool<org.openpermis.policy.bean.DomainBean> getSubjectDomainPool()
Returns the policy pool.

Returns:
Returns the policy pool.
Since:
0.3.0

getTargetPool

public PolicyPartPool<org.openpermis.policy.bean.TargetBean> getTargetPool()
Returns the policy pool.

Returns:
Returns the policy pool.
Since:
0.1.0

getRolePool

public PolicyRoleRefPool getRolePool()
Returns the role pool.

Returns:
the role pool.
Since:
0.3.0

createChangeCommand

protected Command createChangeCommand(org.openpermis.policy.bean.PartBean part,
                                      String property,
                                      Object value)
Creates a command that performs a change on a part.

Parameters:
part - the part to modify.
property - the property to set.
value - the value to set.
Since:
0.1.0

change

protected void change(String property,
                      Object value)
Performs a change on the model of this presenter.

Parameters:
property - the property to set.
value - the value to set.
Since:
0.1.0

change

protected void change(org.openpermis.policy.bean.PartBean part,
                      String property,
                      Object value)
Performs a change on a part.

Parameters:
part - the part to modify.
property - the property to set.
value - the value to set.
Since:
0.1.0

execute

protected void execute(Command command)
Executes a command using the built-in dispatcher.

Parameters:
command - the command to execute.
Since:
0.1.0

createCollectionAtPresenter

protected <P> org.jdesktop.observablecollections.ObservableList<P> createCollectionAtPresenter(Iterable<P> modelCollection)
Creates the initial presenter list for the specified model list.

Parameters:
modelCollection - the modelcollection to create the presenter list for.
Returns:
the list, never null.
Since:
0.1.0

updateCollectionAtPresenter

protected <P extends org.openpermis.policy.bean.PartBean> void updateCollectionAtPresenter(Iterable<P> modelCollection,
                                                                                           org.jdesktop.observablecollections.ObservableList<P> presenterCollection,
                                                                                           org.jdesktop.observablecollections.ObservableListListener listener)
Writes the parts in the presenter according to the model.

Since:
0.1.0

dispose

public void dispose()
Description copied from class: Presenter
Disposes this presenter.

The presenter has to remove all listeners registered.

Specified by:
dispose in class Presenter<M extends org.openpermis.policy.bean.PartBean>
Since:
0.1.0


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