org.mmbase.security
Class MMBaseCop

java.lang.Object
  |
  +--java.lang.SecurityManager
        |
        +--org.mmbase.security.MMBaseCop

public class MMBaseCop
extends java.lang.SecurityManager

This class is the main class of the security system. It loads the authentication and authorization classes if needed, and they can be requested from this manager.

Version:
$Id: MMBaseCop.java,v 1.13 2002/06/25 12:30:44 michiel Exp $
Author:
Eduard Witteveen

Fields inherited from class java.lang.SecurityManager
inCheck
 
Constructor Summary
MMBaseCop(java.lang.String configPath)
          The constructor, will load the classes for authorization and authentication with their config files, as specied in the xml from configUrl
 
Method Summary
 boolean checkSharedSecret(java.lang.String key)
          checks if the received shared secret is equals to your own shared secret
 boolean getActive()
          Returns the authorization class, which should be used(for optimizations)
 Authentication getAuthentication()
          Returns the authentication class, which should be used.
 Authorization getAuthorization()
          Returns the authorization class, which should be used.
 java.lang.String getSharedSecret()
          get the shared Secret
 void reload()
          reload, will load the classes for authorization and authentication with their config files, as specied in the xml from configUrl
 
Methods inherited from class java.lang.SecurityManager
checkAccept, checkAccess, checkAccess, checkAwtEventQueueAccess, checkConnect, 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, classDepth, classLoaderDepth, currentClassLoader, currentLoadedClass, getClassContext, getInCheck, getSecurityContext, getThreadGroup, inClass, inClassLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MMBaseCop

public MMBaseCop(java.lang.String configPath)
          throws java.io.IOException,
                 java.lang.NoSuchMethodException,
                 SecurityException
The constructor, will load the classes for authorization and authentication with their config files, as specied in the xml from configUrl
Parameters:
configPath - Path to the security configuration file (security.xml)
Throws:
java.io.IOException - When reading the file failed
java.lang.NoSuchMethodException - When a tag was not specified
SecurityException - When the class could not be loaded
Method Detail

reload

public void reload()
            throws java.io.IOException,
                   java.lang.NoSuchMethodException,
                   SecurityException
reload, will load the classes for authorization and authentication with their config files, as specied in the xml from configUrl
Throws:
java.io.IOException - When reading the file failed
java.lang.NoSuchMethodException - When a tag was not specified
SecurityException - When the class could not be loaded

getAuthentication

public Authentication getAuthentication()
Returns the authentication class, which should be used.
Returns:
The authentication class which should be used.

getAuthorization

public Authorization getAuthorization()
Returns the authorization class, which should be used.
Returns:
The authorization class which should be used.

getActive

public boolean getActive()
Returns the authorization class, which should be used(for optimizations)
Returns:
trueWhen the SecurityManager should be used. falseWhen not.

checkSharedSecret

public boolean checkSharedSecret(java.lang.String key)
checks if the received shared secret is equals to your own shared secret
Parameters:
receive - shared secret
Returns:
true if received shared secret equals your own shared secret

getSharedSecret

public java.lang.String getSharedSecret()
get the shared Secret
Returns:
the shared Secret


MMBase build 1.6.5.20030923