es.ants.felixgm.trmsim_wsn.search
Class IsServerSearchCondition

java.lang.Object
  extended by es.ants.felixgm.trmsim_wsn.search.IsServerSearchCondition
All Implemented Interfaces:
ISearchCondition

public class IsServerSearchCondition
extends java.lang.Object
implements ISearchCondition

This class represents a searching condition which is accomplished if a given sensor acts as a server, providing some services

Since:
0.2
Version:
0.3
Author:
Félix Gómez Mármol, Gregorio Martínez Pérez

Field Summary
static int BENEVOLENT_SERVER
          Used in order to find a server offering a specific service benevolently
static int MALICIOUS_SERVER
          Used in order to find a server offering a specific service maliciously
static int RELAY_SERVER
          Used in order to find a server offering only the standard relay service
 
Constructor Summary
IsServerSearchCondition()
          Class IsServerSearchCondition constructor.
IsServerSearchCondition(Service service)
          Class IsServerSearchCondition constructor.
IsServerSearchCondition(Service service, int serverType)
          Class IsServerSearchCondition constructor.
 
Method Summary
 int get_serverType()
          Returns the type of server to be searched (benevolent, malicious or relay)
 boolean sensorAcomplishesCondition(Sensor sensor)
          Indicates if a sensor acts as a server, offering a given service with or without a given goodness
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MALICIOUS_SERVER

public static final int MALICIOUS_SERVER
Used in order to find a server offering a specific service maliciously

See Also:
Constant Field Values

BENEVOLENT_SERVER

public static final int BENEVOLENT_SERVER
Used in order to find a server offering a specific service benevolently

See Also:
Constant Field Values

RELAY_SERVER

public static final int RELAY_SERVER
Used in order to find a server offering only the standard relay service

See Also:
Constant Field Values
Constructor Detail

IsServerSearchCondition

public IsServerSearchCondition()
Class IsServerSearchCondition constructor. Used in order to find just a server regardless its goodness and its offered services


IsServerSearchCondition

public IsServerSearchCondition(Service service)
Class IsServerSearchCondition constructor. Used in order to find just a server regardless its goodness over a specific service

Parameters:
service - Service to be found

IsServerSearchCondition

public IsServerSearchCondition(Service service,
                               int serverType)
Class IsServerSearchCondition constructor. Used in order to find a server offering a specific service with a specific goodness

Parameters:
service - Service to be found
serverType - Type of server to be found (benevolent, malicious, etc.)
Method Detail

sensorAcomplishesCondition

public boolean sensorAcomplishesCondition(Sensor sensor)
Indicates if a sensor acts as a server, offering a given service with or without a given goodness

Specified by:
sensorAcomplishesCondition in interface ISearchCondition
Parameters:
sensor - Sensor to be queried
Returns:
true if the given sensor offers the specific service with or without a specific goodness, false otherwise

get_serverType

public int get_serverType()
Returns the type of server to be searched (benevolent, malicious or relay)

Returns:
The type of server to be searched (benevolent, malicious or relay)