public class DefaultStrolchPrivilegeHandler extends StrolchComponent implements PrivilegeHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
PRIVILEGE_CONFIG_XML |
static String |
PROP_PRIVILEGE_CONFIG_FILE |
COMPONENT_VERSION_PROPERTIES, logger| Constructor and Description |
|---|
DefaultStrolchPrivilegeHandler(ComponentContainer container,
String componentName) |
| Modifier and Type | Method and Description |
|---|---|
Certificate |
authenticate(String username,
byte[] password)
Authenticate a user
|
PrivilegeContext |
getPrivilegeContext(Certificate certificate)
Returns the
PrivilegeContext for the given certificate |
PrivilegeHandler |
getPrivilegeHandler()
Returns the
PrivilegeHandler |
void |
initialize(ComponentConfiguration configuration)
Life cycle step initialize.
|
boolean |
invalidateSession(Certificate certificate)
Invalidates the given certificate
|
void |
isCertificateValid(Certificate certificate)
Validate that the certificate is still valid
|
void |
runAs(String username,
PrivilegedRunnable runnable)
Performs the given
PrivilegedRunnable as the given system user |
void |
runAs(String username,
SystemAction action)
Performs the given
PrivilegedRunnable as the given system user |
void |
runAsAgent(PrivilegedRunnable runnable)
Performs the given
PrivilegedRunnable as the privileged system user
StrolchConstants.SYSTEM_USER_AGENT |
void |
runAsAgent(SystemAction action)
Performs the given
PrivilegedRunnable as the given system user |
<T> T |
runAsAgentWithResult(PrivilegedRunnableWithResult<T> runnable)
Performs the given
PrivilegedRunnable as the privileged system user
StrolchConstants.SYSTEM_USER_AGENT |
<T> T |
runAsAgentWithResult(SystemActionWithResult<T> action)
Performs the given
PrivilegedRunnable as the given system user |
<T> T |
runWithResult(String username,
PrivilegedRunnableWithResult<T> runnable)
Performs the given
PrivilegedRunnable as the given system user |
<T> T |
runWithResult(String username,
SystemActionWithResult<T> action)
Performs the given
PrivilegedRunnable as the given system user |
boolean |
sessionTimeout(Certificate certificate)
Notifies that the session has timed out, i.e.
|
assertContainerStarted, assertStarted, destroy, getConfiguration, getContainer, getName, getState, getVersion, setup, start, stoppublic static final String PROP_PRIVILEGE_CONFIG_FILE
public static final String PRIVILEGE_CONFIG_XML
public DefaultStrolchPrivilegeHandler(ComponentContainer container, String componentName)
public void initialize(ComponentConfiguration configuration) throws Exception
StrolchComponentinitialize in class StrolchComponentExceptionpublic Certificate authenticate(String username, byte[] password)
PrivilegeHandlerauthenticate in interface PrivilegeHandlerusername - the usernamepassword - the passwordPrivilegeHandler.authenticate(String, byte[])public void isCertificateValid(Certificate certificate) throws PrivilegeException
PrivilegeHandlerisCertificateValid in interface PrivilegeHandlercertificate - the certificatePrivilegeException - if the certificate is not validPrivilegeHandler.isCertificateValid(Certificate)public boolean invalidateSession(Certificate certificate)
PrivilegeHandlerinvalidateSession in interface PrivilegeHandlercertificate - the certificatePrivilegeHandler.invalidateSession(li.strolch.privilege.model.Certificate)public boolean sessionTimeout(Certificate certificate)
PrivilegeHandlersessionTimeout in interface PrivilegeHandlercertificate - the certificate that has timed outPrivilegeHandler.invalidateSession(li.strolch.privilege.model.Certificate)public void runAs(String username, SystemAction action) throws PrivilegeException
StrolchComponentPrivilegedRunnable as the given system userrunAs in interface PrivilegeHandlerrunAs in class StrolchComponentusername - the name of the system user to perform the action asaction - the action to performPrivilegeException - if there is something wrongpublic <T> T runWithResult(String username, SystemActionWithResult<T> action) throws PrivilegeException
StrolchComponentPrivilegedRunnable as the given system userrunWithResult in interface PrivilegeHandlerrunWithResult in class StrolchComponentusername - the name of the system user to perform the action asaction - the action to performPrivilegeException - if there is something wrongpublic void runAs(String username, PrivilegedRunnable runnable) throws PrivilegeException
StrolchComponentPrivilegedRunnable as the given system userrunAs in interface PrivilegeHandlerrunAs in class StrolchComponentusername - the name of the system user to perform the action asrunnable - the runnable to performPrivilegeException - if there is something wrongpublic <T> T runWithResult(String username, PrivilegedRunnableWithResult<T> runnable) throws PrivilegeException
StrolchComponentPrivilegedRunnable as the given system userrunWithResult in interface PrivilegeHandlerrunWithResult in class StrolchComponentusername - the name of the system user to perform the action asrunnable - the runnable to performPrivilegeException - if there is something wrongpublic void runAsAgent(SystemAction action) throws PrivilegeException
StrolchComponentPrivilegedRunnable as the given system userrunAsAgent in interface PrivilegeHandlerrunAsAgent in class StrolchComponentaction - the action to performPrivilegeException - if there is something wrongpublic <T> T runAsAgentWithResult(SystemActionWithResult<T> action) throws PrivilegeException
StrolchComponentPrivilegedRunnable as the given system userrunAsAgentWithResult in interface PrivilegeHandlerrunAsAgentWithResult in class StrolchComponentaction - the action to performPrivilegeException - if there is something wrongpublic void runAsAgent(PrivilegedRunnable runnable) throws PrivilegeException
StrolchComponentPrivilegedRunnable as the privileged system user
StrolchConstants.SYSTEM_USER_AGENTrunAsAgent in interface PrivilegeHandlerrunAsAgent in class StrolchComponentrunnable - the runnable to performPrivilegeException - if there is something wrongpublic <T> T runAsAgentWithResult(PrivilegedRunnableWithResult<T> runnable) throws PrivilegeException
StrolchComponentPrivilegedRunnable as the privileged system user
StrolchConstants.SYSTEM_USER_AGENTrunAsAgentWithResult in interface PrivilegeHandlerrunAsAgentWithResult in class StrolchComponentrunnable - the runnable to performPrivilegeException - if there is something wrongpublic PrivilegeContext getPrivilegeContext(Certificate certificate) throws PrivilegeException
PrivilegeHandlerPrivilegeContext for the given certificategetPrivilegeContext in interface PrivilegeHandlercertificate - the certificatePrivilegeContext for the given certificatePrivilegeException - if the certificate is not valid anymorePrivilegeHandler.getPrivilegeContext(li.strolch.privilege.model.Certificate)public PrivilegeHandler getPrivilegeHandler()
PrivilegeHandlerPrivilegeHandlergetPrivilegeHandler in interface PrivilegeHandlerPrivilegeHandlerCopyright © 2011–2016 Strolch. All rights reserved.