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.transaction;
028:
029: import java.util.ArrayList;
030: import java.util.Collection;
031:
032: import org.cougaar.servicediscovery.description.BusinessClassification;
033: import org.cougaar.servicediscovery.description.ServiceClassification;
034:
035: /**
036: * Sets the provider and service attributes for this RegistryQuery.
037: */
038: public class RegistryQueryImpl implements RegistryQuery {
039: private String providerName = null;
040: private Collection businessClassifications = null;
041: private String serviceName = null;
042: private Collection serviceClassifications = null;
043: private Collection findQualifiers = null;
044:
045: public RegistryQueryImpl() {
046: }
047:
048: public RegistryQueryImpl(String providerName,
049: Collection businessClassifications, String serviceName,
050: Collection serviceClassifications) {
051: this .providerName = providerName;
052: this .businessClassifications = businessClassifications;
053: this .serviceName = serviceName;
054: this .serviceClassifications = serviceClassifications;
055: }
056:
057: public void setProviderName(String providerName) {
058: this .providerName = providerName;
059: }
060:
061: public String getProviderName() {
062: return providerName;
063: }
064:
065: public void setBusinessClassifications(
066: Collection businessClassifications) {
067: this .businessClassifications = businessClassifications;
068: }
069:
070: public Collection getBusinessClassifications() {
071: return this .businessClassifications;
072: }
073:
074: public void addBusinessClassification(BusinessClassification bc) {
075: if (businessClassifications == null) {
076: businessClassifications = new ArrayList();
077: }
078: businessClassifications.add(bc);
079: }
080:
081: public void setServiceName(String serviceName) {
082: this .serviceName = serviceName;
083: }
084:
085: public String getServiceName() {
086: return serviceName;
087: }
088:
089: public void setServiceClassifications(
090: Collection serviceClassifications) {
091: this .serviceClassifications = serviceClassifications;
092: }
093:
094: public Collection getServiceClassifications() {
095: return this .serviceClassifications;
096: }
097:
098: public void addServiceClassification(ServiceClassification sc) {
099: if (serviceClassifications == null) {
100: serviceClassifications = new ArrayList();
101: }
102: serviceClassifications.add(sc);
103: }
104:
105: public void orLikeKeysQualifier() {
106: if (findQualifiers == null) {
107: findQualifiers = new ArrayList(1);
108: }
109: findQualifiers.add("orLikeKeys");
110: }
111:
112: public Collection getFindQualifiers() {
113: return findQualifiers;
114: }
115: }
|