01: /*
02: * <copyright>
03: *
04: * Copyright 2003-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: package org.cougaar.lib.vishnu.client;
27:
28: import java.util.Collection;
29: import java.util.Date;
30: import java.util.Vector;
31:
32: import org.cougaar.util.StringKey;
33: import org.cougaar.planning.ldm.plan.Task;
34: import org.cougaar.planning.ldm.asset.Asset;
35:
36: /**
37: * What the plugin must do to handle scheduler results <p>
38: *
39: * @see ResultHandler
40: **/
41: public interface ResultListener {
42: // task stuff
43: /**
44: * Used to look up Cougaar task when result returned by Vishnu
45: */
46: Task getTaskForKey(StringKey key);
47:
48: /** tells the plugin to remove the task from its list of tasks sent to Vishnu scheduler */
49: void removeTask(StringKey key);
50:
51: // asset stuff
52: /** get the total number of assets */
53: int getNumAssets();
54:
55: /** get the Cougaar asset with UID key <tt>key</tt> */
56: Asset getAssetForKey(StringKey key);
57:
58: /** which assets were changed since they were added as new assets? */
59: Collection getChangedAssets();
60:
61: /**
62: * Called for each Vishnu assignment that needs to be translated into a Cougaar plan element
63: * This is for one-to-one assignments : allocations
64: */
65: void handleAssignment(org.cougaar.planning.ldm.plan.Task task,
66: Asset asset, Date start, Date end, Date setupStart,
67: Date wrapupEnd, String contribs, String taskText);
68:
69: /**
70: * Called for each Vishnu assignment that needs to be translated into a Cougaar plan element
71: * This is for many-to-one assignments : aggregations.
72: */
73: void handleMultiAssignment(Vector tasks, Asset asset, Date start,
74: Date end, Date setupStart, Date wrapupEnd,
75: boolean assetWasUsedBefore);
76:
77: // misc
78: /** get the name of the listener */
79: String getName();
80: }
|