ContextFactory.java revision 73308f54e60e4cdb893e8b02955497e8f45b5893
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007 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: ContextFactory.java,v 1.3 2008/06/25 05:48:11 qcheng Exp $
*
*/
/**
* This is the factory class to obtain instances of the objects defined
* in xacml context schema.
* There are three ways to obtain an instance of a object type:
* with no parameters, with a DOM tree element, or with an XML String.
*
* @supported.all.api
*/
public class ContextFactory {
/**
* Sole Constructor.
*/
private ContextFactory() {
}
/**
* Returns the instance of <code>ContextSchemaFactory</code>.
*
* @return <code>ContextSchemaFactory</code>.
*
*/
public static ContextFactory getInstance() {
return instance;
}
/**
* Returns a new instance of <code>Request</code>.
*
* @return a new instance of <code>Request</code>
*
*/
public Request createRequest() {
return new RequestImpl();
} else {
}
}
/**
* Returns a new instance of <code>Request</code>.
* The return object is immutable.
*
* @param elem a DOM Element representation of <code>Request</code>
* @return a new instance of <code>Request</code>
* @throws XACMLException if error occurs while processing the
* DOM Element
*
*/
throws XACMLException {
return new RequestImpl(elem);
} else {
}
}
/**
* Returns a new instance of <code>Request</code>
* The return object is immutable.
*
* @param xml a XML string representation of <code>Request</code>
* @return a new instance of <code>Resource</code>
* @throws XACMLException if error occurs while processing the
* XML string
*
*/
throws XACMLException {
return new RequestImpl(xml);
} else {
}
}
/**
* Returns a new instance of <code>Resource</code>.
*
* @return a new instance of <code>Resource</code>
*
*/
public Resource createResource() {
return new ResourceImpl();
} else {
}
}
/**
* Returns a new instance of <code>Resource</code>.
* The return object is immutable.
*
* @param elem a DOM Element representation of <code>Resource</code>
* @return a new instance of <code>Resource</code>
* @throws XACMLException if error occurs while processing the
* DOM Element
*
*/
throws XACMLException {
return new ResourceImpl(elem);
} else {
}
}
/**
* Returns a new instance of <code>Resource</code>
* The return object is immutable.
*
* @param xml a XML string representation of <code>Resource</code>
* @return a new instance of <code>Resource</code>
* @throws XACMLException if error occurs while processing the
* XML string
*
*/
throws XACMLException {
return new ResourceImpl(xml);
} else {
}
}
/**
* Returns a new instance of <code>Subject</code>.
*
* @return a new instance of <code>Subject</code>
*
*/
public Subject createSubject() {
return new SubjectImpl();
} else {
}
}
/**
* Returns a new instance of <code>Subject</code>.
* The return object is immutable.
*
* @param elem a DOM Element representation of <code>Subject</code>
* @return a new instance of <code>Subject</code>
* @throws XACMLException if error occurs while processing the
* DOM Element
*
*/
throws XACMLException {
return new SubjectImpl(elem);
} else {
}
}
/**
* Returns a new instance of <code>Subject</code>.
* The return object is immutable.
*
* @param xml a XML string representation of <code>Subject</code>
* @return a new instance of <code>Subject</code>
* @throws XACMLException if error occurs while processing the
* XML string
*
*/
throws XACMLException {
return new SubjectImpl(xml);
} else {
}
}
/**
* Returns a new instance of <code>Action</code>.
*
* @return a new instance of <code>Action</code>
*
*/
public Action createAction() {
return new ActionImpl();
} else {
}
}
/**
* Returns a new instance of <code>Action</code>.
* The return object is immutable.
*
* @param elem a DOM Element representation of <code>Action</code>
* @return a new instance of <code>Action</code>
* @throws XACMLException if error occurs while processing the
* DOM Element
*
*/
throws XACMLException {
return new ActionImpl(elem);
} else {
}
}
/**
* Returns a new instance of <code>Action</code>.
* The return object is immutable.
*
* @param xml a XML string representation of <code>Action</code>
* @return a new instance of <code>Action</code>
* @throws XACMLException if error occurs while processing the
* XML string
*
*/
throws XACMLException {
return new ActionImpl(xml);
} else {
}
}
/**
* Returns a new instance of <code>Environment</code>.
*
* @return a new instance of <code>Environment</code>
*
*/
public Environment createEnvironment() {
return new EnvironmentImpl();
} else {
return (Environment) obj;
}
}
/**
* Returns a new instance of <code>Environment</code>.
* The return object is immutable.
*
* @param elem a DOM Element representation of <code>Environment</code>
* @return a new instance of <code>Environment</code>
* @throws XACMLException if error occurs while processing the
* DOM Element
*
*/
throws XACMLException {
return new EnvironmentImpl(elem);
} else {
return (Environment) obj;
}
}
/**
* Returns a new instance of <code>Environment</code>.
* The return object is immutable.
*
* @param xml a XML string representation of <code>Environment</code>
* @return a new instance of <code>Environment</code>
* @throws XACMLException if error occurs while processing the
* XML string
*
*/
throws XACMLException {
return new EnvironmentImpl(xml);
} else {
return (Environment) obj;
}
}
/**
* Returns a new instance of <code>Attribute</code>.
* Caller may need to call setters of the class to populate the object.
*
* @return a new instance of <code>Attribute</code>.
*
*/
public Attribute createAttribute() {
return new AttributeImpl();
} else {
}
}
/**
* Returns a new instance of <code>Attribute</code>. The return object
* is immutable.
*
* @param elem an <code>Element</code> representation of
* <code>Attribute</code>.
* @return a new instance of <code>Attribute</code>.
* @throws XACMLException if error occurs while processing the
* <code>Element</code>.
*
*/
throws XACMLException
{
return new AttributeImpl(elem);
} else {
}
}
/**
* Returns a new instance of <code>Attribute</code>. The return object
* is immutable.
*
* @param xml an XML String representing <code>Attribute</code>.
* @return a new instance of <code>Attribute</code>.
* @throws XACMLException if error occurs while processing the XML string.
*
*/
throws XACMLException
{
return new AttributeImpl(xml);
} else {
}
}
/**
* Returns a new instance of <code>XACMLAuthzDecisionQuery</code>.
* Caller may need to call setters of the class to populate the object.
*
* @return a new instance of <code>XACMLAuthzDecisionQuery</code>.
*
*/
return new XACMLAuthzDecisionQueryImpl();
} else {
return (XACMLAuthzDecisionQuery) obj;
}
}
/**
* Returns a new instance of <code>XACMLAuthzDecisionQuery</code>.
* The return object is immutable.
*
* @param elem an <code>Element</code> representation of
* <code>XACMLAuthzDecisionQuery</code>.
* @return a new instance of <code>XACMLAuthzDecisionQuery</code>.
* @throws XACMLException if error occurs while processing the
* <code>Element</code>.
* @throws SAML2Exception if not able to create the base saml
* <code>RequestAbstract</code>
*
*/
throws XACMLException, SAML2Exception
{
return new XACMLAuthzDecisionQueryImpl(elem);
} else {
return (XACMLAuthzDecisionQuery) obj;
}
}
/**
* Returns a new instance of <code>XACMLAuthzDecisionQuery</code>.
* The return object is immutable.
*
* @param xml an XML String representing
* <code>XACMLAuthzDecisionQuery</code>.
* @return a new instance of <code>XACMLAuthzDecisionQuery</code>.
* @throws XACMLException if error occurs while processing the XML string.
* @throws SAML2Exception if not able to create the base saml
* <code>RequestAbstract</code>
*
*/
throws XACMLException, SAML2Exception
{
return new XACMLAuthzDecisionQueryImpl(xml);
} else {
return (XACMLAuthzDecisionQuery) obj;
}
}
/**
* Returns a new instance of <code>XACMLAuthzDecisionStatement</code>.
* Caller may need to call setters of the class to populate the object.
*
* @return a new instance of <code>XACMLAuthzDecisionStatement</code>.
*
*/
return new XACMLAuthzDecisionStatementImpl();
} else {
return (XACMLAuthzDecisionStatement) obj;
}
}
/**
* Returns a new instance of <code>XACMLAuthzDecisionStatement</code>.
* The return object is immutable.
*
* @param elem an <code>Element</code> representation of
* <code>XACMLAuthzDecisionStatement</code>.
* @return a new instance of <code>XACMLAuthzDecisionStatement</code>.
* @throws XACMLException if error occurs while processing the
* <code>Element</code>.
*
*/
return new XACMLAuthzDecisionStatementImpl(elem);
} else {
return (XACMLAuthzDecisionStatement) obj;
}
}
/**
* Returns a new instance of <code>XACMLAuthzDecisionStatement</code>.
* The return object is immutable.
*
* @param xml an XML String representing
* <code>XACMLAuthzDecisionStatement</code>.
* @return a new instance of <code>XACMLAuthzDecisionStatement</code>.
* @throws XACMLException if error occurs while processing the XML string.
*
*/
throws XACMLException {
return new XACMLAuthzDecisionStatementImpl(xml);
} else {
return (XACMLAuthzDecisionStatement) obj;
}
}
/**
* Returns a new instance of <code>Response</code>.
*
* @return a new instance of <code>Response</code>
*
*/
return new ResponseImpl();
} else {
}
}
/**
* Returns a new instance of <code>Response</code>.
* The return object is immutable.
*
* @param elem a DOM Element representation of <code>Response</code>
* @return a new instance of <code>Response</code>
* @throws XACMLException if error occurs while processing the
* DOM Element
*
*/
return new ResponseImpl(elem);
} else {
}
}
/**
* Returns a new instance of <code>Response</code>
* The return object is immutable.
*
* @param xml a XML string representation of <code>Response</code>
* @return a new instance of <code>Response</code>
* @throws XACMLException if error occurs while processing the
* XML string
*
*/
return new ResponseImpl(xml);
} else {
}
}
/**
* Returns a new instance of <code>Result</code>.
*
* @return a new instance of <code>Result</code>
*
*/
return new ResultImpl();
} else {
}
}
/**
* Returns a new instance of <code>Result</code>.
* The return object is immutable.
*
* @param elem a DOM Element representation of <code>Result</code>
* @return a new instance of <code>Result</code>
* @throws XACMLException if error occurs while processing the
* DOM Element
*
*/
return new ResultImpl(elem);
} else {
}
}
/**
* Returns a new instance of <code>Result</code>
* The return object is immutable.
*
* @param xml a XML string representation of <code>Result</code>
* @return a new instance of <code>Result</code>
* @throws XACMLException if error occurs while processing the
* XML string
*
*/
return new ResultImpl(xml);
} else {
}
}
/**
* Returns a new instance of <code>Decision</code>.
*
* @return a new instance of <code>Decision</code>
*
*/
return new DecisionImpl();
} else {
}
}
/**
* Returns a new instance of <code>Decision</code>.
* The return object is immutable.
*
* @param elem a DOM Element representation of <code>Decision</code>
* @return a new instance of <code>Decision</code>
* @throws XACMLException if error occurs while processing the
* DOM Element
*
*/
return new DecisionImpl(elem);
} else {
}
}
/**
* Returns a new instance of <code>Decision</code>
* The return object is immutable.
*
* @param xml a XML string representation of <code>Decision</code>
* @return a new instance of <code>Decision</code>
* @throws XACMLException if error occurs while processing the
* XML string
*
*/
return new DecisionImpl(xml);
} else {
}
}
/**
* Returns a new instance of <code>Status</code>.
*
* @return a new instance of <code>Status</code>
*
*/
return new StatusImpl();
} else {
}
}
/**
* Returns a new instance of <code>Status</code>.
* The return object is immutable.
*
* @param elem a DOM Element representation of <code>Status</code>
* @return a new instance of <code>Status</code>
* @throws XACMLException if error occurs while processing the
* DOM Element
*
*/
return new StatusImpl(elem);
} else {
}
}
/**
* Returns a new instance of <code>Status</code>
* The return object is immutable.
*
* @param xml a XML string representation of <code>Status</code>
* @return a new instance of <code>Status</code>
* @throws XACMLException if error occurs while processing the
* XML string
*
*/
return new StatusImpl(xml);
} else {
}
}
/**
* Returns a new instance of <code>StatusCode</code>.
*
* @return a new instance of <code>StatusCode</code>
*
*/
return new StatusCodeImpl();
} else {
return (StatusCode)object;
}
}
/**
* Returns a new instance of <code>StatusCode</code>.
* The return object is immutable.
*
* @param elem a DOM Element representation of <code>StatusCode</code>
* @return a new instance of <code>StatusCode</code>
* @throws XACMLException if error occurs while processing the
* DOM Element
*
*/
return new StatusCodeImpl(elem);
} else {
return (StatusCode)object;
}
}
/**
* Returns a new instance of <code>StatusCode</code>
* The return object is immutable.
*
* @param xml a XML string representation of <code>StatusCode</code>
* @return a new instance of <code>StatusCode</code>
* @throws XACMLException if error occurs while processing the
* XML string
*
*/
return new StatusCodeImpl(xml);
} else {
return (StatusCode)object;
}
}
/**
* Returns a new instance of <code>StatusMessage</code>.
*
* @return a new instance of <code>StatusMessage</code>
*
*/
return new StatusMessageImpl();
} else {
return (StatusMessage)object;
}
}
/**
* Returns a new instance of <code>StatusMessage</code>.
* The return object is immutable.
*
* @param elem a DOM Element representation of <code>StatusMessage</code>
* @return a new instance of <code>StatusMessage</code>
* @throws XACMLException if error occurs while processing the
* DOM Element
*
*/
throws XACMLException {
return new StatusMessageImpl(elem);
} else {
return (StatusMessage)object;
}
}
/**
* Returns a new instance of <code>StatusMessage</code>
* The return object is immutable.
*
* @param xml a XML string representation of <code>StatusMessage</code>
* @return a new instance of <code>StatusMessage</code>
* @throws XACMLException if error occurs while processing the
* XML string
*
*/
return new StatusMessageImpl(xml);
} else {
return (StatusMessage)object;
}
}
/**
* Returns a new instance of <code>StatusDetail</code>.
*
* @return a new instance of <code>StatusDetail</code>
*
*/
return new StatusDetailImpl();
} else {
return (StatusDetail)object;
}
}
/**
* Returns a new instance of <code>StatusDetail</code>.
* The return object is immutable.
*
* @param elem a DOM Element representation of <code>StatusDetail</code>
* @return a new instance of <code>StatusDetail</code>
* @throws XACMLException if error occurs while processing the
* DOM Element
*
*/
return new StatusDetailImpl(elem);
} else {
return (StatusDetail)object;
}
}
/**
* Returns a new instance of <code>StatusDetail</code>
* The return object is immutable.
*
* @param xml a XML string representation of <code>StatusDetail</code>
* @return a new instance of <code>StatusDetail</code>
* @throws XACMLException if error occurs while processing the
* XML string
*
*/
return new StatusDetailImpl(xml);
} else {
return (StatusDetail)object;
}
}
}