org.openpermis.editor.policy.command
Class CollectionChangeCommand<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.CollectionChangeCommand<P>
Type Parameters:
P - the current beantype
All Implemented Interfaces:
Command
Direct Known Subclasses:
CollectionAddCommand, CollectionRemoveCommand

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

Command to edit a part.

Since:
0.1.0

Constructor Summary
CollectionChangeCommand(org.openpermis.policy.bean.PartBean parentBean, P elementBean, String property)
          Creates a new command.
 
Method Summary
 void execute(org.openpermis.policy.bean.PolicyBean policyBean)
          Executes the command and stores necessary information to undo any changes.
 P getElementBean()
           
 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
 

Constructor Detail

CollectionChangeCommand

public CollectionChangeCommand(org.openpermis.policy.bean.PartBean parentBean,
                               P elementBean,
                               String property)
Creates a new command. *

Parameters:
parentBean - bean holding the collection
elementBean - bean to add/remove
property - the property holding the collection
Since:
0.1.0
Method Detail

getElementBean

public P getElementBean()
Returns:
the elementBean.
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


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