/**
* 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: ServiceInstance.java,v 1.2 2008/06/25 05:47:11 qcheng Exp $
*
*/
/**
* The class <code>ServiceInstance</code> describes a web service at a
* distinct protocol endpoint.
* <p>The following schema fragment specifies the expected content
* within the <code>ServiceInstance</code> object.
* <p>
* <pre>
* <xs:element name="ServiceInstance" type="ServiceInstanceType"/>
* <complexType name="ServiceInstanceType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element ref="{urn:liberty:disco:2003-08}ServiceType"/>
* <element name="ProviderID" type="{urn:liberty:metadata:2003-08}entityIDType"/>
* <element name="Description" type="{urn:liberty:disco:2003-08}DescriptionType" maxOccurs="unbounded"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
* @supported.all.api
*/
public class ServiceInstance {
/**
* Default Constructor.
*/
public ServiceInstance (){}
/**
* Constructor
* @param serviceType service type
* @param providerID provider ID
* @param descriptions List of Description objects
*/
{
this.serviceType = serviceType;
this.providerID = providerID;
this.descriptions = descriptions;
}
/**
* Constructor.
* @param elem <code>ServiceInstance</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(
}
if (providerID != null) {
+ ": Included more than one ProviderID.");
}
throw new DiscoveryException(
}
+ ": missing ProviderID element value.");
}
throw new DiscoveryException(
}
if (descriptions == null) {
descriptions = new ArrayList();
}
} else {
+ "invalid node" + nodeName);
}
throw new DiscoveryException(
}
}
}
if (serviceType == null) {
+ "ServiceInstance element.");
}
throw new DiscoveryException(
}
if (providerID == null) {
+ "ProviderID element.");
}
throw new DiscoveryException(
}
+ "Description element.");
}
throw new DiscoveryException(
}
}
/**
* Gets provider ID of the service instance.
*
* @return provider ID of the service instance.
* @see #setProviderID(String)
*/
return providerID;
}
/**
* Sets provider ID.
*
* @param value provider ID.
* @see #getProviderID()
*/
providerID = value;
}
/**
* Gets the service descriptions.
*
* @return List of Description objects
* @see #setDescription(List)
*/
return descriptions;
}
/**
* Sets the service descriptions.
*
* @param desc List of Description objects.
* @see #getDescription()
*/
descriptions = desc;
}
/**
* Gets service type.
*
* @return service type.
* @see #setServiceType(String)
*/
return serviceType;
}
/**
* Sets service type.
*
* @param value service type.
* @see #getServiceType()
*/
serviceType = value;
}
/**
* Returns string format of object <code>ServiceInstance</code>.
*
* @return formatted string.
*/
append("</ServiceType><ProviderID>").
if (descriptions != null) {
}
}
}
}