madkit.netcomm.rules
Class Rule

java.lang.Object
  extended by madkit.netcomm.rules.Rule

public final class Rule
extends java.lang.Object

Version:
$Revision: 1.2 $
Author:
Sebastian Rodriguez - sebastian.rodriguez@utbm.fr

Field Summary
static int ACCEPT
          Accept the connection
static java.lang.String DOT
          Unicode dot.
static int REFUSE
          Refuse the connection.
static int REJECT
          Reject the connection.
 
Constructor Summary
Rule(java.lang.String regexp, int action, java.lang.Object arg)
           
 
Method Summary
 boolean contains(java.lang.String protocol)
          Checks if the Protocol protocol is present in this rule.
 int getAction()
          Gets the associated action to the hosts matching this rule.
 java.lang.Object getArgument()
          Returns the Argument.
 Protocollnformation getProtocolInformation()
          Gets the protocol information of this rule, or creates a new one containning the refuse reason
 boolean matches(java.lang.String host)
          Checks if the host host matches this rule
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ACCEPT

public static final int ACCEPT
Accept the connection

See Also:
Constant Field Values

REJECT

public static final int REJECT
Reject the connection. No reason for the rejection is sent

See Also:
Constant Field Values

REFUSE

public static final int REFUSE
Refuse the connection. A reason must be given.

See Also:
Constant Field Values

DOT

public static final java.lang.String DOT
Unicode dot. Provided only as utility.

See Also:
Constant Field Values
Constructor Detail

Rule

public Rule(java.lang.String regexp,
            int action,
            java.lang.Object arg)
Method Detail

getAction

public int getAction()
Gets the associated action to the hosts matching this rule.

Returns:
Returns the action.

matches

public boolean matches(java.lang.String host)
Checks if the host host matches this rule

Parameters:
host - host to check
Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

contains

public boolean contains(java.lang.String protocol)
Checks if the Protocol protocol is present in this rule.

Parameters:
protocol -
Returns:

getProtocolInformation

public Protocollnformation getProtocolInformation()
Gets the protocol information of this rule, or creates a new one containning the refuse reason

Returns:

getArgument

public java.lang.Object getArgument()
Returns the Argument.

Returns:


Copyright © Madkit Team (O. Gutknecht, J. Ferber, F. Michel et al.) All Rights Reserved.