Class OnlyOfficeKeyManager
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.workspaces.documents.onlyoffice.OnlyOfficeKeyManager
-
- All Implemented Interfaces:
LogEnabled
,Initializable
,Component
public class OnlyOfficeKeyManager extends AbstractLogEnabled implements Component, Initializable
Manager for key/token used in OnlyOffice
-
-
Constructor Summary
Constructors Constructor Description OnlyOfficeKeyManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private String
_resourceIdToTokenKey(String ressourceId)
protected String
createKey(String tokenKey)
Create the OnlyOffice keyString
getKey(String resourceId)
Get the OnlyOffice key associated with the resource If a key exist for the resourceId, return it and increment _nbHolders If no key exist for the resourceId, create a new key, put at 1 the _nbHolders and return the keyvoid
initialize()
void
removeKey(String resourceId)
Remove OnlyOffice key-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Constructor Detail
-
OnlyOfficeKeyManager
public OnlyOfficeKeyManager()
-
-
Method Detail
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getKey
public String getKey(String resourceId)
Get the OnlyOffice key associated with the resource If a key exist for the resourceId, return it and increment _nbHolders If no key exist for the resourceId, create a new key, put at 1 the _nbHolders and return the key- Parameters:
resourceId
- id of the resource to look- Returns:
- the OnlyOffice key
-
createKey
protected String createKey(String tokenKey)
Create the OnlyOffice key- Parameters:
tokenKey
- id of the resource associate to the key- Returns:
- the new key
-
removeKey
public void removeKey(String resourceId)
Remove OnlyOffice key- Parameters:
resourceId
- id of the resource
-
_resourceIdToTokenKey
private String _resourceIdToTokenKey(String ressourceId)
-
-