com.hazelcast.security
Interface SecurityContext


public interface SecurityContext

SecurityContext is responsible for managing lifecycle of security object such as ICredentialsFactory, IPermissionPolicy etc, to creating LoginContextes for member and client authentications and checking permissions for client operations.


Method Summary
 void checkPermission(Permission permission)
          Checks whether current Subject has been granted specified permission or not.
 LoginContext createClientLoginContext(Credentials credentials)
          Creates client LoginContext.
 LoginContext createMemberLoginContext(Credentials credentials)
          Creates member LoginContext.
<V>
createSecureCallable(Subject subject, Callable<V> callable)
          Creates secure callable that runs in a sandbox.
 void destroy()
          Destroys SecurityContext and all security elements.
<T> T
doAsPrivileged(Subject subject, PrivilegedExceptionAction<T> action)
          Performs privileged work as a particular Subject.
 ICredentialsFactory getCredentialsFactory()
          Returns current ICredentialsFactory.
 

Method Detail

createMemberLoginContext

LoginContext createMemberLoginContext(Credentials credentials)
                                      throws LoginException
Creates member LoginContext.

Parameters:
credentials - member credentials
Returns:
LoginContext
Throws:
LoginException

createClientLoginContext

LoginContext createClientLoginContext(Credentials credentials)
                                      throws LoginException
Creates client LoginContext.

Parameters:
credentials - client credentials
Returns:
LoginContext
Throws:
LoginException

getCredentialsFactory

ICredentialsFactory getCredentialsFactory()
Returns current ICredentialsFactory.

Returns:
ICredentialsFactory

checkPermission

void checkPermission(Permission permission)
                     throws AccessControlException
Checks whether current Subject has been granted specified permission or not.

Parameters:
permission -
Throws:
AccessControlException

doAsPrivileged

<T> T doAsPrivileged(Subject subject,
                     PrivilegedExceptionAction<T> action)
                 throws Exception,
                        SecurityException
Performs privileged work as a particular Subject.

Parameters:
subject -
action -
Returns:
result returned by the PrivilegedExceptionAction run method.
Throws:
SecurityException
Exception

createSecureCallable

<V>  createSecureCallable(Subject subject,
                               Callable<V> callable)
Creates secure callable that runs in a sandbox.

Type Parameters:
V - return type of callable
Parameters:
subject -
callable -
Returns:
result of callable

destroy

void destroy()
Destroys SecurityContext and all security elements.



Copyright 2008-2012 Hazel Ltd. All Rights Reserved.