USER
- User typeROLE
- Role typepublic abstract class AbstractMultiUserConfig<USER,ROLE> extends java.lang.Object implements MultiUserConfig<USER,ROLE>
Constructor and Description |
---|
AbstractMultiUserConfig()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
protected Authorization |
getAuthorizationRule() |
USER |
getConsumer()
Returns the current consumer user
|
protected RoleContainer<ROLE> |
getConsumerRoleContainer() |
java.lang.Class<? extends java.lang.Throwable> |
getDefaultException(java.lang.Class<?> cls) |
USER |
getProducer()
Returns the current producer user
|
protected RoleContainer<ROLE> |
getProducerRoleContainer() |
java.lang.String |
getRandomUsername() |
void |
initialize() |
void |
loginAnonymous()
"Log in" anonymous user.
|
void |
logInAs(LoginRole role)
Login as the given user login role using the configured producer or consmer.
|
void |
setAuthorizationRule(Authorization authorizationRule) |
void |
setUsers(UserIdentifier producerIdentifier,
UserIdentifier consumerIdentifier)
Sets user identifiers.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createUser, getUserByUsername
stringToRole
loginWithUser
protected Authorization getAuthorizationRule()
public void setAuthorizationRule(Authorization authorizationRule)
setAuthorizationRule
in interface MultiUserConfig<USER,ROLE>
public void setUsers(UserIdentifier producerIdentifier, UserIdentifier consumerIdentifier)
UserRoleIT
setUsers
in interface UserRoleIT<USER>
producerIdentifier
- Producer identifierconsumerIdentifier
- Consumer identifierpublic USER getConsumer()
UserRoleIT
getConsumer
in interface UserRoleIT<USER>
public USER getProducer()
UserRoleIT
getProducer
in interface UserRoleIT<USER>
public void logInAs(LoginRole role)
UserRoleIT
logInAs
in interface UserRoleIT<USER>
role
- Which user should be logged inpublic void loginAnonymous()
UserRoleIT
UserRoleIT.loginWithUser(Object)
using null as the user. Can be overridden to change the behaviour.loginAnonymous
in interface UserRoleIT<USER>
public java.lang.String getRandomUsername()
getRandomUsername
in interface UserFactory<USER,ROLE>
public java.lang.Class<? extends java.lang.Throwable> getDefaultException(java.lang.Class<?> cls)
getDefaultException
in interface UserRoleIT<USER>
public void initialize()
initialize
in interface MultiUserConfig<USER,ROLE>
protected RoleContainer<ROLE> getConsumerRoleContainer()
protected RoleContainer<ROLE> getProducerRoleContainer()