View Javadoc

1   /*
2    * Copyright [2006] [University Corporation for Advanced Internet Development, Inc.]
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  
17  package edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.attributeDefinition;
18  
19  import java.util.List;
20  import java.util.Locale;
21  import java.util.Map;
22  
23  import edu.internet2.middleware.shibboleth.common.attribute.BaseAttribute;
24  import edu.internet2.middleware.shibboleth.common.attribute.encoding.AttributeEncoder;
25  import edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.ResolutionPlugIn;
26  import edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.dataConnector.DataConnector;
27  
28  /**
29   * A plugin used to create attributes or refine attributes provided from {@link DataConnector}s.
30   * 
31   * Attribute definitions must be stateless and thread-safe as a single instance may be used to service every request.
32   */
33  public interface AttributeDefinition extends ResolutionPlugIn<BaseAttribute> {
34  
35      /**
36       * Gets the localized human readable description of attribute.
37       * 
38       * @return human readable description of attribute
39       */
40      public Map<Locale, String> getDisplayDescriptions();
41  
42      /**
43       * Gets the localized human readable name of the attribute.
44       * 
45       * @return human readable name of the attribute
46       */
47      public Map<Locale, String> getDisplayNames();
48      
49      /**
50       * Gets the map of encoders to be added to attributes produced by this definition, keyed on encoder category.
51       * 
52       * @return encoders to be added to attributes produced by this definition
53       */
54      public List<AttributeEncoder> getAttributeEncoders();
55      
56      /**
57       * Gets whether this attribute definition is only a dependency and thus its values should never be released outside
58       * the resolver.
59       * 
60       * @return whether this attribute definition is only a dependency
61       */
62      public boolean isDependencyOnly();
63  }