/**
* 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: ResourceOffering.java,v 1.2 2008/06/25 05:47:11 qcheng Exp $
*
*/
/**
* The class <code>ResourceOffering</code> associates a resource with a service
* instance that provides access to that resource.
* <p>The following schema fragment specifies the expected content within the
* <code>ResourceOffering</code> object.
* <p>
* <pre>
* <complexType name="ResourceOfferingType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <group ref="{urn:liberty:disco:2003-08}ResourceIDGroup"/>
* <element name="ServiceInstance" type="{urn:liberty:disco:2003-08}ServiceInstanceType"/>
* <element ref="{urn:liberty:disco:2003-08}Options" minOccurs="0"/>
* <element name="Abstract" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* <attribute name="entryID" type="{urn:liberty:disco:2003-08}IDType" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
* An example of the <code>ResourceOffering</code> is :
* <pre>
* <ResourceOffering xmlns="urn:liberty:disco:2003-08">
* <ResourceID>http://profile-provider.com/profiles/l4m0B82k15csaUxs</ResourceID>
* <ServiceInstance xmlns="urn:liberty:disco:2003-08">
* <ServiceType>urn:liberty:idpp:2003-08</ServiceType>
* <ProviderID>http://profile-provider.com/</ProviderID>
* <Description>
* <SecurityMechID>urn:liberty:disco:2003-08:anonymous</SecurityMechID>
* <SecurityMechID>urn:liberty:security:2003-08:x509</SecurityMechID>
* <SecurityMechID>urn:liberty:security:2003-08:saml</SecurityMechID>
* <Endpoint>https://soap.profile-provider.com/soap/</Endpoint>
* </Description>
* <Description>
* <SecurityMechID>urn:ietf:rfc:2246</SecurityMechID>
* <Endpoint>https://soap-auth.profile-provider.com/soap/</Endpoint>
* </Description>
* </ServiceInstance>
* <Options>
* <Option>urn:liberty:idpp</Option>
* <Option>urn:liberty:idpp:cn</Option>
* <Option>urn:liberty:idpp:can</Option>
* <Option>urn:liberty:idpp:can:cn</Option>
* </Options>
* <Abstract>
* This is a personal profile containing common name information.
* </Abstract>
* </ResourceOffering>
* </pre>
*
* @supported.all.api
*/
public class ResourceOffering {
/**
* Constructor.
* @param resourceID ID for the resource.
* @param serviceInstance service instance.
*/
{
this.resourceID = resourceID;
this.serviceInstance = serviceInstance;
}
/**
* Constructor.
*
* @param resourceID Encrypted Resource ID.
* @param serviceInstance service instance.
*/
{
this.serviceInstance = serviceInstance;
}
/**
* Constructor.
* @param elem <code>ResourceOffering</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(
}
+ ": Included more than one ResourceIDGroup "
+ "element.");
}
throw new DiscoveryException(
}
try {
} catch (DiscoveryException de) {
}
+ ": Included more than one ResourceIDGroup "
+ "element.");
}
throw new DiscoveryException(
}
if (serviceInstance != null) {
+ ": Included more than one ServiceInstance.");
}
throw new DiscoveryException(
}
+ ": Included more than one Options.");
}
throw new DiscoveryException(
}
+ ": Included more than one Abstract.");
}
throw new DiscoveryException(
}
} else {
+ "invalid node" + nodeName);
}
throw new DiscoveryException(
}
}
}
/*
if ((resourceID == null) && (encryptResID == null)) {
if (DiscoUtils.debug.messageEnabled()) {
DiscoUtils.debug.message("ResourceOffering(Element): missing "
+ "ResourceID or EncryptedResourceID element.");
}
throw new DiscoveryException(
DiscoUtils.bundle.getString("missingResourceIDGroup"));
}
if (serviceInstance == null) {
if (DiscoUtils.debug.messageEnabled()) {
DiscoUtils.debug.message("ResourceOffering(Element): missing "
+ "ServiceInstance element.");
}
throw new DiscoveryException(
DiscoUtils.bundle.getString("missingServiceInstance"));
}
*/
}
/**
* Gets options of the resource offering, which expresses the options
* available for the resource offering, that is provides hints to a
* potential requester whether certain data or operations may be available
* with a particular resource offering.
*
* @return List of options as String
* @see #setOptions(List)
*/
return options;
}
/**
* Sets options.
* @param options List of options as String
* @see #getOptions()
*/
}
/**
* Gets encrypted resource ID.
*
* @return encrypted resource ID.
* @see #setEncryptedResourceID(EncryptedResourceID)
*/
return encryptResID;
}
/**
* Sets encrypted resource ID.
*
* @param resourceID <code>EncryptedResourceID</code> to be set
* @see #getEncryptedResourceID()
*/
}
/**
* Gets resource ID.
* @return resource ID.
* @see #setResourceID(ResourceID)
*/
return resourceID;
}
/**
* Sets resource ID.
*
* @param resourceID resource ID.
* @see #getResourceID()
*/
this.resourceID = resourceID;
}
/**
* Gets entry ID.
*
* @return entry ID.
* @see #setEntryID(String)
*/
return entryID;
}
/**
* Sets entry ID.
* @param value of the id
* @see #getEntryID()
*/
}
/**
* Gets service instance.
*
* @return service instance.
* @see #setServiceInstance(ServiceInstance)
*/
return serviceInstance;
}
/**
* Sets service instance.
*
* @param value service instance.
* @see #getServiceInstance()
*/
}
/**
* Gets abstract of the resource offering
*
* @return abstract of the resource offering.
* @see #setAbstract(String)
*/
return abs;
}
/**
* Sets abstract.
*
* @param value abstract of the resource offering.
* @see #getAbstract()
*/
}
/**
* Returns string representation of object <code>ResourceOffering</code>.
*
* @return string representation
*/
// entryID, resIDgroup, service instance, options, Abstract
append("\"");
}
if (resourceID != null) {
} else if (encryptResID != null) {
}
if (serviceInstance != null) {
}
append("</Option>");
}
}
}
}
}
}
}