01: /*
02: * <copyright>
03: *
04: * Copyright 1997-2007 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.core.blackboard;
28:
29: import java.io.Serializable;
30: import java.util.Set;
31: import org.cougaar.util.StackElements;
32:
33: /**
34: * A data structure returned by {@link PublisherSubscription}.
35: */
36: public final class PublisherInfo implements Serializable {
37:
38: private final String publisher;
39: private final StackElements add_stack;
40: private final Set change_stacks;
41:
42: public PublisherInfo(String publisher, StackElements add_stack,
43: Set change_stacks) {
44: this .publisher = publisher;
45: this .add_stack = add_stack;
46: this .change_stacks = change_stacks;
47: }
48:
49: /**
50: * @return the plugin that published the object.
51: */
52: public String getPublisher() {
53: return publisher;
54: }
55:
56: /**
57: * @return the stack where the publishAdd occurred.
58: */
59: public StackElements getAddStack() {
60: return add_stack;
61: }
62:
63: /**
64: * @return an ordered set of unique stacks where the object
65: * was publishChanged, or null if it was never changed.
66: */
67: public Set getChangeStacks() {
68: return change_stacks;
69: }
70:
71: public String toString() {
72: return "(publisherInfo " + "\n publisher=" + publisher
73: + "\n add_stack=" + (add_stack != null)
74: + "\n change_stacks="
75: + (change_stacks == null ? 0 : change_stacks.size())
76: + ")";
77: }
78: }
|