Package org.altlinux.jabbix
Class JabbixSecurityManager
- java.lang.Object
-
- java.lang.SecurityManager
-
- org.altlinux.jabbix.JabbixSecurityManager
-
public class JabbixSecurityManager extends java.lang.SecurityManager
ASecurityManager
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
Constructors Constructor Description JabbixSecurityManager()
Creates an instance of the manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkAccept(java.lang.String host, int port)
Check the permission to accept a connection from the specified host and port using the set of predicates.void
checkConnect(java.lang.String host, int port)
Check the permission to connect to the specified host and port using the set of predicates.java.util.Collection<ConnectionPredicate>
getConnectionPredicates()
Returns a set of connection predicates defining the permission to connect to remote hosts.java.util.Collection<ConnectionPredicate>
getListenPredicates()
Returns a set of connection predicates defining the permission to accept connections from remote hosts.void
setConnectionPredicates(java.util.Collection<ConnectionPredicate> connPreds)
Sets a set of connection predicates defining the permission to connect to remote hosts.void
setListenPredicates(java.util.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, checkConnect, checkCreateClassLoader, checkDelete, checkExec, checkExit, checkLink, checkListen, checkMulticast, checkMulticast, checkPackageAccess, checkPackageDefinition, checkPermission, checkPermission, checkPrintJobAccess, checkPropertiesAccess, checkPropertyAccess, checkRead, checkRead, checkRead, checkSecurityAccess, checkSetFactory, checkWrite, checkWrite, getSecurityContext, getThreadGroup
-
-
-
-
Method Detail
-
checkAccept
public void checkAccept(java.lang.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 classjava.lang.SecurityManager
-
checkConnect
public void checkConnect(java.lang.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 classjava.lang.SecurityManager
-
getConnectionPredicates
public java.util.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(java.util.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(java.util.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 java.util.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
-
-