public class VitamSession extends Object
Generic VitamSession object ; used to store thread context information.
Only one instance of this class must be used per thread. In fact, only
VitamThreadFactory.VitamThread
should be allowed to create one.
Finally, this class is NOT threadsafe ; only the thread "owning" the instance should be used to access it. Any other
thread will cause an IllegalStateException
when mutating its state.
Constructor and Description |
---|
VitamSession(VitamThreadFactory.VitamThread owningThread) |
Modifier and Type | Method and Description |
---|---|
void |
checkValidRequestId()
Check if the session contains a valid request id
|
void |
erase()
Erase the content of the VitamSession
|
static VitamSession |
from(VitamSession origin)
Build a clone of the original VitamSession, attached to the same thread.
|
String |
getApplicationSessionId()
Get vitam application session id
|
String |
getContextId()
Get vitam security context id
|
AccessContractModel |
getContract() |
String |
getContractId() |
String |
getInternalRequestId()
Get the server request id
|
Object |
getOther() |
String |
getRequestId() |
String |
getSecurityProfileIdentifier() |
Integer |
getTenantId() |
void |
mutateFrom(VitamSession newSession)
Get the content of a given VitamSession and copy its internal values to the current instance
|
void |
setApplicationSessionId(String applicationSessionId)
Set vitam application session id
|
void |
setContextId(String contextId)
Set vitam security context id
|
void |
setContract(AccessContractModel contract) |
void |
setContractId(String contractId) |
void |
setInternalRequestId(String newRequestId)
Set the server request id
|
VitamSession |
setOther(Object other) |
void |
setRequestId(GUID guid)
Sets the request id from the guid
|
void |
setRequestId(String newRequestId)
Set the request id and saves it to the MDC
|
void |
setSecurityProfileIdentifier(String securityProfileIdentifier) |
void |
setTenantId(Integer newTenantId)
Sets the tenantId
|
String |
toString() |
public VitamSession(VitamThreadFactory.VitamThread owningThread)
owningThread
- the owning threadpublic static VitamSession from(VitamSession origin)
origin
- VitamSession to clonepublic Object getOther()
public VitamSession setOther(Object other)
other
- the other to setpublic String getRequestId()
public void setRequestId(String newRequestId)
newRequestId
- the request idpublic void setInternalRequestId(String newRequestId)
newRequestId
- the request idpublic String getInternalRequestId()
public Integer getTenantId()
public void setTenantId(Integer newTenantId)
newTenantId
- public void setRequestId(GUID guid)
guid
- the guidpublic String getContractId()
public void setContractId(String contractId)
contractId
- public AccessContractModel getContract()
public void setContract(AccessContractModel contract)
contract
- public String getContextId()
public void setContextId(String contextId)
contextId
- public String getSecurityProfileIdentifier()
public void setSecurityProfileIdentifier(String securityProfileIdentifier)
public String getApplicationSessionId()
public void setApplicationSessionId(String applicationSessionId)
applicationSessionId
- public void mutateFrom(@NotNull VitamSession newSession)
newSession
- Source sessionpublic void erase()
public void checkValidRequestId()
IllegalArgumentException
Copyright © 2018 Vitam. All rights reserved.