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:
27: package org.cougaar.core.service;
28:
29: import org.cougaar.core.adaptivity.OperatingModePolicy;
30: import org.cougaar.core.component.Service;
31:
32: /**
33: * This service allows components to modify {@link
34: * org.cougaar.core.adaptivity.AdaptivityEngine} plays and playbooks.
35: * <p>
36: * This part of the service is used to alter the plays in the playbook
37: * by adding, modifying, or removing OperatingMode Policies.
38: * <p>
39: * <pre>
40: * Play - if THREATCON > 3 && ENCLAVE == THEATER
41: * then ENCRYPT = {56, 128} - the first value is preferred
42: *
43: * Policy - if THREATCON > 3 && CPU > 90
44: * then ENCRYPT >= 128
45: *
46: * Plays formed by calling constrain(Policy)
47: *
48: * if (THREATCON > 3 && ENCLAVE == THEATER)
49: * && (THREATCON >3 && CPU > 90)
50: * then ENCRYPT = {128}
51: *
52: * if (THREATCON > 3 && ENCLAVE == THEATER)
53: * && !(THREATCON >3 && CPU > 90)
54: * then ENCRYPT = {56, 128}
55: * </pre>
56: * This play can constrain this policy because their "then" clauses
57: * are operating on the same knobs.
58: * <p>
59: * Two plays result from constraining the original play with the
60: * policy. The "if" clause of the first new play has the "if" clause
61: * of the policy tacked on to it, and the knob on the "then" clause
62: * must be set to 128. The "if" clause on the second new play has
63: * the -negated- "if" clause of the policy tacked on. The "then"
64: * clause is untouched.
65: */
66: public interface PlaybookConstrainService extends Service {
67:
68: /* constrain and unconstrain called by OperatingModePolicyManager */
69:
70: /**
71: * might replace one play with two in current playbook
72: * @param omp OperatingModePolicy may constrain the play
73: */
74: void constrain(OperatingModePolicy omp);
75:
76: /**
77: * might replace two plays with one in current playbook
78: * @param omp OperatingModePolicy
79: */
80: void unconstrain(OperatingModePolicy omp);
81:
82: }
|