org.altlinux.jabbix
Class JabbixSecurityManager

java.lang.Object
  extended by java.lang.SecurityManager
      extended by org.altlinux.jabbix.JabbixSecurityManager

public class JabbixSecurityManager
extends SecurityManager

A SecurityManager implementation used to manage access to and from a Jabbix program. To set the connection permissions the two separate sets of predicates are used.

Author:
Paul Wolneykien

Constructor Summary
JabbixSecurityManager()
          Creates an instance of the manager.
 
Method Summary
 void checkAccept(String host, int port)
          Check the permission to accept a connection from the specified host and port using the set of predicates.
 void checkConnect(String host, int port)
          Check the permission to connect to the specified host and port using the set of predicates.
 Collection<ConnectionPredicate> getConnectionPredicates()
          Returns a set of connection predicates defining the permission to connect to remote hosts.
 Collection<ConnectionPredicate> getListenPredicates()
          Returns a set of connection predicates defining the permission to accept connections from remote hosts.
 void setConnectionPredicates(Collection<ConnectionPredicate> connPreds)
          Sets a set of connection predicates defining the permission to connect to remote hosts.
 void setListenPredicates(Collection<ConnectionPredicate> listenPreds)
          Sets a set of connection predicates defining the permission to accept connections from remote hosts.
 
Methods inherited from class java.lang.SecurityManager
checkAccess, checkAccess, checkAwtEventQueueAccess, checkConnect, checkCreateClassLoader, checkDelete, checkExec, checkExit, checkLink, checkListen, checkMemberAccess, checkMulticast, checkMulticast, checkPackageAccess, checkPackageDefinition, checkPermission, checkPermission, checkPrintJobAccess, checkPropertiesAccess, checkPropertyAccess, checkRead, checkRead, checkRead, checkSecurityAccess, checkSetFactory, checkSystemClipboardAccess, checkTopLevelWindow, checkWrite, checkWrite, getInCheck, getSecurityContext, getThreadGroup
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JabbixSecurityManager

public JabbixSecurityManager()
Creates an instance of the manager.

Method Detail

checkAccept

public void checkAccept(String host,
                        int port)
Check the permission to accept a connection from the specified host and port using the set of predicates. By default (the corresponding predicate set is empty), connections from all hosts are permitted. Otherwise only connections satisfying at least one of the specified predicates are allowed.

Overrides:
checkAccept in class SecurityManager

checkConnect

public void checkConnect(String host,
                         int port)
Check the permission to connect to the specified host and port using the set of predicates. By default (the corresponding predicate set is empty), connections to all hosts are permitted. Otherwise only connections satisfying at least one of the specified predicates are allowed.

Overrides:
checkConnect in class SecurityManager

getConnectionPredicates

public Collection<ConnectionPredicate> getConnectionPredicates()
Returns a set of connection predicates defining the permission to connect to remote hosts.

Returns:
a set of predicates to test outcoming connections on

setConnectionPredicates

public void setConnectionPredicates(Collection<ConnectionPredicate> connPreds)
Sets a set of connection predicates defining the permission to connect to remote hosts.

Parameters:
connPreds - a set of predicates to test outcoming connections on

setListenPredicates

public void setListenPredicates(Collection<ConnectionPredicate> listenPreds)
Sets a set of connection predicates defining the permission to accept connections from remote hosts.

Parameters:
listenPreds - a set of predicates to test incoming connections on

getListenPredicates

public Collection<ConnectionPredicate> getListenPredicates()
Returns a set of connection predicates defining the permission to accept connections from remote hosts.

Returns:
a set of predicates to test incoming connections on