/******************************************************************************* * Copyright 2014 Federal Chancellery Austria * MOA-ID has been developed in a cooperation between BRZ, the Federal * Chancellery Austria - ICT staff unit, and Graz University of Technology. * * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by * the European Commission - subsequent versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the Licence. * You may obtain a copy of the Licence at: * http://www.osor.eu/eupl/ * * Unless required by applicable law or agreed to in writing, software * distributed under the Licence is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions and * limitations under the Licence. * * This product combines work with different licenses. See the "NOTICE" text * file for details on the various modules and licenses. * The "NOTICE" text file is part of the distribution. Any derivative works * that you distribute must include a readable copy of the "NOTICE" text file. ******************************************************************************/ /* * Copyright 2003 Federal Chancellery Austria * MOA-ID has been developed in a cooperation between BRZ, the Federal * Chancellery Austria - ICT staff unit, and Graz University of Technology. * * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by * the European Commission - subsequent versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the Licence. * You may obtain a copy of the Licence at: * http://www.osor.eu/eupl/ * * Unless required by applicable law or agreed to in writing, software * distributed under the Licence is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions and * limitations under the Licence. * * This product combines work with different licenses. See the "NOTICE" text * file for details on the various modules and licenses. * The "NOTICE" text file is part of the distribution. Any derivative works * that you distribute must include a readable copy of the "NOTICE" text file. */ package at.gv.egovernment.moa.id.auth.data; import at.gv.egovernment.moa.id.commons.api.data.ExtendedSAMLAttribute; /** * Default implementation of the {@link InfoboxValidationResult} interface. * * @author Harald Bratko */ public class InfoboxValidationResultImpl implements InfoboxValidationResult { /** * Indicates whether the validation was successful or not. */ protected boolean valid_; /** * The error message. */ protected String errorMessage_; /** * The SAML attributes returned by the infobox validator. */ protected ExtendedSAMLAttribute[] extendedSamlAttributes_; /** * Empty constructor. */ public InfoboxValidationResultImpl() { } /** * Constructor to set all values. * * @param valid Global validation result. * @param extendedSamlAttributes SAML attributes that should be appended to the final * SAML Assertion or to the AUTH Block * or to both. * @param errorMessage An error message if infobox validation fails. */ public InfoboxValidationResultImpl( boolean valid, ExtendedSAMLAttribute[] extendedSamlAttributes, String errorMessage) { valid_ = valid; extendedSamlAttributes_ = extendedSamlAttributes; errorMessage_ = errorMessage; } /** * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult#getErrorMessage() */ public String getErrorMessage() { return errorMessage_; } /** * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult#getExtendedSamlAttributes() */ public ExtendedSAMLAttribute[] getExtendedSamlAttributes() { return extendedSamlAttributes_; } /** * @see at.gv.egovernment.moa.id.auth.data.InfoboxValidationResult#isValid() */ public boolean isValid() { return valid_; } /** * Sets the error message if validation fails.. * * @param errorMessage The error message to set. */ public void setErrorMessage(String errorMessage) { errorMessage_ = errorMessage; } /** * Sets the SAML attributes returned by the infobox validatior.. * * @param extendedSamlAttributes The SAML attributes returned by the infobox validator. */ public void setExtendedSamlAttributes(ExtendedSAMLAttribute[] extendedSamlAttributes) { extendedSamlAttributes_ = extendedSamlAttributes; } /** * Sets validation result.. * * @param valid True if the infobox could be validated successfully, * otherwise false. */ public void setValid(boolean valid) { valid_ = valid; } }