|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.impl.config.domain.key.rtaware.ThreadLocalRuntimeAdapter
public final class ThreadLocalRuntimeAdapter
Accesses tenant and runtime information stored in thread local.
Constructor Summary | |
---|---|
ThreadLocalRuntimeAdapter() Default constructor. |
Method Summary | |
---|---|
static RuntimeAdapter |
getInstance() Returns the thread-locally stored instance. |
TenantId |
getTenantId() Returns the current tenant in action. |
UserId |
getUserId() Returns the current user in action. |
static void |
remove() Delegates to ThreadLocal.remove() . |
static void |
setTenantId(String tenantId) Sets the tenant string identifier to the thread-local context. |
static void |
setTenantId(TenantId tenantId) Sets the tenant identifier to the thread-local context. |
static void |
setUserId(String userId) Sets the user string identifier to the thread-local context. |
static void |
setUserId(UserId userId) Sets the user identifier to the thread-local context. |
String |
toString() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ThreadLocalRuntimeAdapter()
Method Detail |
---|
public TenantId getTenantId()
getTenantId
in interface
RuntimeAdapter
null
.
public UserId getUserId()
getUserId
in interface
RuntimeAdapter
null
.
public static RuntimeAdapter getInstance()
public static void setTenantId(String tenantId) throws IllegalArgumentException
tenantId
- the identifier of the current tenant in action. May be
null
, but must not be blank.
IllegalArgumentException
- if
tenantId
is blank.
public static void setTenantId(TenantId tenantId) throws NullPointerException
tenantId
- the identifier of the current tenant in action.
NullPointerException
- if
tenantId
is
null
.
public static void setUserId(String userId) throws IllegalArgumentException
userId
- the identifier of the current user in action.
IllegalArgumentException
- if
userId
is blank.
public static void setUserId(UserId userId) throws NullPointerException
userId
- the identifier of the current user in action.
NullPointerException
- if
userId
is
null
.
public static void remove()
ThreadLocal.remove()
.
public String toString()
toString
in class
Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |