Nitido Inc.

com.nitido.nimx.services.authentication.sim
Class AuthenticationServiceImpl

java.lang.Object
  extended by com.nitido.nim.NiMKernelService
      extended by com.nitido.nim.AuthenticationService
          extended by com.nitido.nimx.services.authentication.sim.AuthenticationServiceImpl
All Implemented Interfaces:
NiMConstants

public class AuthenticationServiceImpl
extends AuthenticationService

This class provides a simulator for the AuthenticationService.

This implementation will authenticate any credential unless the credential has a user ID that starts with "badUser", contains only white spaces or is a null object.

This implementation will support all entity types specified in the credential unless the type is "badGroup". If "badGroup" is encountered, it will throw an IllegalCredentialException.


Field Summary
 
Fields inherited from interface com.nitido.nim.NiMConstants
ACTION_CREATE_NUGGET, ACTION_CREATE_NUGGET_BY_NAME, ACTION_CRED_SPACE_ADD, ACTION_CRED_SPACE_GET_KEYS, ACTION_CRED_SPACE_GET_KEYS_START_WITH, ACTION_CRED_SPACE_GET_VALUE, ACTION_CRED_SPACE_GET_VALUES, ACTION_CRED_SPACE_MODIFY, ACTION_CRED_SPACE_REMOVE_VALUE, ACTION_CRED_SPACE_REMOVE_VALUES, ACTION_CRED_SPACE_REPLACE, ACTION_DEPROVISION_ENTITY, ACTION_ENTITY_CHANGE_CRED, ACTION_LOG_EVENT, ACTION_PROVISION_ENTITY, ACTION_USER_SPACE_ADD, ACTION_USER_SPACE_GET_KEYS, ACTION_USER_SPACE_GET_KEYS_START_WITH, ACTION_USER_SPACE_GET_VALUE, ACTION_USER_SPACE_GET_VALUES, ACTION_USER_SPACE_MODIFY, ACTION_USER_SPACE_REMOVE_VALUE, ACTION_USER_SPACE_REMOVE_VALUES, ACTION_USER_SPACE_REPLACE, CONF_PREFIX_SECURITY_ACCESS, CONF_PREFIX_SECURITY_ALLOW, CONF_PREFIX_SECURITY_ASSIGN, CONF_PREFIX_SECURITY_RESOURCE, PARAM_CHANGE_CRED, PARAM_DEPROVISION_CREDENTIAL, PARAM_EVENT_NAME, PARAM_MODIFIER_CONTAINER, PARAM_NUGGET_CREATE_CRED, PARAM_NUGGET_NAME, PARAM_NUGGET_SETTINGS, PARAM_NUGGET_TYPE, PARAM_PROVISION_DESCRIPTOR, PARAM_SPACE_KEY, PARAM_SPACE_KEYS_START_WITH, PARAM_SPACE_VALUE, PREFIX_ACCESS_CLASS_IN_PACKAGE
 
Constructor Summary
AuthenticationServiceImpl(NiMKernelServiceVisa visa)
           
 
Method Summary
protected  Credential authenticateImpl(Credential credential)
          This method is used to authenticate the given credential against the back-end authentication service.
 void changeAuthenticationCredential(Credential oldCred, Credential newCred)
          This method is used to change the identifying credentials on an entity.
protected  void init(NiMKernel kernel, ConfigurationService confService)
          This method is used to initialize the service.
 
Methods inherited from class com.nitido.nim.AuthenticationService
authenticate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationServiceImpl

public AuthenticationServiceImpl(NiMKernelServiceVisa visa)
Method Detail

init

protected void init(NiMKernel kernel,
                    ConfigurationService confService)
             throws InitializationFailedException,
                    NiMException
This method is used to initialize the service.

Specified by:
init in class AuthenticationService
Parameters:
kernel - Reference to the kernel instance that instantiated this service.
confService - Reference to the ConfigurationService.
Throws:
InitializationFailedException - If unable to initialize this service. This exception is never thrown by this service implementation.
NiMException - If unable to connect with the back-end server. This exception is never throws by this service implementation.

authenticateImpl

protected Credential authenticateImpl(Credential credential)
                               throws AuthenticationFailedException,
                                      IllegalCredentialException,
                                      NiMException
This method is used to authenticate the given credential against the back-end authentication service.

Specified by:
authenticateImpl in class AuthenticationService
Parameters:
credential - The credential to authenticate against the back-end service.
Returns:
A Credential object that represents the tokens after the authentication. NOTE: even the tokens are not changed during the authentication, this method should still create a cloned instance of the original Credential. It should never return the original credential.
Throws:
IllegalCredentialException - If the credential is a null object.
AuthenticationFailedException - If unable to authenticate the given credential. This exception is thrown if the uid of the credential starts with "badUser" or if it is null.
NiMException - If the kernel service fails to connect to back-end authentication system.

changeAuthenticationCredential

public void changeAuthenticationCredential(Credential oldCred,
                                           Credential newCred)
                                    throws AuthenticationFailedException,
                                           IllegalCredentialException,
                                           NiMException
This method is used to change the identifying credentials on an entity.

Specified by:
changeAuthenticationCredential in class AuthenticationService
Parameters:
oldCred - The original credential
newCred - The new credential
Throws:
IllegalCredentialException - This service implementation throws this exception if the given credentials are null or if the uid of the new credential is NOT the same as the uid of the old credential.
AuthenticationFailedException - If unable to authenticate the given credential. This exception is thrown if the uid of the credential starts with "badUser" or if it is null.
NiMException - If the kernel service fails to connect to back-end authentication system. This exception is never thrown by this service implementation.

Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.