public class WOPIServiceImpl extends DefaultComponent implements WOPIService
Modifier and Type | Class and Description |
---|---|
static class |
WOPIServiceImpl.WOPIDiscoveryInvalidation |
class |
WOPIServiceImpl.WOPIDiscoveryInvalidator |
Modifier and Type | Field and Description |
---|---|
protected static String |
CLUSTERING_ENABLED_PROP |
protected String |
discoveryURL |
protected Map<String,Map<String,String>> |
extensionActionURLs |
protected Map<String,String> |
extensionAppNames |
protected WOPIServiceImpl.WOPIDiscoveryInvalidator |
invalidator |
protected static String |
NODE_ID_PROP |
protected PublicKey |
oldProofKey |
static String |
PLACEHOLDER_IS_LICENSED_USER |
static String |
PLACEHOLDER_IS_LICENSED_USER_VALUE |
protected PublicKey |
proofKey |
protected static Random |
RANDOM |
static String |
SUPPORTED_APP_NAMES_PROPERTY_KEY |
protected static String |
WOPI_DISCOVERY_INVAL_PUBSUB_TOPIC |
static String |
WOPI_PROPERTY_NAMESPACE |
lastModified, name
Constructor and Description |
---|
WOPIServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
fetchDiscovery() |
protected void |
fireRefreshDiscovery() |
String |
getActionURL(Blob blob,
String action)
Returns the WOPI action url given a
blob and an action . |
protected byte[] |
getDiscovery() |
protected String |
getExtension(Blob blob) |
protected KeyValueStore |
getKeyValueStore() |
protected List<String> |
getSupportedAppNames() |
WOPIBlobInfo |
getWOPIBlobInfo(Blob blob)
Returns a
WOPIBlobInfo for the given blob if it is supported by WOPI, null otherwise. |
boolean |
isEnabled()
Returns @{code true} if WOPI is enabled,
false otherwise. |
protected void |
loadDiscovery() |
protected boolean |
loadDiscovery(byte[] discoveryBytes) |
boolean |
refreshDiscovery()
Refreshes the WOPI discovery: fetches the data from the discovery URL, stores it and loads it in memory.
|
protected void |
registerApp(WOPIDiscovery.App app) |
protected void |
registerInvalidator() |
void |
start(ComponentContext context)
Start the component.
|
protected void |
storeDiscovery(byte[] discoveryBytes) |
boolean |
verifyProofKey(String proofKeyHeader,
String oldProofKeyHeader,
String url,
String accessToken,
String timestampHeader)
Verifies that the request originate from Office Online.
|
activate, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, stop, unregister, unregisterContribution, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
public static final String PLACEHOLDER_IS_LICENSED_USER
public static final String PLACEHOLDER_IS_LICENSED_USER_VALUE
public static final String WOPI_PROPERTY_NAMESPACE
public static final String SUPPORTED_APP_NAMES_PROPERTY_KEY
protected static final String CLUSTERING_ENABLED_PROP
protected static final String NODE_ID_PROP
protected static final String WOPI_DISCOVERY_INVAL_PUBSUB_TOPIC
protected Map<String,String> extensionAppNames
protected PublicKey oldProofKey
protected String discoveryURL
protected WOPIServiceImpl.WOPIDiscoveryInvalidator invalidator
public WOPIServiceImpl()
public void start(ComponentContext context)
Component
start
in interface Component
start
in class DefaultComponent
protected void registerInvalidator()
protected void loadDiscovery()
protected boolean loadDiscovery(byte[] discoveryBytes)
protected void fireRefreshDiscovery()
protected List<String> getSupportedAppNames()
protected void registerApp(WOPIDiscovery.App app)
public boolean isEnabled()
WOPIService
false
otherwise.
The WOPI discovery XML file has been loaded.
isEnabled
in interface WOPIService
public WOPIBlobInfo getWOPIBlobInfo(Blob blob)
WOPIService
WOPIBlobInfo
for the given blob if it is supported by WOPI, null
otherwise.getWOPIBlobInfo
in interface WOPIService
public String getActionURL(Blob blob, String action)
WOPIService
blob
and an action
.getActionURL
in interface WOPIService
protected String getExtension(Blob blob)
public boolean verifyProofKey(String proofKeyHeader, String oldProofKeyHeader, String url, String accessToken, String timestampHeader)
WOPIService
verifyProofKey
in interface WOPIService
public boolean refreshDiscovery()
WOPIService
refreshDiscovery
in interface WOPIService
true
if refreshing the discovery has succeeded, false
otherwiseprotected byte[] fetchDiscovery()
protected byte[] getDiscovery()
protected void storeDiscovery(byte[] discoveryBytes)
protected KeyValueStore getKeyValueStore()
Copyright © 2019 Nuxeo. All rights reserved.