O - The OAuth2 service provider type.public abstract class AbstractLiveConnectBlobProvider<O extends OAuth2ServiceProvider> extends AbstractBlobProvider implements LiveConnectBlobProvider<O>, BatchUpdateBlobProvider
BlobProvider for live connect.blobProviderId, propertiesMAX_RESULT| Constructor and Description |
|---|
AbstractLiveConnectBlobProvider() |
| Modifier and Type | Method and Description |
|---|---|
protected URI |
asURI(String link)
Parse a
URI. |
protected String |
buildBlobKey(LiveConnectFileInfo fileInfo) |
List<DocumentModel> |
checkChangesAndUpdateBlob(List<DocumentModel> docs)
Check the given list of document for change and update if needed.
|
void |
close()
Should be overriden by subclasses needing something different.
|
protected abstract String |
getCacheName() |
protected com.google.api.client.auth.oauth2.Credential |
getCredential(LiveConnectFileInfo fileInfo) |
protected com.google.api.client.auth.oauth2.Credential |
getCredential(NuxeoOAuth2Token token) |
com.google.api.client.auth.oauth2.Credential |
getCredential(String user) |
protected CredentialFactory |
getCredentialFactory()
Should be overriden by subclasses needing another credential factory.
|
protected LiveConnectFile |
getFile(LiveConnectFileInfo fileInfo)
Returns the
LiveConnectFile from cache, if it doesn't exist retrieves it with API and cache it. |
protected LiveConnectFile |
getFileFromCache(LiveConnectFileInfo fileInfo) |
protected <T extends Serializable> |
getFromCache(String key) |
O |
getOAuth2Provider() |
protected abstract String |
getPageProviderNameForUpdate() |
protected boolean |
hasChanged(SimpleManagedBlob blob,
LiveConnectFile file)
Should be overriden by subclasses wanting to rely on a different fields.
|
protected void |
invalidateInCache(String key) |
boolean |
isVersion(ManagedBlob blob)
Should be overriden by subclasses needing something different.
|
void |
processDocumentsUpdate()
Trigger the documents update for the implementing providers.
|
protected void |
putFileInCache(LiveConnectFile file) |
protected <T extends Serializable> |
putInCache(String key,
T object) |
Blob |
readBlob(BlobManager.BlobInfo blobInfo)
Should be overriden by subclasses needing something different.
|
protected abstract LiveConnectFile |
retrieveFile(LiveConnectFileInfo fileInfo)
Retrieves the file with API.
|
protected SimpleManagedBlob |
toBlob(LiveConnectFile file) |
SimpleManagedBlob |
toBlob(LiveConnectFileInfo fileInfo) |
protected LiveConnectFileInfo |
toFileInfo(ManagedBlob blob) |
String |
writeBlob(Blob blob,
Document doc)
Should be overriden by subclasses needing something different.
|
initialize, supportsUserUpdate, supportsUserUpdateDefaultFalse, supportsUserUpdateDefaultTrueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfreezeVersion, getAppLinks, getAvailableConversions, getBinaryManager, getConvertedStream, getStream, getThumbnail, getURI, initialize, supportsUserUpdatepublic AbstractLiveConnectBlobProvider()
public void close()
close in interface BlobProviderpublic Blob readBlob(BlobManager.BlobInfo blobInfo) throws IOException
readBlob in interface BlobProviderblobInfo - the blob informationIOExceptionpublic String writeBlob(Blob blob, Document doc) throws IOException
writeBlob in interface BlobProviderblob - the blobdoc - the document to which this blob belongsIOExceptionpublic boolean isVersion(ManagedBlob blob)
isVersion in interface BlobProviderblob - the managed blobpublic List<DocumentModel> checkChangesAndUpdateBlob(List<DocumentModel> docs)
BatchUpdateBlobProvidercheckChangesAndUpdateBlob in interface BatchUpdateBlobProviderdocs - to be checked for updatepublic void processDocumentsUpdate()
BatchUpdateBlobProviderprocessDocumentsUpdate in interface BatchUpdateBlobProviderprotected boolean hasChanged(SimpleManagedBlob blob, LiveConnectFile file)
public O getOAuth2Provider()
getOAuth2Provider in interface LiveConnectBlobProvider<O extends OAuth2ServiceProvider>public SimpleManagedBlob toBlob(LiveConnectFileInfo fileInfo) throws IOException
toBlob in interface LiveConnectBlobProvider<O extends OAuth2ServiceProvider>IOExceptionprotected SimpleManagedBlob toBlob(LiveConnectFile file)
protected String buildBlobKey(LiveConnectFileInfo fileInfo)
protected LiveConnectFileInfo toFileInfo(ManagedBlob blob)
protected LiveConnectFile getFile(LiveConnectFileInfo fileInfo) throws IOException
LiveConnectFile from cache, if it doesn't exist retrieves it with API and cache it.fileInfo - the file infoLiveConnectFile from cache, if it doesn't exist retrieves it with API and cache itIOExceptionprotected com.google.api.client.auth.oauth2.Credential getCredential(LiveConnectFileInfo fileInfo) throws IOException
IOExceptionprotected com.google.api.client.auth.oauth2.Credential getCredential(NuxeoOAuth2Token token) throws IOException
IOExceptionpublic final com.google.api.client.auth.oauth2.Credential getCredential(String user) throws IOException
IOExceptionprotected CredentialFactory getCredentialFactory()
protected final <T extends Serializable> T getFromCache(String key)
protected final <T extends Serializable> void putInCache(String key, T object)
protected final void invalidateInCache(String key)
protected final LiveConnectFile getFileFromCache(LiveConnectFileInfo fileInfo)
protected final void putFileInCache(LiveConnectFile file)
protected abstract String getCacheName()
protected abstract String getPageProviderNameForUpdate()
protected abstract LiveConnectFile retrieveFile(LiveConnectFileInfo fileInfo) throws IOException
fileInfo - the file infoIOExceptionCopyright © 2016 Nuxeo SA. All rights reserved.