Create parser pool interface and move current pool to an implementation of this inter...
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / idp / IdPProtocolSupport.java
1 /*
2  * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.] Licensed under the Apache License,
3  * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy
4  * of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in
5  * writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
6  * OF ANY KIND, either express or implied. See the License for the specific language governing permissions and
7  * limitations under the License.
8  */
9
10 package edu.internet2.middleware.shibboleth.idp;
11
12 import java.net.URI;
13 import java.security.Principal;
14 import java.util.Collection;
15 import java.util.Map;
16
17 import org.apache.log4j.Logger;
18 import org.opensaml.InvalidCryptoException;
19 import org.opensaml.SAMLAssertion;
20 import org.opensaml.SAMLAttribute;
21 import org.opensaml.SAMLException;
22 import org.opensaml.SAMLResponse;
23 import org.opensaml.saml2.metadata.provider.MetadataProvider;
24 import org.opensaml.security.TrustEngine;
25 import org.opensaml.security.X509EntityCredential;
26 import org.w3c.dom.Element;
27
28 import edu.internet2.middleware.shibboleth.aa.AAAttribute;
29 import edu.internet2.middleware.shibboleth.aa.AAException;
30 import edu.internet2.middleware.shibboleth.aa.arp.ArpProcessingException;
31 import edu.internet2.middleware.shibboleth.artifact.ArtifactMapper;
32 import edu.internet2.middleware.shibboleth.common.RelyingParty;
33 import edu.internet2.middleware.shibboleth.common.RelyingPartyMapper;
34
35 /**
36  * Delivers core IdP functionality (Attribute resolution, ARP filtering, Metadata lookup, Signing, Mapping between local &
37  * SAML identifiers, etc.) to components that process protocol-specific requests.
38  * 
39  * @author Walter Hoehn
40  */
41 public interface IdPProtocolSupport extends MetadataProvider {
42
43         /**
44          * Facility for logging transaction information. Should be used by most Protocol Hanlder implementations.
45          */
46         public Logger getTransactionLog();
47
48         /**
49          * Access to system-wide configuration.
50          */
51         public IdPConfig getIdPConfig();
52
53         /**
54          * Access to relying party-specific configuration.
55          */
56         public RelyingPartyMapper getRelyingPartyMapper();
57
58         public void signAssertions(SAMLAssertion[] assertions, RelyingParty relyingParty) throws InvalidCryptoException,
59                         SAMLException;
60
61         public void signResponse(SAMLResponse response, RelyingParty relyingParty) throws SAMLException;
62
63         /**
64          * Registered a metadata provider based on supplied XML configuration.
65          */
66         public void addMetadataProvider(Element element);
67
68         public Collection<? extends SAMLAttribute> getReleaseAttributes(Principal principal, RelyingParty relyingParty,
69                         String requester) throws AAException;
70
71         public Collection<? extends SAMLAttribute> getReleaseAttributes(Principal principal, RelyingParty relyingParty,
72                         String requester, Collection<URI> attributeNames) throws AAException;
73
74         public Collection<? extends SAMLAttribute> resolveAttributes(Principal principal, String requester,
75                         String responder, Map<String, AAAttribute> attributeSet) throws ArpProcessingException;
76
77         public Collection<? extends SAMLAttribute> resolveAttributesNoPolicies(Principal principal, String requester,
78                         String responder, Map<String, AAAttribute> attributeSet);
79
80         /**
81          * Cleanup resources that won't be released when this object is garbage-collected
82          */
83         public void destroy();
84
85         public ArtifactMapper getArtifactMapper();
86
87         /**
88          * Returns an OpenSAML2 Trust Engine implementation.
89          */
90         public TrustEngine<X509Credential> getTrustEngine();
91
92         /**
93          * Returns the number of active Metadata Providers.
94          */
95         public int providerCount();
96
97 }