org.objectweb.cjdbc.controller.core.security
Class ControllerSecurityManager

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.core.security.ControllerSecurityManager
All Implemented Interfaces:
XmlComponent

public class ControllerSecurityManager
extends java.lang.Object
implements XmlComponent

Call this to check if security is enforced ....

Version:
1.0
Author:
Nicolas Modrzyk

Field Summary
private  java.util.ArrayList accept
           
private  boolean allowAdditionalDriver
           
private  boolean allowClientShutdown
           
private  boolean allowConsoleShutdown
           
private  boolean allowLocalClientOnly
           
private  boolean allowLocalConsoleOnly
           
private  java.util.ArrayList block
           
private  boolean defaultConnect
           
private  java.util.ArrayList saccept
           
private  java.util.ArrayList sblock
           
private  SSLConfiguration sslConfig
           
 
Fields inherited from interface org.objectweb.cjdbc.common.xml.XmlComponent
DOCTYPE_CONTROLLER, DOCTYPE_DB, XML_VERSION
 
Constructor Summary
ControllerSecurityManager()
          Create a new security manager
 
Method Summary
 void addHostToSecureList(java.lang.String host, boolean baccept)
          Add this host name or ipaddress to the secure list
 void addToSecureList(org.apache.regexp.RE range, boolean baccept)
          Add an ip range to the secure list
 void addToSecureList(java.lang.String range, boolean baccept)
          Add an ip range to the secure list.
 boolean allowConnection(java.net.Socket clientSocket)
          Check connection policy for a client socket
private static boolean checkList(java.util.ArrayList list, java.net.Socket clientSocket)
           
 java.util.ArrayList getAccept()
           
 boolean getAllowAdditionalDriver()
           
 boolean getAllowClientShutdown()
           
 boolean getAllowConsoleShutdown()
           
 boolean getAllowLocalClientOnly()
           
 boolean getAllowLocalConsoleOnly()
           
 java.util.ArrayList getBlock()
           
 boolean getDefaultConnect()
           
 java.util.ArrayList getSaccept()
           
 java.util.ArrayList getSblock()
           
 SSLConfiguration getSslConfig()
          Returns the sslConfig value.
 java.lang.String getXml()
          Get xml formatted representation of this cjdbc component
 boolean isSSLEnabled()
          is ssl enabled for this controller
 void setAllowAdditionalDriver(boolean allowAdditionalDriver)
           
 void setAllowClientShutdown(boolean allowClientShutdown)
           
 void setAllowConsoleShutdown(boolean allowConsoleShutdown)
           
 void setAllowLocalClientOnly(boolean allowLocalClientOnly)
           
 void setAllowLocalConsoleOnly(boolean allowLocalConsoleOnly)
           
 void setBlock(java.util.ArrayList block)
           
 void setDefaultConnect(boolean defaultConnect)
           
 void setSslConfig(SSLConfiguration sslConfig)
          Sets the sslConfig value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

allowAdditionalDriver

private boolean allowAdditionalDriver

allowConsoleShutdown

private boolean allowConsoleShutdown

allowLocalConsoleOnly

private boolean allowLocalConsoleOnly

allowClientShutdown

private boolean allowClientShutdown

allowLocalClientOnly

private boolean allowLocalClientOnly

defaultConnect

private boolean defaultConnect

accept

private java.util.ArrayList accept

saccept

private java.util.ArrayList saccept

block

private java.util.ArrayList block

sblock

private java.util.ArrayList sblock

sslConfig

private SSLConfiguration sslConfig
Constructor Detail

ControllerSecurityManager

public ControllerSecurityManager()
Create a new security manager

Method Detail

allowConnection

public boolean allowConnection(java.net.Socket clientSocket)
Check connection policy for a client socket

Parameters:
clientSocket - that is trying to connect
Returns:
true if connection is allowed, false otherwise

addToSecureList

public void addToSecureList(org.apache.regexp.RE range,
                            boolean baccept)
Add an ip range to the secure list

Parameters:
range - to accept like 192.167.1.*
baccept - true if accept false if block

addToSecureList

public void addToSecureList(java.lang.String range,
                            boolean baccept)
                     throws java.lang.Exception
Add an ip range to the secure list. Same as above, but we want to store the original string pattern as well.

Parameters:
range - to accept
baccept - true if accept false if block
Throws:
java.lang.Exception - if the pattern is not valid

addHostToSecureList

public void addHostToSecureList(java.lang.String host,
                                boolean baccept)
Add this host name or ipaddress to the secure list

Parameters:
host - name or ipaddress
baccept - true if accept false if block

checkList

private static boolean checkList(java.util.ArrayList list,
                                 java.net.Socket clientSocket)

getAllowAdditionalDriver

public boolean getAllowAdditionalDriver()
Returns:
Returns the allowAdditionalDriver.

setAllowAdditionalDriver

public void setAllowAdditionalDriver(boolean allowAdditionalDriver)
Parameters:
allowAdditionalDriver - The allowAdditionalDriver to set.

getAllowClientShutdown

public boolean getAllowClientShutdown()
Returns:
Returns the allowClientShutdown.

setAllowClientShutdown

public void setAllowClientShutdown(boolean allowClientShutdown)
Parameters:
allowClientShutdown - The allowClientShutdown to set.

getAllowConsoleShutdown

public boolean getAllowConsoleShutdown()
Returns:
Returns the allowConsoleShutdown.

setAllowConsoleShutdown

public void setAllowConsoleShutdown(boolean allowConsoleShutdown)
Parameters:
allowConsoleShutdown - The allowConsoleShutdown to set.

getAllowLocalClientOnly

public boolean getAllowLocalClientOnly()
Returns:
Returns the allowLocalClientOnly.

setAllowLocalClientOnly

public void setAllowLocalClientOnly(boolean allowLocalClientOnly)
Parameters:
allowLocalClientOnly - The allowLocalClientOnly to set.

getAllowLocalConsoleOnly

public boolean getAllowLocalConsoleOnly()
Returns:
Returns the allowLocalConsoleOnly.

setAllowLocalConsoleOnly

public void setAllowLocalConsoleOnly(boolean allowLocalConsoleOnly)
Parameters:
allowLocalConsoleOnly - The allowLocalConsoleOnly to set.

getDefaultConnect

public boolean getDefaultConnect()
Returns:
Returns the defaultConnect.

setDefaultConnect

public void setDefaultConnect(boolean defaultConnect)
Parameters:
defaultConnect - The defaultConnect to set.

getSaccept

public java.util.ArrayList getSaccept()
Returns:
Returns the saccept.

getSblock

public java.util.ArrayList getSblock()
Returns:
Returns the sblock.

getAccept

public java.util.ArrayList getAccept()
Returns:
Returns the accept.

getBlock

public java.util.ArrayList getBlock()
Returns:
Returns the block.

setBlock

public void setBlock(java.util.ArrayList block)
Parameters:
block - The block to set.

getXml

public java.lang.String getXml()
Description copied from interface: XmlComponent
Get xml formatted representation of this cjdbc component

Specified by:
getXml in interface XmlComponent
Returns:
xml formatted fragment
See Also:
XmlComponent.getXml()

isSSLEnabled

public boolean isSSLEnabled()
is ssl enabled for this controller

Returns:
Returns wether ssl is enabled or not

getSslConfig

public SSLConfiguration getSslConfig()
Returns the sslConfig value.

Returns:
Returns the sslConfig.

setSslConfig

public void setSslConfig(SSLConfiguration sslConfig)
Sets the sslConfig value.

Parameters:
sslConfig - The sslConfig to set.


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.