public class NosTokenSceneConfig
extends java.lang.Object
NimNosSceneKeyConstant#NIM_DEFAULT_PROFILE
,
NimNosSceneKeyConstant#NIM_DEFAULT_IM
,
The default expiration time for the default scenario is {@link #NEVER_EXPIRE}. You can modify the expiration time for the default scenario.
You can add new scenarios and specify the expiration time (sceneKey-> expireTimeByDay). A maximum of 10 scenarios can be added.
When app users send a message or upload a file, the scenario can be specified. If unspecified, the default value applies.
To specify a scenario, use the corresponding sceneKey.
We recommend that you make the corresponding sceneKey a constant during configuration for easy use. For more information, see {@link NimNosSceneKeyConstant}.
Modifier and Type | Field and Description |
---|---|
static long |
NEVER_EXPIRE
Never expires, resources are always stored in the server.
|
Constructor and Description |
---|
NosTokenSceneConfig() |
Modifier and Type | Method and Description |
---|---|
NosTokenSceneConfig |
appendCustomScene(java.lang.String sceneKey,
int expireTime)
Add custom scenarios.
|
static NosTokenSceneConfig |
defaultConfig() |
java.util.HashMap<java.lang.String,java.lang.Long> |
getNosTokenScene()
Get all scenario copies.
|
void |
updateDefaultIMSceneExpireTime(int expireTime)
Update the expiration time for the default scenario
NimNosSceneKeyConstant#NIM_DEFAULT_IM |
void |
updateDefaultProfileSceneExpireTime(int expireTime)
Update the expiration time for the default scenario
NimNosSceneKeyConstant#NIM_DEFAULT_PROFILE |
public static final long NEVER_EXPIRE
public void updateDefaultProfileSceneExpireTime(int expireTime)
NimNosSceneKeyConstant#NIM_DEFAULT_PROFILE
expireTime
- Expiration time. A value of 0 indicates that the scenario never expires. Unit: days.public void updateDefaultIMSceneExpireTime(int expireTime)
NimNosSceneKeyConstant#NIM_DEFAULT_IM
expireTime
- Expiration time. A value of 0 indicates that the scenario never expires. Unit: days.public NosTokenSceneConfig appendCustomScene(java.lang.String sceneKey, int expireTime)
sceneKey
- The key for the custom scenario. The sceneKey is required for the custom scene.expireTime
- Expiration time. A value of 0 indicates that the scenario never expires. Unit: days.public java.util.HashMap<java.lang.String,java.lang.Long> getNosTokenScene()
public static NosTokenSceneConfig defaultConfig()