View Javadoc

1   /*
2    * Copyright 2011 The Ohio State University
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.attribute.resolver.principalConnector;
18  
19  import edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.principalConnector.CryptoTransientPrincipalConnector;
20  import edu.internet2.middleware.shibboleth.common.util.DataSealer;
21  
22  /**
23   * Spring factory bean for {@link CryptoTransientPrincipalConnector}s.
24   */
25  public class CryptoTransientPrincipalConnectorFactoryBean extends BasePrincipalConnectorFactoryBean {
26  
27      /** Object used to decrypt identifiers. */
28      private DataSealer dataSealer;
29  
30      /** {@inheritDoc} */
31      public Class<CryptoTransientPrincipalConnector> getObjectType() {
32          return CryptoTransientPrincipalConnector.class;
33      }
34  
35      /**
36       * Gets the object used to decrypt identifiers.
37       * 
38       * @return object used to decrypt identifiers
39       */
40      public DataSealer getDataSealer() {
41          return dataSealer;
42      }
43  
44      /**
45       * Sets the object used to decrypt identifiers.
46       * 
47       * @param sealer object used to decrypt identifiers
48       */
49      public void setDataSealer(DataSealer sealer) {
50          dataSealer = sealer;
51      }
52  
53      /** {@inheritDoc} */
54      protected Object createInstance() throws Exception {
55          CryptoTransientPrincipalConnector connector = new CryptoTransientPrincipalConnector(getDataSealer());
56          populatePrincipalConnector(connector);
57  
58          return connector;
59      }
60  }