cat.sig
Class Sig

java.lang.Object
  extended bycat.sig.Sig

public class Sig
extends java.lang.Object

This class represents a SIG (Special Interest Group). A SIG is a group of CAT users/agents who are sharing sensor data with one another.


Field Summary
private  java.util.Vector agents
          The agents that are part of this sig.
private  int authentication_type
          Authentication used to secure sharing of sensor data.
private  int encryption_type
          Encryption used to secure sharing of sensor data.
private  java.util.Vector sensors
          The sensors being shared in this sig.
private  java.lang.String sig_name
          The sig name.
 
Constructor Summary
Sig(java.lang.String name, java.util.Vector s, java.util.Vector a, int encrypt, int auth)
          This constructor initializes the sig with all the following data.
 
Method Summary
 void addAgent(Agent a)
          This method adds an agent into the sig to share sensor with.
 void addSensor(Sensor s)
          This method adds a sensor to be shared in this sig .
 Agent findAgent(Agent a)
          This method trys to find an agent in the sig.
 java.util.Vector getAgents()
          This method returns the agents in the sig .
 java.util.Vector getAllSensors()
          This method returns all sensors being shared in this sig.
 java.lang.String getName()
          This method returns the name of the sig.
 void removeAgent(Agent a)
          This method removes an agent from the sig.
 void removeSensor(Sensor s)
          This method removes a sensor, so that it is no longer shared by this sig.
 void send(SensorEvent event)
          This method sends out a sensor data event to agents in this sig.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sig_name

private java.lang.String sig_name
The sig name.


sensors

private java.util.Vector sensors
The sensors being shared in this sig.


agents

private java.util.Vector agents
The agents that are part of this sig.


encryption_type

private int encryption_type
Encryption used to secure sharing of sensor data.


authentication_type

private int authentication_type
Authentication used to secure sharing of sensor data.

Constructor Detail

Sig

public Sig(java.lang.String name,
           java.util.Vector s,
           java.util.Vector a,
           int encrypt,
           int auth)
This constructor initializes the sig with all the following data.

Parameters:
name - The sig name.
s - The sensors being shared in this sig.
a - The agents that are part of this sig.
encrypt - Encryption used to secure sharing of sensor data.
auth - Authentication used to secure sharing of sensor data.
Method Detail

findAgent

public Agent findAgent(Agent a)
This method trys to find an agent in the sig.

Returns:
Agent The found agent, or null if not in this sig.

getAgents

public java.util.Vector getAgents()
This method returns the agents in the sig .

Returns:
Vector The agents in the sig.

getName

public java.lang.String getName()
This method returns the name of the sig.

Returns:
String The name of the sig.

addSensor

public void addSensor(Sensor s)
This method adds a sensor to be shared in this sig .

Parameters:
s - The sensor to share.

getAllSensors

public java.util.Vector getAllSensors()
This method returns all sensors being shared in this sig.

Returns:
Vector Sensor being shared.

removeSensor

public void removeSensor(Sensor s)
This method removes a sensor, so that it is no longer shared by this sig.

Parameters:
s - The sensor to stop sharing.

addAgent

public void addAgent(Agent a)
This method adds an agent into the sig to share sensor with.

Parameters:
a - The agent to join the sig.

removeAgent

public void removeAgent(Agent a)
This method removes an agent from the sig.

Parameters:
a - The agent to remove from sig.

send

public void send(SensorEvent event)
This method sends out a sensor data event to agents in this sig. This is how sensor data is shared in SIGs. CAT's transport package is used to send the sensor data to the other agents.

Parameters:
event - The sensor event to send out to agents in sig.