org.openpermis.editor.policy.command
Class PoolChangeCommand<P extends org.openpermis.policy.bean.PartBean>

java.lang.Object
  extended by org.openpermis.editor.policy.command.AbstractCommand
      extended by org.openpermis.editor.policy.command.PoolChangeCommand<P>
Type Parameters:
P - the current beantype
All Implemented Interfaces:
Command
Direct Known Subclasses:
PoolRemoveCommand

public abstract class PoolChangeCommand<P extends org.openpermis.policy.bean.PartBean>
extends AbstractCommand

Command to edit a part.

Since:
0.1.0

Field Summary
private  P elementBean
          The bean to operate on.
private  PolicyPartPool<P> pool
          Pool to change.
 
Constructor Summary
PoolChangeCommand(PolicyPartPool<P> pool, P elementBean)
          Creates a new command
 
Method Summary
private  void changeCollection(boolean doExec)
           
 void execute(org.openpermis.policy.bean.PolicyBean policyBean)
          Executes the command and stores necessary information to undo any changes.
 P getElementBean()
           
 PolicyPartPool<P> getPool()
           
(package private) abstract  void operateElement(boolean doExec)
           
 void undo(org.openpermis.policy.bean.PolicyBean policyBean)
          Reverts any changes performed in Command.execute(org.openpermis.policy.bean.PolicyBean).
 
Methods inherited from class org.openpermis.editor.policy.command.AbstractCommand
getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pool

private PolicyPartPool<P extends org.openpermis.policy.bean.PartBean> pool
Pool to change.

Since:
0.1.0

elementBean

private P extends org.openpermis.policy.bean.PartBean elementBean
The bean to operate on.

Since:
0.1.0
Constructor Detail

PoolChangeCommand

public PoolChangeCommand(PolicyPartPool<P> pool,
                         P elementBean)
Creates a new command. *

Parameters:
pool - pool to be changed
elementBean - bean to operate on
Since:
0.1.0
Method Detail

getPool

public PolicyPartPool<P> getPool()
Returns:
the pool.
Since:
0.1.0

getElementBean

public P getElementBean()
Returns:
the elementBean.
Since:
0.1.0

operateElement

abstract void operateElement(boolean doExec)
Parameters:
doExec - wether to "exec" or to "undo"
Since:
0.1.0

changeCollection

private void changeCollection(boolean doExec)
Since:
0.1.0

execute

public void execute(org.openpermis.policy.bean.PolicyBean policyBean)
Description copied from interface: Command
Executes the command and stores necessary information to undo any changes.

Specified by:
execute in interface Command
Specified by:
execute in class AbstractCommand
Parameters:
policyBean - the policy to execute the command on.
Since:
0.1.0

undo

public void undo(org.openpermis.policy.bean.PolicyBean policyBean)
Description copied from interface: Command
Reverts any changes performed in Command.execute(org.openpermis.policy.bean.PolicyBean).

Specified by:
undo in interface Command
Specified by:
undo in class AbstractCommand
Parameters:
policyBean - the policy to revert.
Since:
0.1.0


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