clean up some code
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 4 Jul 2007 21:25:02 +0000 (21:25 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 4 Jul 2007 21:25:02 +0000 (21:25 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@2295 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/idp/profile/saml1/AbstractSAML1ProfileHandler.java
src/edu/internet2/middleware/shibboleth/idp/profile/saml1/ShibbolethSSOProfileHandler.java
src/edu/internet2/middleware/shibboleth/idp/profile/saml2/AbstractSAML2ProfileHandler.java
src/edu/internet2/middleware/shibboleth/idp/profile/saml2/SSOProfileHandler.java

index 158486d..d377844 100644 (file)
@@ -102,9 +102,6 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
     /** Builder of AudienceRestrictionCondition objects. */
     private SAMLObjectBuilder<Audience> audienceBuilder;
 
-    /** Builder of NameIdentifier objects. */
-    private SAMLObjectBuilder<NameIdentifier> nameIdBuilder;
-
     /** Builder of SubjectConfirmation objects. */
     private SAMLObjectBuilder<SubjectConfirmation> subjectConfirmationBuilder;
 
@@ -140,8 +137,6 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
         audienceRestrictionConditionBuilder = (SAMLObjectBuilder<AudienceRestrictionCondition>) getBuilderFactory()
                 .getBuilder(AudienceRestrictionCondition.DEFAULT_ELEMENT_NAME);
         audienceBuilder = (SAMLObjectBuilder<Audience>) getBuilderFactory().getBuilder(Audience.DEFAULT_ELEMENT_NAME);
-        nameIdBuilder = (SAMLObjectBuilder<NameIdentifier>) getBuilderFactory().getBuilder(
-                NameIdentifier.DEFAULT_ELEMENT_NAME);
         subjectConfirmationBuilder = (SAMLObjectBuilder<SubjectConfirmation>) getBuilderFactory().getBuilder(
                 SubjectConfirmation.DEFAULT_ELEMENT_NAME);
         confirmationMethodBuilder = (SAMLObjectBuilder<ConfirmationMethod>) getBuilderFactory().getBuilder(
@@ -156,114 +151,6 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
     }
 
     /**
-     * Convenience method for getting the SAML 1 Response builder.
-     * 
-     * @return SAML 1 Response builder
-     */
-    public SAMLObjectBuilder<Response> getResponseBuilder() {
-        return responseBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 1 Assertion builder.
-     * 
-     * @return SAML 1 Assertion builder
-     */
-    public SAMLObjectBuilder<Assertion> getAssertionBuilder() {
-        return assertionBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 1 Conditions builder.
-     * 
-     * @return SAML 1 Conditions builder
-     */
-    public SAMLObjectBuilder<Conditions> getConditionsBuilder() {
-        return conditionsBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 1 AudienceRestrictionCondition builder.
-     * 
-     * @return SAML 1 AudienceRestrictionCondition builder
-     */
-    public SAMLObjectBuilder<AudienceRestrictionCondition> getAudienceRestrictionConditionBuilder() {
-        return audienceRestrictionConditionBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 1 Audience builder.
-     * 
-     * @return SAML 1 Audience builder
-     */
-    public SAMLObjectBuilder<Audience> getAudienceBuilder() {
-        return audienceBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 1 NameIdentifier builder.
-     * 
-     * @return SAML 1 NameIdentifier builder
-     */
-    public SAMLObjectBuilder<NameIdentifier> getNameIdentifierBuilder() {
-        return nameIdBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 1 SubjectConfirmation builder.
-     * 
-     * @return SAML 1 SubjectConfirmation builder
-     */
-    public SAMLObjectBuilder<SubjectConfirmation> getSubjectConfirmationBuilder() {
-        return subjectConfirmationBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 1 ConfirmationMethod builder.
-     * 
-     * @return SAML 1 ConfirmationMethod builder
-     */
-    public SAMLObjectBuilder<ConfirmationMethod> getConfirmationMethodBuilder() {
-        return confirmationMethodBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 1 Subject builder.
-     * 
-     * @return SAML 1 Subject builder
-     */
-    public SAMLObjectBuilder<Subject> getSubjectBuilder() {
-        return subjectBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 1 Status builder.
-     * 
-     * @return SAML 1 Status builder
-     */
-    public SAMLObjectBuilder<Status> getStatusBuilder() {
-        return statusBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 1 StatusCode builder.
-     * 
-     * @return SAML 2 StatusCode builder
-     */
-    public SAMLObjectBuilder<StatusCode> getStatusCodeBuilder() {
-        return statusCodeBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 1 StatusMessage builder.
-     * 
-     * @return SAML StatusMessage builder
-     */
-    public SAMLObjectBuilder<StatusMessage> getStatusMessageBuilder() {
-        return statusMessageBuilder;
-    }
-
-    /**
      * Checks that the SAML major version for a request is 1.
      * 
      * @param requestContext current request context containing the SAML message
@@ -309,7 +196,7 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
         }
 
         // create the SAML response and add the assertion
-        Response samlResponse = getResponseBuilder().buildObject();
+        Response samlResponse = responseBuilder.buildObject();
         samlResponse.setIssueInstant(issueInstant);
         populateStatusResponse(requestContext, samlResponse);
 
@@ -333,7 +220,7 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
      * @return the built assertion
      */
     protected Assertion buildAssertion(SAML1ProfileRequestContext requestContext, DateTime issueInstant) {
-        Assertion assertion = getAssertionBuilder().buildObject();
+        Assertion assertion = assertionBuilder.buildObject();
         assertion.setID(getIdGenerator().generateIdentifier());
         assertion.setIssueInstant(issueInstant);
         assertion.setVersion(SAMLVersion.VERSION_11);
@@ -357,7 +244,7 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
     protected Conditions buildConditions(SAML1ProfileRequestContext requestContext, DateTime issueInstant) {
         AbstractSAML1ProfileConfiguration profileConfig = requestContext.getProfileConfiguration();
 
-        Conditions conditions = getConditionsBuilder().buildObject();
+        Conditions conditions = conditionsBuilder.buildObject();
         conditions.setNotBefore(issueInstant);
         conditions.setNotOnOrAfter(issueInstant.plus(profileConfig.getAssertionLifetime()));
 
@@ -366,9 +253,9 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
         // add audience restrictions
         audiences = profileConfig.getAssertionAudiences();
         if (audiences != null && audiences.size() > 0) {
-            AudienceRestrictionCondition audienceRestriction = getAudienceRestrictionConditionBuilder().buildObject();
+            AudienceRestrictionCondition audienceRestriction = audienceRestrictionConditionBuilder.buildObject();
             for (String audienceUri : audiences) {
-                Audience audience = getAudienceBuilder().buildObject();
+                Audience audience = audienceBuilder.buildObject();
                 audience.setUri(audienceUri);
                 audienceRestriction.getAudiences().add(audience);
             }
@@ -394,13 +281,13 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
         NameIdentifier nameID = buildNameId(requestContext);
         requestContext.setSubjectNameID(nameID);
 
-        ConfirmationMethod method = getConfirmationMethodBuilder().buildObject();
+        ConfirmationMethod method = confirmationMethodBuilder.buildObject();
         method.setConfirmationMethod(confirmationMethod);
 
-        SubjectConfirmation subjectConfirmation = getSubjectConfirmationBuilder().buildObject();
+        SubjectConfirmation subjectConfirmation = subjectConfirmationBuilder.buildObject();
         subjectConfirmation.getConfirmationMethods().add(method);
 
-        Subject subject = getSubjectBuilder().buildObject();
+        Subject subject = subjectBuilder.buildObject();
         subject.setNameIdentifier(nameID);
         subject.setSubjectConfirmation(subjectConfirmation);
 
@@ -539,7 +426,7 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
      * @return the constructed error response
      */
     protected Response buildErrorResponse(SAML1ProfileRequestContext requestContext) {
-        Response samlResponse = getResponseBuilder().buildObject();
+        Response samlResponse = responseBuilder.buildObject();
         samlResponse.setIssueInstant(new DateTime());
         populateStatusResponse(requestContext, samlResponse);
 
@@ -574,20 +461,20 @@ public abstract class AbstractSAML1ProfileHandler extends AbstractSAMLProfileHan
      * @return a Status object.
      */
     protected Status buildStatus(QName topLevelCode, QName secondLevelCode, String failureMessage) {
-        Status status = getStatusBuilder().buildObject();
+        Status status = statusBuilder.buildObject();
 
-        StatusCode statusCode = getStatusCodeBuilder().buildObject();
+        StatusCode statusCode = statusCodeBuilder.buildObject();
         statusCode.setValue(topLevelCode);
         status.setStatusCode(statusCode);
 
         if (secondLevelCode != null) {
-            StatusCode secondLevelStatusCode = getStatusCodeBuilder().buildObject();
+            StatusCode secondLevelStatusCode = statusCodeBuilder.buildObject();
             secondLevelStatusCode.setValue(secondLevelCode);
             statusCode.setStatusCode(secondLevelStatusCode);
         }
 
         if (failureMessage != null) {
-            StatusMessage msg = getStatusMessageBuilder().buildObject();
+            StatusMessage msg = statusMessageBuilder.buildObject();
             msg.setMessage(failureMessage);
             status.setStatusMessage(msg);
         }
index 1b38044..c64d053 100644 (file)
@@ -94,15 +94,6 @@ public class ShibbolethSSOProfileHandler extends AbstractSAML1ProfileHandler {
                 SubjectLocality.DEFAULT_ELEMENT_NAME);
     }
 
-    /**
-     * Convenience method for getting the SAML 1 AuthenticationStatement builder.
-     * 
-     * @return SAML 1 AuthenticationStatement builder
-     */
-    public SAMLObjectBuilder<AuthenticationStatement> getAuthenticationStatementBuilder() {
-        return authnStatementBuilder;
-    }
-
     /** {@inheritDoc} */
     public String getProfileId() {
         return "urn:mace:shibboleth:2.0:idp:profiles:shibboleth:request:sso";
@@ -380,7 +371,7 @@ public class ShibbolethSSOProfileHandler extends AbstractSAML1ProfileHandler {
             throws ProfileException {
         ShibbolethSSOLoginContext loginContext = requestContext.getLoginContext();
 
-        AuthenticationStatement statement = getAuthenticationStatementBuilder().buildObject();
+        AuthenticationStatement statement = authnStatementBuilder.buildObject();
         statement.setAuthenticationInstant(loginContext.getAuthenticationInstant());
         statement.setAuthenticationMethod(loginContext.getAuthenticationMethod());
 
index f484610..a5c900b 100644 (file)
@@ -30,7 +30,6 @@ import org.opensaml.common.SAMLObjectBuilder;
 import org.opensaml.common.SAMLVersion;
 import org.opensaml.common.impl.SAMLObjectContentReference;
 import org.opensaml.log.Level;
-import org.opensaml.saml2.core.Advice;
 import org.opensaml.saml2.core.Assertion;
 import org.opensaml.saml2.core.AttributeQuery;
 import org.opensaml.saml2.core.AttributeStatement;
@@ -124,9 +123,6 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
     /** For building audience. */
     private SAMLObjectBuilder<Audience> audienceBuilder;
 
-    /** For building advice. */
-    private SAMLObjectBuilder<Advice> adviceBuilder;
-
     /** For building signature. */
     private XMLObjectBuilder<Signature> signatureBuilder;
 
@@ -154,137 +150,10 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
         proxyRestrictionBuilder = (SAMLObjectBuilder<ProxyRestriction>) getBuilderFactory().getBuilder(
                 ProxyRestriction.DEFAULT_ELEMENT_NAME);
         audienceBuilder = (SAMLObjectBuilder<Audience>) getBuilderFactory().getBuilder(Audience.DEFAULT_ELEMENT_NAME);
-        adviceBuilder = (SAMLObjectBuilder<Advice>) getBuilderFactory().getBuilder(Advice.DEFAULT_ELEMENT_NAME);
         signatureBuilder = (XMLObjectBuilder<Signature>) getBuilderFactory().getBuilder(Signature.DEFAULT_ELEMENT_NAME);
     }
 
     /**
-     * Convenience method for getting the SAML 2 advice builder.
-     * 
-     * @return SAML 2 advice builder
-     */
-    public SAMLObjectBuilder<Advice> getAdviceBuilder() {
-        return adviceBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 assertion builder.
-     * 
-     * @return SAML 2 assertion builder
-     */
-    public SAMLObjectBuilder<Assertion> getAssertionBuilder() {
-        return assertionBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 audience builder.
-     * 
-     * @return SAML 2 audience builder
-     */
-    public SAMLObjectBuilder<Audience> getAudienceBuilder() {
-        return audienceBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 audience restriction builder.
-     * 
-     * @return SAML 2 audience restriction builder
-     */
-    public SAMLObjectBuilder<AudienceRestriction> getAudienceRestrictionBuilder() {
-        return audienceRestrictionBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 conditions builder.
-     * 
-     * @return SAML 2 conditions builder
-     */
-    public SAMLObjectBuilder<Conditions> getConditionsBuilder() {
-        return conditionsBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 Issuer builder.
-     * 
-     * @return SAML 2 Issuer builder
-     */
-    public SAMLObjectBuilder<Issuer> getIssuerBuilder() {
-        return issuerBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 proxy restriction builder.
-     * 
-     * @return SAML 2 proxy restriction builder
-     */
-    public SAMLObjectBuilder<ProxyRestriction> getProxyRestrictionBuilder() {
-        return proxyRestrictionBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 response builder.
-     * 
-     * @return SAML 2 response builder
-     */
-    public SAMLObjectBuilder<Response> getResponseBuilder() {
-        return responseBuilder;
-    }
-
-    /**
-     * Convenience method for getting the Signature builder.
-     * 
-     * @return signature builder
-     */
-    public XMLObjectBuilder<Signature> getSignatureBuilder() {
-        return signatureBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 status builder.
-     * 
-     * @return SAML 2 status builder
-     */
-    public SAMLObjectBuilder<Status> getStatusBuilder() {
-        return statusBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 status code builder.
-     * 
-     * @return SAML 2 status code builder
-     */
-    public SAMLObjectBuilder<StatusCode> getStatusCodeBuilder() {
-        return statusCodeBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 status message builder.
-     * 
-     * @return SAML 2 status message builder
-     */
-    public SAMLObjectBuilder<StatusMessage> getStatusMessageBuilder() {
-        return statusMessageBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 subject builder.
-     * 
-     * @return SAML 2 subject builder
-     */
-    public SAMLObjectBuilder<Subject> getSubjectBuilder() {
-        return subjectBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 subject confirmation builder.
-     * 
-     * @return SAML 2 subject confirmation builder
-     */
-    public SAMLObjectBuilder<SubjectConfirmation> getSubjectConfirmationBuilder() {
-        return subjectConfirmationBuilder;
-    }
-
-    /**
      * Checks that the SAML major version for a request is 2.
      * 
      * @param requestContext current request context containing the SAML message
@@ -328,7 +197,7 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
         }
 
         // create the SAML response and add the assertion
-        Response samlResponse = getResponseBuilder().buildObject();
+        Response samlResponse = responseBuilder.buildObject();
         samlResponse.setIssueInstant(issueInstant);
         populateStatusResponse(requestContext, samlResponse);
 
@@ -352,7 +221,7 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
      * @return the built assertion
      */
     protected Assertion buildAssertion(SAML2ProfileRequestContext requestContext, DateTime issueInstant) {
-        Assertion assertion = getAssertionBuilder().buildObject();
+        Assertion assertion = assertionBuilder.buildObject();
         assertion.setID(getIdGenerator().generateIdentifier());
         assertion.setIssueInstant(issueInstant);
         assertion.setVersion(SAMLVersion.VERSION_20);
@@ -372,7 +241,7 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
      * @return the built issuer
      */
     protected Issuer buildEntityIssuer(SAML2ProfileRequestContext requestContext) {
-        Issuer issuer = getIssuerBuilder().buildObject();
+        Issuer issuer = issuerBuilder.buildObject();
         issuer.setFormat(Issuer.ENTITY);
         issuer.setValue(requestContext.getAssertingPartyId());
 
@@ -391,7 +260,7 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
     protected Conditions buildConditions(SAML2ProfileRequestContext requestContext, DateTime issueInstant) {
         AbstractSAML2ProfileConfiguration profileConfig = requestContext.getProfileConfiguration();
 
-        Conditions conditions = getConditionsBuilder().buildObject();
+        Conditions conditions = conditionsBuilder.buildObject();
         conditions.setNotBefore(issueInstant);
         conditions.setNotOnOrAfter(issueInstant.plus(profileConfig.getAssertionLifetime()));
 
@@ -400,9 +269,9 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
         // add audience restrictions
         audiences = profileConfig.getAssertionAudiences();
         if (audiences != null && audiences.size() > 0) {
-            AudienceRestriction audienceRestriction = getAudienceRestrictionBuilder().buildObject();
+            AudienceRestriction audienceRestriction = audienceRestrictionBuilder.buildObject();
             for (String audienceUri : audiences) {
-                Audience audience = getAudienceBuilder().buildObject();
+                Audience audience = audienceBuilder.buildObject();
                 audience.setAudienceURI(audienceUri);
                 audienceRestriction.getAudiences().add(audience);
             }
@@ -412,10 +281,10 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
         // add proxy restrictions
         audiences = profileConfig.getProxyAudiences();
         if (audiences != null && audiences.size() > 0) {
-            ProxyRestriction proxyRestriction = getProxyRestrictionBuilder().buildObject();
+            ProxyRestriction proxyRestriction = proxyRestrictionBuilder.buildObject();
             Audience audience;
             for (String audienceUri : audiences) {
-                audience = getAudienceBuilder().buildObject();
+                audience = audienceBuilder.buildObject();
                 audience.setAudienceURI(audienceUri);
                 proxyRestriction.getAudiences().add(audience);
             }
@@ -642,20 +511,20 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
      * @return a Status object.
      */
     protected Status buildStatus(String topLevelCode, String secondLevelCode, String failureMessage) {
-        Status status = getStatusBuilder().buildObject();
+        Status status = statusBuilder.buildObject();
 
-        StatusCode statusCode = getStatusCodeBuilder().buildObject();
+        StatusCode statusCode = statusCodeBuilder.buildObject();
         statusCode.setValue(DatatypeHelper.safeTrimOrNullString(topLevelCode));
         status.setStatusCode(statusCode);
 
         if (secondLevelCode != null) {
-            StatusCode secondLevelStatusCode = getStatusCodeBuilder().buildObject();
+            StatusCode secondLevelStatusCode = statusCodeBuilder.buildObject();
             secondLevelStatusCode.setValue(DatatypeHelper.safeTrimOrNullString(secondLevelCode));
             statusCode.setStatusCode(secondLevelStatusCode);
         }
 
         if (failureMessage != null) {
-            StatusMessage msg = getStatusMessageBuilder().buildObject();
+            StatusMessage msg = statusMessageBuilder.buildObject();
             msg.setMessage(failureMessage);
             status.setStatusMessage(msg);
         }
@@ -680,10 +549,10 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
         requestContext.setSubjectNameID(nameID);
         // TODO handle encryption
 
-        SubjectConfirmation subjectConfirmation = getSubjectConfirmationBuilder().buildObject();
+        SubjectConfirmation subjectConfirmation = subjectConfirmationBuilder.buildObject();
         subjectConfirmation.setMethod(confirmationMethod);
 
-        Subject subject = getSubjectBuilder().buildObject();
+        Subject subject = subjectBuilder.buildObject();
         subject.setNameID(nameID);
         subject.getSubjectConfirmations().add(subjectConfirmation);
 
@@ -831,7 +700,7 @@ public abstract class AbstractSAML2ProfileHandler extends AbstractSAMLProfileHan
      * @return the constructed error response
      */
     protected Response buildErrorResponse(SAML2ProfileRequestContext requestContext) {
-        Response samlResponse = getResponseBuilder().buildObject();
+        Response samlResponse = responseBuilder.buildObject();
         samlResponse.setIssueInstant(new DateTime());
         populateStatusResponse(requestContext, samlResponse);
 
index c6de865..dfbfb5d 100644 (file)
@@ -117,42 +117,6 @@ public class SSOProfileHandler extends AbstractSAML2ProfileHandler {
                 SubjectLocality.DEFAULT_ELEMENT_NAME);
     }
 
-    /**
-     * Convenience method for getting the SAML 2 AuthnStatement builder.
-     * 
-     * @return SAML 2 AuthnStatement builder
-     */
-    public SAMLObjectBuilder<AuthnStatement> getAuthnStatementBuilder() {
-        return authnStatementBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 AuthnContext builder.
-     * 
-     * @return SAML 2 AuthnContext builder
-     */
-    public SAMLObjectBuilder<AuthnContext> getAuthnContextBuilder() {
-        return authnContextBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 AuthnContextClassRef builder.
-     * 
-     * @return SAML 2 AuthnContextClassRef builder
-     */
-    public SAMLObjectBuilder<AuthnContextClassRef> getAuthnContextClassRefBuilder() {
-        return authnContextClassRefBuilder;
-    }
-
-    /**
-     * Convenience method for getting the SAML 2 AuthnContextDeclRef builder.
-     * 
-     * @return SAML 2 AuthnContextDeclRef builder
-     */
-    public SAMLObjectBuilder<AuthnContextDeclRef> getAuthnContextDeclRefBuilder() {
-        return authnContextDeclRefBuilder;
-    }
-
     /** {@inheritDoc} */
     public String getProfileId() {
         return "urn:mace:shibboleth:2.0:idp:profiles:saml2:request:sso";
@@ -375,7 +339,7 @@ public class SSOProfileHandler extends AbstractSAML2ProfileHandler {
 
         AuthnContext authnContext = buildAuthnContext(requestContext);
 
-        AuthnStatement statement = getAuthnStatementBuilder().buildObject();
+        AuthnStatement statement = authnStatementBuilder.buildObject();
         statement.setAuthnContext(authnContext);
         statement.setAuthnInstant(loginContext.getAuthenticationInstant());
 
@@ -400,7 +364,7 @@ public class SSOProfileHandler extends AbstractSAML2ProfileHandler {
      * @return the built authn context
      */
     protected AuthnContext buildAuthnContext(SSORequestContext requestContext) {
-        AuthnContext authnContext = getAuthnContextBuilder().buildObject();
+        AuthnContext authnContext = authnContextBuilder.buildObject();
 
         Saml2LoginContext loginContext = requestContext.getLoginContext();
         AuthnRequest authnRequest = requestContext.getSamlRequest();
@@ -409,7 +373,7 @@ public class SSOProfileHandler extends AbstractSAML2ProfileHandler {
             if (requestedAuthnContext.getAuthnContextClassRefs() != null) {
                 for (AuthnContextClassRef classRef : requestedAuthnContext.getAuthnContextClassRefs()) {
                     if (classRef.getAuthnContextClassRef().equals(loginContext.getAuthenticationMethod())) {
-                        AuthnContextClassRef ref = getAuthnContextClassRefBuilder().buildObject();
+                        AuthnContextClassRef ref = authnContextClassRefBuilder.buildObject();
                         ref.setAuthnContextClassRef(loginContext.getAuthenticationMethod());
                         authnContext.setAuthnContextClassRef(ref);
                     }
@@ -417,14 +381,14 @@ public class SSOProfileHandler extends AbstractSAML2ProfileHandler {
             } else if (requestedAuthnContext.getAuthnContextDeclRefs() != null) {
                 for (AuthnContextDeclRef declRef : requestedAuthnContext.getAuthnContextDeclRefs()) {
                     if (declRef.getAuthnContextDeclRef().equals(loginContext.getAuthenticationMethod())) {
-                        AuthnContextDeclRef ref = getAuthnContextDeclRefBuilder().buildObject();
+                        AuthnContextDeclRef ref = authnContextDeclRefBuilder.buildObject();
                         ref.setAuthnContextDeclRef(loginContext.getAuthenticationMethod());
                         authnContext.setAuthnContextDeclRef(ref);
                     }
                 }
             }
         } else {
-            AuthnContextDeclRef ref = getAuthnContextDeclRefBuilder().buildObject();
+            AuthnContextDeclRef ref = authnContextDeclRefBuilder.buildObject();
             ref.setAuthnContextDeclRef(loginContext.getAuthenticationMethod());
             authnContext.setAuthnContextDeclRef(ref);
         }