org.jwall.rbl.dns
Class RblSecurityManager

java.lang.Object
  extended by org.jwall.rbl.dns.RblSecurityManager

public class RblSecurityManager
extends Object

This class implements an IP-based permission scheme. Permissions are read from a file in format

 addr = permission
 

Author:
Christian Bockermann <chris@jwall.org>

Field Summary
static String ALL_PERMISSION
          The string value representing all permissions
static String BLOCK_PERMISSION
          The string value of permission 'block'
static String[] PERMISSIONS
          This is the list of all available (assignable) permissions
static String UNBLOCK_PERMISSION
          The string value of permission 'unblock'
 
Method Summary
static RblSecurityManager getInstance()
          This method returns the global RblSecurityManager instance.
 boolean hasPermission(InetAddress addr, String perm)
           Checks whether the given address addr has the specified permission.
 void readPermissions(File file)
           
 void readPermissions(InputStream inputStream)
          Parse the given file and store all permissions in the global hash.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLOCK_PERMISSION

public static final String BLOCK_PERMISSION
The string value of permission 'block'

See Also:
Constant Field Values

UNBLOCK_PERMISSION

public static final String UNBLOCK_PERMISSION
The string value of permission 'unblock'

See Also:
Constant Field Values

ALL_PERMISSION

public static final String ALL_PERMISSION
The string value representing all permissions

See Also:
Constant Field Values

PERMISSIONS

public static final String[] PERMISSIONS
This is the list of all available (assignable) permissions

Method Detail

getInstance

public static RblSecurityManager getInstance()
This method returns the global RblSecurityManager instance.

Returns:
The global RblSecurityManager.

readPermissions

public void readPermissions(File file)
                     throws Exception
Throws:
Exception

readPermissions

public void readPermissions(InputStream inputStream)
                     throws Exception
Parse the given file and store all permissions in the global hash.

Parameters:
file -
Throws:
Exception

hasPermission

public boolean hasPermission(InetAddress addr,
                             String perm)

Checks whether the given address addr has the specified permission.

Parameters:
addr - The address to check.
perm - The permission which is queried for this address.
Returns:


Copyright © 2014. All Rights Reserved.