Coverage Report - org.openpermis.editor.policy.command.Command
 
Classes in this File Line Coverage Branch Coverage Complexity
Command
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright (c) 2009, Swiss Federal Department of Defence Civil Protection and Sport
 3  
  *                     (http://www.vbs.admin.ch)
 4  
  * Copyright (c) 2009, Ergon Informatik AG (http://www.ergon.ch)
 5  
  * All rights reserved.
 6  
  *
 7  
  * Licensed under the Open Permis License which accompanies this distribution,
 8  
  * and is available at http://www.openpermis.org/BSDlicenceKent.txt
 9  
  */
 10  
 package org.openpermis.editor.policy.command;
 11  
 
 12  
 import org.openpermis.policy.bean.PolicyBean;
 13  
 
 14  
 /**
 15  
  * Abstraction of commands that operate on domain objects.
 16  
  * @since 0.1.0
 17  
  */
 18  
 public interface Command {
 19  
 
 20  
         /**
 21  
          * Returns the name of the command suitable for display in the user interface.
 22  
          * @return the name of the command suitable for display in the user interface.
 23  
          * @since 0.1.0
 24  
          */
 25  
         public String getName ();
 26  
 
 27  
         /**
 28  
          * Executes the command and stores necessary information to undo any changes.
 29  
          * @param policy the policy to execute the command on.
 30  
          * @since 0.1.0
 31  
          */
 32  
         public void execute (PolicyBean policy) throws Exception;
 33  
 
 34  
         /**
 35  
          * Reverts any changes performed in {@link #execute(org.openpermis.policy.bean.PolicyBean)}.
 36  
          * @param policy the policy to revert.
 37  
          * @since 0.1.0
 38  
          */
 39  
         public void undo (PolicyBean policy) throws Exception;
 40  
 
 41  
 }