b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * The contents of this file are subject to the terms
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * of the Common Development and Distribution License
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * (the License). You may not use this file except in
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * compliance with the License.
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * You can obtain a copy of the License at
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * See the License for the specific language governing
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * permission and limitations under the License.
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * When distributing Covered Code, include this CDDL
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * Header Notice in each file and include the License file
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * If applicable, add the following below the CDDL Header,
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * with the fields enclosed by brackets [] replaced by
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * your own identifying information:
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen * $Id: AccessAccept.java,v 1.2 2008/06/25 05:42:00 qcheng Exp $
a4544a5a0e622ef69e38641f87ab1b5685e05911Phill Cunnington * Portions Copyrighted 2011-2015 ForgeRock AS.
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen * Portions Copyrighted 2015 Intellectual Reserve, Inc (IRI)
b67fa9bf4094b26e52521e7289a660e09bfa6e25Allan Fosterpackage com.sun.identity.authentication.modules.radius.client;
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowenimport org.forgerock.openam.radius.common.AccessChallenge;
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowenimport org.forgerock.openam.radius.common.AttributeSet;
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowenimport org.forgerock.openam.radius.common.AttributeType;
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowenimport org.forgerock.openam.radius.common.ReplyMessageAttribute;
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowenimport org.forgerock.openam.radius.common.StateAttribute;
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen * Used for handling received challenge responses from radius servers.
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowenpublic class ChallengeException extends Exception {
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen * The received packet.
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen * Constructs an instance from the received response packet.
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen * @param res the response packet.
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen public ChallengeException(AccessChallenge res) {
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen * Returns the set of attributes in this packet.
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen * @return the set of attributes.
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen * Returns the state value for the packet as contained in the nested state attribute.
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen * @return the state value.
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen return ((StateAttribute) (challenge.getAttributeSet().
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen getAttributeByType(AttributeType.STATE))).getState();
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen * Returns the value of the first incurred reply message attribute contained in the packet.
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen * @return the message string or the empty string if not found
5c124de5c36bfc236d55578429df5f048f0d0a07Jamie Bowen ReplyMessageAttribute a = ((ReplyMessageAttribute) (challenge.getAttributeSet().