org.apache.naming
Class ContextAccessController

java.lang.Object
  extended byorg.apache.naming.ContextAccessController

public class ContextAccessController
extends java.lang.Object

Handles the access control on JNDI contexts.

Contexts are referenced by their external names, established using ContextBindings.bindContext(Object,Context). Supported operations include:

Making contexts read-only / read-write
setReadOnly(Object), setWritable(Object,Object)
Associating security tokens with named contexts
setSecurityToken(Object,Object), unsetSecurityToken(Object,Object)
Validating security tokens
checkSecurityToken(Object,Object)

Version:
$Revision: 123295 $ $Date: 2003/11/30 05:15:06 $
Author:
Remy Maucherat

Constructor Summary
ContextAccessController()
           
 
Method Summary
static boolean checkSecurityToken(java.lang.Object name, java.lang.Object token)
          Check a submitted security token.
static boolean isWritable(java.lang.Object name)
          Returns if a context is writable.
static void setReadOnly(java.lang.Object name)
          Make the given context read only.
static void setSecurityToken(java.lang.Object name, java.lang.Object token)
          Set a security token for a context.
static void setWritable(java.lang.Object name, java.lang.Object token)
          Remove read-only restriction on the given context.
static void unsetSecurityToken(java.lang.Object name, java.lang.Object token)
          Remove a security token for a context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextAccessController

public ContextAccessController()
Method Detail

setSecurityToken

public static void setSecurityToken(java.lang.Object name,
                                    java.lang.Object token)
Set a security token for a context. Does nothing if the token has already been set or is null.

Parameters:
name - Name of the context
token - Security token

unsetSecurityToken

public static void unsetSecurityToken(java.lang.Object name,
                                      java.lang.Object token)
Remove a security token for a context. Checks the token first and does nothing if there is no token set or the token passed in does not match the token in the repository.

Parameters:
name - Name of the context
token - Security token

checkSecurityToken

public static boolean checkSecurityToken(java.lang.Object name,
                                         java.lang.Object token)
Check a submitted security token. The submitted token must be equal to the token present in the repository. If no token is present for the context, then returns true.

Parameters:
name - name of the context
token - submitted security token
Returns:
true if the check succeeds

setWritable

public static void setWritable(java.lang.Object name,
                               java.lang.Object token)
Remove read-only restriction on the given context. Checks security token first.

Parameters:
name - Name of the context
token - Security token

setReadOnly

public static void setReadOnly(java.lang.Object name)
Make the given context read only.

Parameters:
name - Name of the context

isWritable

public static boolean isWritable(java.lang.Object name)
Returns if a context is writable.

Parameters:
name - Name of the context
Returns:
true if the context is writable


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.