/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: AuthorityBinding.java,v 1.2 2008/06/25 05:47:32 qcheng Exp $
*
*/
/**
* The <code>AuthorityBinding</code> element may be used to indicate
* to a replying party receiving an <code>AuthenticationStatement</code> that
* a SAML authority may be available to provide additional information about
* the subject of the statement. A single SAML authority may advertise its
* presence over multiple protocol binding, at multiple locations, and as
* more than one kind of authority by sending multiple elements as needed.
* @supported.all.api
*/
public class AuthorityBinding {
/**
*The <code>AuthorityKindType</code> is an inner class defining constants for
*the representing the type of SAML protocol queries to which the authority
*described by this element will respond.
*<br>1 implies <code>AUTHENTICATION</code>
*<br>2 implies <code>ATTRIBUTE</code>
*<br>3 implies <code>AUTHORIZATION</code>
*<br>-1 implies <code>NOT_SUPPORTED</code>
*/
public static class AuthorityKindType {
/**
* Authentication Query.
*/
/**
* Attribute Query.
*/
/**
* Authorization Decision Query.
*/
/**
* Unsupported Query.
*/
}
/**
* Constructs an <code>AuthorityBinding</code> element from an existing XML
* block.
*
* @param element representing a DOM tree element.
* @exception SAMLException if there is an error in the sender or in the
* element definition.
*/
// make sure that the input xml block is not null
throw new SAMLRequesterException(
}
// Make sure this is an AuthorityBinding.
throw new SAMLRequesterException(
}
int i = 0;
//handle the attributes of AuthorityBinding
for (i = 0; i < attrCount; i++) {
"Attribute Name is either null or empty.");
}
throw new SAMLRequesterException(
}
"AuthorityKind is null or empty.");
}
throw new SAMLRequesterException(
"missingAttributeValue"));
}
else {
"The type of authority is illegal!");
}
throw new SAMLRequesterException(
}
"Binding URI is null or empty.");
}
throw new SAMLRequesterException(
"missingAttributeValue"));
}
+ " Location URI is null or empty.");
}
throw new SAMLRequesterException(
"missingAttributeValue"));
}
}
} // end of if (att.getNodeType() == Node.ATTRIBUTE_NODE)
} // end of for loop
// AuthorityKind is required
"AuthorityKind is required attribute");
}
throw new SAMLRequesterException(
}
// Location is required
"required attribute");
}
throw new SAMLRequesterException(
}
// Binding is required
" required attribute");
}
throw new SAMLRequesterException(
}
// handle the children elements of AuthorityBinding
// Since it does not contain any child element_node,
// we will throw exception if we found any such child.
if (nodeCount > 0) {
for (i = 0; i < nodeCount; i++) {
" illegal input!");
}
throw new SAMLRequesterException(
}
}
}
}
/**
*Constructs <code>AuthorityBinding</code>
*@param authKind A integer representing the type of SAML protocol queries
* to which the authority described by this element will
* respond. If you do NO specify this attribute, pass in
* value "-1".
*@param location A URI describing how to locate and communicate with the
* authority, the exact syntax of which depends on the
* protocol binding in use.
*@param binding A String representing a URI reference identifying the
* SAML protocol binding to use in communicating with the
* authority.
*@exception SAMLException if there is an error in the sender or in the
* element definition.
*/
throws SAMLException {
"Location URI can not be null or empty!");
}
throw new SAMLRequesterException(
} else {
}
"binding URI can not be null or empty!");
}
throw new SAMLRequesterException(
} else {
}
} else {
"authority is illegal!");
}
throw new SAMLRequesterException(
}
}
/**
*Gets the Location URI
*@return A String representing the URI describing how to locate and
* communicate with the authority, the exact syntax of which
* depends on the protocol binding in use.
*/
return _location;
}
/**
*Gets the binding URI
*@return A String representing a URI reference identifying the SAML
* protocol binding to use in communicating with the authority.
*/
return _binding;
}
/**
* Returns the <code>AuthorityKind</code>.
*
* @return A integer representing the type of SAML protocol queries to which
* the authority described by this element will respond.
*/
public int getAuthorityKind() {
return _authorityKind;
}
/**
* Returns a String representation of the <code>AuthorityBinding</code>
*
* @return A String representation of the
* <code>AuthorityBinding</code> element.
*/
return (toString(true, false));
}
/**
* Returns a String representation of the <code>AuthorityBinding</code>
* @param includeNS Determines whether or not the namespace qualifier is
* prepended to the Element when converted
* @param declareNS Determines whether or not the namespace is declared
* within the Element.
* @return A String representation of the <code>AuthorityBinding</code>
* element.
*/
if (includeNS) {
}
if (declareNS) {
}
switch(_authorityKind) {
break;
case AuthorityKindType.ATTRIBUTE:
break ;
break ;
}
}
}