/**
* 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: Query.java,v 1.2 2008/06/25 05:47:10 qcheng Exp $
*
*/
/**
* The class <code>Query</code> represents a discovery Query object.
* The following schema fragment specifies the expected content within the
* <code>Query</code> object.
* <pre>
* <xs:element name="Query" type="Query"/>
* <complexType name="Query">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <group ref="{urn:liberty:disco:2003-08}ResourceIDGroup"/>
* <element name="RequestedServiceType" maxOccurs="unbounded" minOccurs="0">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{urn:liberty:disco:2003-08}ServiceType"/>
* <element ref="{urn:liberty:disco:2003-08}Options" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
* @supported.all.api
*/
public class Query {
/**
* Constructor.
* @param resourceID resource ID of the discovery resource to be queried.
* @param RequestedService List of <code>RequestService</code> object.
*/
this.resourceID = resourceID;
}
/**
* Constructor.
* @param resourceID encrypted resource ID of the discovery resource
* to be queried.
* @param RequestedService List of <code>RequestService</code> object.
*/
{
}
/**
* Constructor.
* @param root Query in DOM Element
* @exception DiscoveryException if error occurs
*/
throw new DiscoveryException(
}
{
throw new DiscoveryException(
}
// attribute id
// loop to get ResourceID or EncryptedResourceID
// 0 or more RequestedService
if ((nameSpaceURI == null) ||
{
+ "invalid namespace for node " + nodeName);
}
throw new DiscoveryException(
}
+ " more than one ResourceIDGroup element.");
}
throw new DiscoveryException(
}
+ " more than one ResourceIDGroup element.");
}
throw new DiscoveryException(
}
if (requestedService == null) {
requestedService = new ArrayList();
}
} else {
+ " node" + nodeName);
}
throw new DiscoveryException(
}
} // if nodeName != null
} // done for the nl loop
// make sure there is a ResourceID or EncryptedResourceID
+ "or EncryptedResourceID element.");
}
throw new DiscoveryException(
}
}
/**
* Gets id attribute.
*
* @return id attribute.
* @see #setId(String)
*/
return id;
}
/**
* Sets id attribute.
*
* @param id id attribute.
* @see #getId()
*/
}
/**
* Gets the encrypted resource ID of the discovery resource to be queried.
*
* @return the encrypted resource ID of the discovery resource to be
* queried.
* @see #setEncryptedResourceID(EncryptedResourceID)
*/
return encryptResID;
}
/**
* Sets the encrypted resource ID of the discovery resource to be queried.
*
* @param value the encrypted resource ID.
* @see #getEncryptedResourceID()
*/
}
/**
* Gets the resource ID of the discovery resource to be queried.
*
* @return the resource ID of the discovery resource to be queried.
* @see #setResourceID(ResourceID)
*/
return resourceID;
}
/**
* Sets the resource ID of the discovery resource to be queried
*
* @param resourceID the resource ID of the discovery resource to be
* queried.
* @see #getResourceID()
*/
this.resourceID = resourceID;
}
/**
* Gets the list of the requested service types.
*
* @return the list of the requested service types.
* @see #setRequestedServiceType(List)
*/
return requestedService;
}
/**
* Sets the list of the requested service types.
*
* @param requestedService the list of the requested service types to be
* set.
* @see #getRequestedServiceType()
*/
this.requestedService = requestedService;
}
/**
* Returns formatted string of the <code>Query</code> object.
*
* @return formatted string of the <code>Query</code> object.
*/
append("\"");
}
if (resourceID != null) {
} else if (encryptResID != null) {
}
}
}
}
}