org.talika.tarsis.security.memory
Class MemoryAuthorizator

java.lang.Object
  extended by org.talika.tarsis.service.AbstractService
      extended by org.talika.tarsis.security.AuthorizatorService
          extended by org.talika.tarsis.security.memory.MemoryAuthorizator
All Implemented Interfaces:
Authorizator, Service

public final class MemoryAuthorizator
extends AuthorizatorService

XML/Memory implementation of Authorizator interface.

Version:
$Revision: 269 $
Author:
Jose M. Palomar

Constructor Summary
MemoryAuthorizator()
          Creates a new MemoryAuthorizator.
 
Method Summary
 void authorize(User user, Command command)
          Checks if User has authorizations to access Command.
 java.lang.String getName()
          Returns name of service.
 void init(Context context)
          Called by the framework to indicate that is being placed into service.
 boolean isRestricted(Command command)
          Returns true if Command has access restrited.
 
Methods inherited from class org.talika.tarsis.service.AbstractService
destroy, getContext, getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryAuthorizator

public MemoryAuthorizator()
Creates a new MemoryAuthorizator.

Method Detail

init

public void init(Context context)
          throws ServiceException
Called by the framework to indicate that is being placed into service.

Load authorizations from XML file.

Specified by:
init in interface Service
Overrides:
init in class AbstractService
Parameters:
context - Context context that initialized service.
Throws:
ServiceException - if an exception has occurred that interferes with the services's normal operation
See Also:
Service.init(Context)

getName

public java.lang.String getName()
Returns name of service.

Specified by:
getName in interface Service
Specified by:
getName in class AbstractService
Returns:
String name of service.
See Also:
Service.getName()

authorize

public void authorize(User user,
                      Command command)
               throws ForbiddenAccessException
Checks if User has authorizations to access Command. If not throws a ForbiddenAccessException.

Specified by:
authorize in interface Authorizator
Specified by:
authorize in class AuthorizatorService
Parameters:
user - User user to be checked.
command - Command command to be checked.
Throws:
ForbiddenAccessException - if User has not authorization.
See Also:
Authorizator.authorize(User, Command)

isRestricted

public boolean isRestricted(Command command)
Returns true if Command has access restrited.

Specified by:
isRestricted in interface Authorizator
Specified by:
isRestricted in class AuthorizatorService
Parameters:
command - Command command to be checked.
Returns:
boolean true if Command has access restrited.
See Also:
Authorizator.isRestricted(Command)


Copyright © 2002-2012 Talika Open Source Group. All Rights Reserved.