diff options
Diffstat (limited to 'id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResult.java')
-rw-r--r-- | id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResult.java | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResult.java b/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResult.java new file mode 100644 index 000000000..0ee2f21d5 --- /dev/null +++ b/id.server/src/at/gv/egovernment/moa/id/auth/data/InfoboxValidationResult.java @@ -0,0 +1,76 @@ +package at.gv.egovernment.moa.id.auth.data; + +import org.w3c.dom.Element; + +/** + * Includes the result of an extended infobox validation. + * + * If validation succeeds, an array of + * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute ExtendedSAMLAttributes} + * maybe provided. Each of these SAML-Attributes will be either appended to the + * final SAML-Assertion passed to the online application or to the AUTH-Block, + * or to both. + * <br> + * If validation fails the implementing class has to provide a short error message. + * <br> + * If the corresponding infobox validator runs in the so called <code>compatibility mode</code> + * a <code>pr:Persondata</code> element to be used in the final <code>saml:Assertion</code> + * ({@see #getPersonData()}) + * + * @author Harald Bratko + */ +public interface InfoboxValidationResult { + + /** + * The method returns <code>true</code> if validation succeeds. In that case + * method {@link #getExtendedSamlAttributes()} may provide an array of + * {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute + * ExtendedSAMLAttributes} that should be appended to the final SAML-Assertion or the + * AUTH-Block or to both. + * <br> + * The method returns <code>false</code> if validation fails. In that case + * method {@link #getErrorMessage()} has to provide a short error description. + * + * @return <code>True</code> if validation succeeds, + * otherwise <code>false</code>. + */ + public boolean isValid(); + + /** + * Returns an array of {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute + * ExtendedSAMLAttributes} that should be added to the SAML-Assertion + * provided to the online application. + * The SAML-Attributes in that array will be added to the final + * SAML-Assertion, the AUTH-Block, or both, exactly in the order as they are arranged + * in the array this method returns. + * + * @return An array of {@link at.gv.egovernment.moa.id.auth.data.ExtendedSAMLAttribute + * ExtendedSAMLAttributes} that should be added to the SAML-Assertion + * provided to the online application, the AUTH-Block, or both. If no attributes should + * be added this array maybe <code>null</code> or empty. + */ + public ExtendedSAMLAttribute[] getExtendedSamlAttributes(); + + /** + * A short error description that should be displayed by MOA-ID if + * validation of the InfoBoxReadResponse fails. + * + * @return An short error message if validation fails. + */ + public String getErrorMessage(); + + /** + * Returns a <code><pr:PersonData></code> element to be used in the final + * <code><saml:Assertion></code>. + * <br> + * If the corresponding infobox validator runs in the so called <code>compatibility mode</code> + * the method must return a <code><pr:PersonData></code> element to be used within + * the final <code><saml:Assertion></code> sent to the online application instead of + * the original <code><pr:PersonData></code> element derived from the <code><Identitylink></code>. + * + * @return A <code><pr:PersonData></code> element if the corresponding infobox validator + * runs in the <code>compatibility mode</code>, otherwise <code>null</code>. + */ + public Element getPersonData(); + +} |