/**
* 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: RequestedService.java,v 1.2 2008/06/25 05:47:11 qcheng Exp $
*
*/
/**
* The class <code>RequestedService</code> enables the requester to specify
* that all the resource offerings returned must be offered via a service
* instance complying with one of the specified service type.
* <p>The following schema fragment specifies the expected content
* within the <code>RequestedService</code> object.
* <p>
* <pre>
* <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>
* </pre>
* <p>
* <pre>
* In this implementation, the value of Options has the following meanings:
* When the List of options is null, no Options element will be created;
* When the List of options is an empty List, or is Collection.EMPTY_LIST,
* empty Options element <Options></Options> will be created;
* When the List of options is not empty,
* Options element with child Option element(s) will be created.
* </pre>
* @supported.all.api
*/
public class RequestedService {
/**
* Constructor.
* @param options List of String, each is a URI specifying an option the
* returned resource offering should support.
* @param serviceType URI specifying the type of service to be returned
*/
{
this.serviceType = serviceType;
}
/**
* Constructor.
* @param elem <code>RequestedService</code> DOM element
* @exception DiscoveryException if error occurs
*/
throw new DiscoveryException(
}
{
throw new DiscoveryException(
}
if ((nameSpaceURI == null) ||
{
+ "invalid namespace for node " + nodeName);
}
throw new DiscoveryException(
}
if (serviceType != null) {
+ ": Included more than one ServiceType "
+ "element.");
}
throw new DiscoveryException(
}
+ ": missing ServiceType element value.");
}
throw new DiscoveryException(
}
+ ": Included more than one Options element.");
}
throw new DiscoveryException(
}
} else {
+ "invalid node" + nodeName);
}
throw new DiscoveryException(
}
}
}
if (serviceType == null) {
+ "ServiceType element.");
}
throw new DiscoveryException(
}
}
/**
* Gets list of options.
* @return List of options
* @see #setOptions(List)
*/
return options;
}
/**
* Sets options.
* @param options List of option to be set
* @see #getOptions()
*/
}
/**
* Gets service type.
* @return service type String
* @see #setServiceType(String)
*/
return serviceType;
}
/**
* Sets service type.
* @param serviceType String
* @see #getServiceType()
*/
this.serviceType = serviceType;
}
/**
* Returns string format of object <code>RequestedServiceType</code>.
*
* @return formatted string.
*/
if (serviceType != null) {
}
append("</Option>");
}
}
}
}
}
}