001: /*
002: * <copyright>
003: *
004: * Copyright 1997-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.logistics.plugin.inventory;
028:
029: import java.util.*;
030:
031: import org.cougaar.core.blackboard.IncrementalSubscription;
032: import org.cougaar.core.agent.service.alarm.Alarm;
033:
034: /**
035: * The ExpanderModule dictates the functionality needed by the
036: * {@link InventoryPlugin}. The Expander should extend the
037: * InventoryModule for convenience and call super(InventoryPlugin).
038: * The constructor of the Expander will take a single argument, a
039: * reference to the plugin.
040: **/
041: public interface ExpanderModule {
042:
043: /**
044: * Expand Supply tasks into Withdraw tasks. The Withdraw tasks are
045: * added to the inventory asset's behavior group.
046: **/
047: void expandAndDistributeRequisitions(Collection tasks);
048:
049: /**
050: * Expand ProjectSupply tasks into ProjectWithdraw tasks. The
051: * ProjectWithdraw tasks are added to the inventory asset's
052: * behavior group.
053: * @return true if new projections were processed
054: **/
055: boolean expandAndDistributeProjections(Collection tasks);
056:
057: /**
058: * Given removed ProjectSupply tasks, remove ProjectWithdraw
059: * child task from the inventory's behavior group.
060: * @return true if removed projections were processed.
061: **/
062: boolean handleRemovedProjections(Collection tasks);
063:
064: /**
065: * Remove Withdraw task from
066: * the inventory's behavior group.
067: **/
068: void handleRemovedRequisitions(Collection tasks);
069:
070: /**
071: * Respond to removed dispostions, e.g, remove related predictions.
072: * @param dispositions
073: */
074: void handleRemovedDispositions(Collection dispositions);
075:
076: /**
077: * Given changed Supply tasks, Withdraw tasks are updated and
078: * changed in the inventory's behavior group.
079: **/
080: void updateChangedRequisitions(Collection tasks);
081:
082: /**
083: * Given changed ProjectSupply tasks, ProjectWithdraw tasks are updated
084: * and changed in the inventory's behavior group.
085: **/
086: void updateChangedProjections(Collection tasks);
087:
088: /**
089: * Given a subscription to the expansions, update the
090: * PlanElements>
091: **/
092: void updateAllocationResult(IncrementalSubscription sub);
093:
094: /**
095: * Check the alarm status during communications loss.
096: */
097: void checkCommStatusAlarms();
098:
099: /**
100: * Determine the state of comms, e.g., is it up/down, did it come back up?
101: * @param commStatusSub
102: * @param tasks
103: */
104: void determineCommStatus(IncrementalSubscription commStatusSub,
105: Collection tasks);
106: }
|