public abstract class ServiceCommon<S extends Session,SI extends AbstractSessionImpl> extends Object implements Service<S>
Modifier and Type | Field and Description |
---|---|
protected static AuthorizationResult |
DEFAULT_RESULT |
Constructor and Description |
---|
ServiceCommon() |
Modifier and Type | Method and Description |
---|---|
protected NotifyFuture<AuthorizationReply> |
authorize(AuthorizationRequest request,
CallbackHandler callbackHandler) |
protected NotifyFuture<AuthorizationReply> |
authorize(AuthorizationRequest request,
CallbackHandler callbackHandler,
AuthorizationResult defaultResult)
Authorize an operation
|
protected Set<String> |
extractPrivileges(Properties properties) |
protected void |
fillSessionProperties(UserInformation userInformation,
Map<String,String> sessionResultProperties) |
protected NotifyFuture<UserInformation> |
loginUser(Properties properties,
CallbackHandler callbackHandler)
Wraps the call to
#authenticate(Properties) so that the correct
exceptions are thrown for a #createSession(Properties) call. |
protected NotifyFuture<UserInformation> |
makeEffectiveUserInformation(AbstractSessionImpl session,
String targetUser,
CallbackHandler handler) |
void |
setAuditLogService(AuditLogService auditLogService) |
protected void |
setAuthenticationImplementation(AuthenticationImplementation authenticationImplementation) |
protected void |
setAuthorizationImplementation(AuthorizationImplementation authorizationImplementation) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
closeSession, createSession
start, stop
protected static final AuthorizationResult DEFAULT_RESULT
public void setAuditLogService(AuditLogService auditLogService)
protected void setAuthenticationImplementation(AuthenticationImplementation authenticationImplementation)
protected void setAuthorizationImplementation(AuthorizationImplementation authorizationImplementation)
protected Set<String> extractPrivileges(Properties properties)
protected NotifyFuture<UserInformation> loginUser(Properties properties, CallbackHandler callbackHandler)
#authenticate(Properties)
so that the correct
exceptions are thrown for a #createSession(Properties)
call.properties
- the user session propertiescallbackHandler
- the callback handler which handles callbackssessionResultProperties
- the map will be filled with the resulting session properties#authenticate(Properties)
#authenticate(Properties)
protected void fillSessionProperties(UserInformation userInformation, Map<String,String> sessionResultProperties)
protected NotifyFuture<AuthorizationReply> authorize(AuthorizationRequest request, CallbackHandler callbackHandler)
protected NotifyFuture<AuthorizationReply> authorize(AuthorizationRequest request, CallbackHandler callbackHandler, AuthorizationResult defaultResult)
The default implementation grants everything. Override to change according to your needs.
objectType
- the type of the object the operation takes placeobjectId
- the id of the object the operation takes placeuserInformation
- the user informationcontext
- the context informationdefaultResult
- the default result that should be returned if no one votes,
must not be null
null
protected NotifyFuture<UserInformation> makeEffectiveUserInformation(AbstractSessionImpl session, String targetUser, CallbackHandler handler)