/**
* 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: ResourceAccessStatement.java,v 1.2 2008/06/25 05:47:20 qcheng Exp $
*
*/
/**
* The <code>ResourceAccessStatement</code> class conveys information regarding
* the accessing entities and the resource for which access is being attempted.
*
* @supported.all.api
*/
/**
* The Statement is an Resource Access Statement.
*/
/**
* Constructs an <code>ResourceAccessStatement</code> object from a DOM
* Element.
*
* @param element representing a DOM tree element
* @throws SAMLException if there is an error in the sender or in the
* element definition.
*/
// make sure input is not null
throw new SAMLRequesterException(
}
// check if it's an ResourceAccessStatement
"ResourceAccessStatement");
if (!valid) {
throw new SAMLRequesterException(
}
//Handle the children elements of ResourceAccessStatement
if (nodeCount > 0) {
for (int i = 0; i < nodeCount; i++) {
"The tag name or tag namespace of child" +
" element is either null or empty.");
}
throw new SAMLRequesterException(
}
"Statement:should only contain one subject");
}
throw new SAMLRequesterException(
} else {
}
if (_resourceID != null ||
_encryptedResourceID != null) {
"Statement: should at most " +
"contain one ResourceIDGroup.");
}
throw new SAMLRequesterException(
}
try {
}
if (_resourceID != null ||
_encryptedResourceID != null) {
"Statement: should at most " +
"contain one ResourceIDGroup.");
}
throw new SAMLRequesterException(
}
try {
}
if (_proxySubject != null) {
"Statement: should at most " +
"contain one ProxySubject.");
}
throw new SAMLRequesterException(
} else {
}
if (_sessionContext != null) {
"Statement: should at most " +
"contain one SessionContext.");
}
throw new SAMLRequesterException(
} else {
}
} else {
}
throw new SAMLRequesterException(
}
} // end of if (currentNode.getNodeType() == Node.ELEMENT_NODE)
} // end of for loop
} // end of if (nodeCount > 0)
// check if the subject is null
"contain one subject.");
}
throw new SAMLRequesterException(
}
}
/**
* Constructs a <code>ResourceAccessStatement</code> object from a
* <code>String</code> object and a <code>Subject</code>.
*
* @param resourceID <code>String</code>.
* @param subject <code>Subject</code> object.
* @throws SAMLException if subject is null.
*/
// check if the subject is null
" contain one subject.");
}
throw new SAMLRequesterException(
} else {
}
}
/**
* Constructs a <code>ResourceAccessStatement</code> object from a
* <code>String</code> object, <code>ProxySubject</code> object and
* a <code>Subject</code>.
*
* @param resourceID <code>String</code>.
* @param proxySubject <code>ProxySubject</code> object.
* @param subject <code>Subject</code> object.
* @throws SAMLException if subject is null.
*/
" contain one subject.");
}
throw new SAMLRequesterException(
} else {
}
}
/**
* Constructs a <code>ResourceAccessStatement</code> object from a
* <code>String</code> object, <code>ProxySubject</code> object, a
* <code>SessionContext</code> object and a <code>Subject</code>.
*
* @param resourceID resource ID.
* @param proxySubject <code>ProxySubject</code> object.
* @param sessionContext <code>SessionContext</code> object.
* @param subject <code>Subject</code> object.
* @throws SAMLException if subject is null.
*/
// check if the subject is null
" contain one subject.");
}
throw new SAMLRequesterException(
} else {
}
}
/**
* Constructs a <code>ResourceAccessStatement</code> object from a
* <code>ResourceID</code> object, <code>ProxySubject</code> object, a
* <code>SessionContext</code> object and a <code>Subject</code>.
*
* @param resourceID resource ID.
* @param proxySubject <code>ProxySubject</code> object.
* @param sessionContext <code>SessionContext</code> object.
* @param subject <code>Subject</code> object.
* @throws SAMLException if subject is null.
*/
// check if the subject is null
" contain one subject.");
}
throw new SAMLRequesterException(
} else {
}
}
/**
* Constructs a <code>ResourceAccessStatement</code> object from a
* <code>EncryptedResourceID</code> object, <code>ProxySubject</code>
* object, a <code>SessionContext</code> object and a <code>Subject</code>.
*
* @param encryptedResourceID the encrypted resource ID.
* @param proxySubject <code>ProxySubject</code> object.
* @param sessionContext <code>SessionContext</code> object.
* @param subject <code>Subject</code> object.
* @throws SAMLException if subject is null.
*/
// check if the subject is null
" contain one subject.");
}
throw new SAMLRequesterException(
} else {
}
}
/**
* Gets the <code>ResourceID</code> from this
* <code>ResourceAccessStatement</code> object.
* @return resource ID
*/
}
/**
* Gets the <code>ResourceID</code> object from this
* <code>ResourceAccessStatement</code> object.
* @return resource ID
*/
return _resourceID;
}
/**
* Gets the <code>EncryptedResourceID</code> object from this
* <code>ResourceAccessStatement</code> object.
* @return encrypted resource ID
*/
return _encryptedResourceID;
}
/**
* Sets the <code>ResourceID</code> for this
* <code>ResourceAccessStatement</code> object.
*
* @param resourceID Resource ID.
* @return true if the operation is successful. Otherwise return false.
*/
if (resourceID == null) {
"setResourceID:Input is null.");
}
return false;
}
return true;
}
/**
* Sets the <code>ResourceID</code> for this
* <code>ResourceAccessStatement</code> object.
*
* @param resourceID Resource ID.
*/
}
/**
* Sets the <code>EncryptedResourceID</code> for this
* <code>ResourceAccessStatement</code> object.
*
* @param resourceID encrypted Resource ID.
*/
}
/**
* Returns the type of the Statement.
*
* @return An integer which represents <code>ResourceAccessStatement</code>
* internally.
*/
public int getStatementType() {
return RESOURCEACCESS_STATEMENT;
}
/**
* Sets the <code>SessionContext</code> for this
* <code>ResourceAccessStatement</code> object.
*
* @param sessionContext Session context object
* @return true if the operation is successful. Otherwise return false.
*/
if (sessionContext == null) {
"setSessionContext: Input is null.");
}
return false;
}
return true;
}
/**
* Gets the <code>SessionContext</code> from this
* <code>ResourceAccessStatement</code> object.
*
* @return <code>SessionContext</code>.
*/
return _sessionContext;
}
/**
* Returns the <code>ProxySubject</code> in the
* <code>ResourceAccessStatement</code>.
*
* @return <code>ProxySubject</code>.
*/
return _proxySubject;
}
/**
* Returns a String representation of the
* <code>ResourceAccessStatement</code>.
*
* @return A String representation of the
* <code>ResourceAccessStatement</code> element.
*/
return toString(true, false);
}
/**
* Returns a String representation of the
* <code>ResourceAccessStatement</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>ResourceAccessStatement</code> element.
*/
if (_resourceID != null) {
} else if (_encryptedResourceID != null) {
}
if (_proxySubject!=null) {
if (_sessionContext!=null) {
try {
} catch (Exception e) {
}
}
}
}
}