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.core.blackboard;
028:
029: import java.io.Serializable;
030: import org.cougaar.core.mts.MessageAddress;
031:
032: /**
033: * A generic blackboard alert object used to notify agent or plugin
034: * about anomalous data on an agent's blackboard.
035: */
036: public class BlackboardAlert implements Serializable {
037:
038: private String sensorName, description;
039: private long compromisedTimeStamp = 0;
040: private MessageAddress victimAgent;
041: private MessageAddress attackerAgent = null;
042:
043: /**
044: * Basic Constructor
045: * @param sensor sensor type, descriptive name or component name
046: * @param time time of compromise if known - usually specified in terms of society time
047: * @param victim the compromised agent address
048: * @param attacker the attacking agent if known
049: * @param desc description of problem, attack, classification or other information
050: */
051: public BlackboardAlert(String sensor, long time,
052: MessageAddress victim, MessageAddress attacker, String desc) {
053: sensorName = sensor;
054: compromisedTimeStamp = time;
055: if (victim == null) {
056: throw new IllegalArgumentException(
057: "Victim address must be non-null");
058: }
059: victimAgent = victim;
060: attackerAgent = attacker;
061: this .description = description;
062: }
063:
064: /**
065: * Minimal Constructor
066: * @param sensor sensor type, descriptive name or component name
067: * @param victim the compromised agent address
068: */
069: public BlackboardAlert(String sensor, MessageAddress victim) {
070: sensorName = sensor;
071: if (victim == null) {
072: throw new IllegalArgumentException(
073: "Victim address must be non-null");
074: }
075: victimAgent = victim;
076: }
077:
078: public String getSensorName() {
079: return sensorName;
080: }
081:
082: public long getTimeOfCompromise() {
083: return compromisedTimeStamp;
084: }
085:
086: public void setTimeOfCompromise(long time) {
087: compromisedTimeStamp = time;
088: }
089:
090: public MessageAddress getVictimAgent() {
091: return victimAgent;
092: }
093:
094: public MessageAddress getAttackerAgent() {
095: return attackerAgent;
096: }
097:
098: public void setAttackerAgent(MessageAddress attacker) {
099: attackerAgent = attacker;
100: }
101:
102: public String getDescription() {
103: return description;
104: }
105:
106: public void setDescription(String desc) {
107: description = desc;
108: }
109:
110: }
|