View Javadoc

1   /*
2    * Copyright 2001-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.neethi;
17  
18  /**
19   * PolicyRegistry contains (URI,Policy) pairs and it is used to resolve explicit
20   * Policy references.
21   * 
22   */
23  public interface PolicyRegistry {
24  
25      /**
26       * Associates a key with a Policy
27       * 
28       * @param key
29       *            the key that the specified Policy to be associated
30       * @param policy
31       *            the policy to be associated with the key
32       */
33      public void register(String key, Policy policy);
34  
35      /**
36       * Returns the Policy that the specified key is mapped. Retruns null if no
37       * Policy is associated with that key.
38       * 
39       * @param key
40       *            the key whose associated Policy is to be returned.
41       * @return the policy associated with the specified key.
42       */
43      public Policy lookup(String key);
44  
45      /**
46       * Removes the mapping for this key if present.
47       * 
48       * @param key
49       *            the key whose mapping is to be removed
50       */
51      public void remove(String key);
52  
53  }