001: /*
002: * <copyright>
003: *
004: * Copyright 2002-2004 BBNT Solutions, LLC
005: * under sponsorship of the Defense Advanced Research Projects
006: * Agency (DARPA).
007: *
008: * You can redistribute this software and/or modify it under the
009: * terms of the Cougaar Open Source License as published on the
010: * Cougaar Open Source Website (www.cougaar.org).
011: *
012: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
013: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
014: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
015: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
016: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
017: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
018: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
019: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
020: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
021: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
022: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
023: *
024: * </copyright>
025: */
026:
027: package org.cougaar.servicediscovery.description;
028:
029: import java.util.Collection;
030:
031: /**
032: * Contains the provider information returned from a registry query.
033: */
034:
035: public class ProviderInfo {
036:
037: String providerName = null;
038: Collection businessClassifications = null;
039: Collection serviceInfos = null;
040:
041: public ProviderInfo() {
042: }
043:
044: /**
045: * Constructs a ProviderInfo object.
046: * @param providerName name of this provider
047: * @param businessClassifications all classifications of this provider
048: * @param serviceInfos all services provided by this Provider
049: */
050: public ProviderInfo(String providerName,
051: Collection businessClassifications, Collection serviceInfos) {
052: this .providerName = providerName;
053: this .businessClassifications = businessClassifications;
054: this .serviceInfos = serviceInfos;
055: }
056:
057: /**
058: * Sets the name of this provider.
059: * @param providerName name of this provider
060: */
061: public void setProviderName(String providerName) {
062: this .providerName = providerName;
063: }
064:
065: /**
066: * Return the name of this provider.
067: * @return String name of this provider
068: */
069: public String getProviderName() {
070: return providerName;
071: }
072:
073: /**
074: * Sets all the classifications of this provider.
075: * @param businessClassifications Collection of BusinessClassifications
076: */
077: public void setBusinessClassifications(
078: Collection businessClassifications) {
079: this .businessClassifications = businessClassifications;
080: }
081:
082: /**
083: * Returns all the BusinessClassifications of this provider.
084: * @return Collection of BusinessClassifications, empty if none exist.
085: */
086: public Collection getBusinessClassifications() {
087: return businessClassifications;
088: }
089:
090: /**
091: * Sets all ServiceInfos of this service.
092: * @param serviceInfos Collection of ServiceInfos
093: */
094: public void setServiceInfos(Collection serviceInfos) {
095: this .serviceInfos = serviceInfos;
096: }
097:
098: /**
099: * Returns all ServiceInfos of this service.
100: * @return Collection of ServiceInfos, empty if none exist.
101: */
102: public Collection getServiceInfos() {
103: return this .serviceInfos;
104: }
105:
106: /**
107: * Compares with other ProviderInfo object.
108: * ProviderInfo objects are considered to be equal if the provider name
109: * are the same. Note: In general provider names are not guaranteed
110: * to be unique and this should be changed.
111: */
112: public boolean equals(Object obj) {
113: if (obj instanceof ProviderInfo) {
114: ProviderInfo other = (ProviderInfo) obj;
115: return this .providerName.equals(other.getProviderName());
116: }
117: return false;
118: }
119: }
|