01: /*
02: * <copyright>
03: *
04: * Copyright 2002-2004 BBNT Solutions, LLC
05: * under sponsorship of the Defense Advanced Research Projects
06: * Agency (DARPA).
07: *
08: * You can redistribute this software and/or modify it under the
09: * terms of the Cougaar Open Source License as published on the
10: * Cougaar Open Source Website (www.cougaar.org).
11: *
12: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
13: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
14: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
15: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
16: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
17: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
18: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23: *
24: * </copyright>
25: */
26:
27: package org.cougaar.servicediscovery.transaction;
28:
29: import java.util.Collection;
30:
31: import org.cougaar.core.util.UID;
32: import org.cougaar.servicediscovery.description.MMQuery;
33: import org.cougaar.util.log.Logger;
34: import org.cougaar.util.log.Logging;
35:
36: public class MMQueryRequestImpl implements NewMMQueryRequest,
37: java.io.Serializable {
38: private static Logger myLogger = Logging
39: .getLogger(MMQueryRequestImpl.class);
40:
41: private MMQuery myQuery = null;
42: private UID myUID = null;
43: private Collection myResult = null;
44: private int myResultCode = 0;
45: private int myQueryCount = 0;
46:
47: public MMQueryRequestImpl(MMQuery mmQuery) {
48: myQuery = mmQuery;
49: }
50:
51: public MMQueryRequestImpl() {
52: super ();
53: }
54:
55: public void setQuery(MMQuery mmQuery) {
56: myQuery = mmQuery;
57: }
58:
59: public MMQuery getQuery() {
60: return myQuery;
61: }
62:
63: public void setQueryCount(int queryCount) {
64: myQueryCount = queryCount;
65: }
66:
67: public int getQueryCount() {
68: return myQueryCount;
69: }
70:
71: public void setResult(Collection result) {
72: myResult = result;
73: }
74:
75: public Collection getResult() {
76: return myResult;
77: }
78:
79: public void setResultCode(int code) {
80: myResultCode = code;
81: }
82:
83: public int getResultCode() {
84: return myResultCode;
85: }
86:
87: public void setUID(UID newUID) {
88: if (myUID != null) {
89: myLogger.error("Attempt to reset UID.");
90: return;
91: }
92:
93: myUID = newUID;
94: }
95:
96: public UID getUID() {
97: return myUID;
98: }
99: }
|