*** empty log message ***
[java-idp.git] / src / edu / internet2 / middleware / shibboleth / common / SAMLBindingFactory.java
1 package edu.internet2.middleware.shibboleth.common;
2
3 import org.opensaml.SAMLBinding;
4 import org.opensaml.SAMLSOAPBinding;
5
6 import edu.internet2.middleware.shibboleth.common.*;
7
8 /**
9  *  Used by Shibboleth SHAR/AA to locate a SAML binding implementation
10  *
11  * @author     Scott Cantor
12  * @created    April 10, 2002
13  */
14 public class SAMLBindingFactory
15 {
16     /**
17      *  Gets a compatible binding implementation for the specified protocol and
18      *  policies
19      *
20      * @param  protocol                          URI of SAML binding protocol
21      * @param  policies                          Array of policy URIs that the
22      *      implementation must support
23      * @return                                   A compatible binding
24      *      implementation or null if one cannot be found
25      */
26     public static SAMLBinding getInstance(String protocol, String[] policies)
27     {
28         // Current version only knows about SOAP binding and Club Shib...
29         if (protocol == null || !protocol.equals(SAMLBinding.SAML_SOAP_HTTPS))
30             return null;
31         if (policies==null || policies.length!=1 || !policies[0].equals(Constants.POLICY_CLUBSHIB))
32             return null;
33         return new SAMLSOAPBinding();
34     }
35 }
36