View Javadoc

1   /**
2    * Copyright 2005-2007 the original author or authors.
3    *
4    * Licensed under the Gnu General Pubic License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with
6    * the License. You may obtain a copy of the License at
7    *
8    *      http://www.opensource.org/licenses/gpl-license.php
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13   * See the Gnu General Public License for more details.
14   */
15  package org.figure8.join.control.config;
16  
17  import java.util.HashMap;
18  import java.io.Serializable;
19  /**
20   * A JavaBean representing the configuration information of the security control
21   * filter of a Join application. These informations represents security constraints
22   * for action execution.
23   * @author  <a href="mailto:laurent.broudoux@free.fr">Laurent Broudoux</a>
24   * @version $Revision: 1.1 $
25   */
26  public class AccessControlConfig implements Serializable{
27   
28     // Attributes ---------------------------------------------------------------
29     
30     /** The set of action constraints configurations for this module, if any. */
31     private HashMap actionConstraints = new HashMap();
32     
33     
34     // Constructors -------------------------------------------------------------
35     
36     /** Creates a new instance of AccessControlConfig */
37     public AccessControlConfig(){
38        super();
39     }
40     
41     
42     // Public -------------------------------------------------------------------
43     
44     /**
45      * Add a new <code>ActionConstraintConfig</code> instance to the set associated.
46      * @param constraint The new constraint configuration instance to be added
47      */
48     public void addActionConstraint(ActionConstraintConfig constraint){
49        actionConstraints.put(constraint.getPath(), constraint);
50     }
51     
52     /**
53      * Return the action constraint configuration for the specified path, if any;
54      * otherwise return <code>null</code>.
55      * @param path Path of the action constraint configuration to return
56      * @return The corresponding ActionConstraintConfig
57      */
58     public ActionConstraintConfig findActionConstraint(String path){
59        return (ActionConstraintConfig)actionConstraints.get(path);
60     }
61  }