View Javadoc

1   /*
2    * Copyright [2007] [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.config.security;
18  
19  import java.util.List;
20  
21  import org.opensaml.xml.security.credential.UsageType;
22  import org.springframework.beans.factory.config.AbstractFactoryBean;
23  
24  /**
25   * Abstract factory bean for building {@link org.opensaml.xml.security.credential.Credential}s.
26   */
27  public abstract class AbstractCredentialFactoryBean extends AbstractFactoryBean {
28      
29      /** Usage type of the credential. */
30      private UsageType usageType;
31  
32      /** Names for the key represented by the credential. */
33      private List<String> keyNames;
34      
35      /** Identifier for the owner of the credential. */
36      private String entityID;
37      
38      /**
39       * Gets the names for the key represented by the credential.
40       * 
41       * @return names for the key represented by the credential
42       */
43      public List<String> getKeyNames() {
44          return keyNames;
45      }
46  
47      /**
48       * Gets the usage type of the credential.
49       * 
50       * @return usage type of the credential
51       */
52      public UsageType getUsageType(){
53          return usageType;
54      }
55      
56      /**
57       * Get the entity ID of the credential.
58       * 
59       * @return the entity ID
60       */
61      public String getEntityID() {
62          return entityID;
63      }
64  
65      /**
66       * Sets the names for the key represented by the credential.
67       * 
68       * @param names names for the key represented by the credential
69       */
70      public void setKeyNames(List<String> names) {
71          keyNames = names;
72      }
73  
74      /**
75       * Sets the usage type of the credential.
76       * 
77       * @param type usage type of the credential
78       */
79      public void setUsageType(UsageType type){
80          usageType = type;
81      }
82      
83      /**
84       * Set the entity ID of the credential.
85       * 
86       * @param newEntityID the entity ID
87       */
88      public void setEntityID(String newEntityID) {
89          entityID = newEntityID;
90      }
91  }