O
- The OAuth2 service provider type.public abstract class AbstractLiveConnectBlobProvider<O extends OAuth2ServiceProvider> extends AbstractBlobProvider implements LiveConnectBlobProvider<O>, BatchUpdateBlobProvider, DocumentBlobProvider
BlobProvider
for live connect.blobProviderId, properties
MAX_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(LiveConnectFileInfo fileInfo) |
boolean |
isVersion(ManagedBlob blob)
Should be overriden by subclasses needing something different.
|
boolean |
performsExternalAccessControl(BlobInfo blobInfo)
Checks if the blob provider performs external access control checks.
|
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(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) |
protected LiveConnectFileInfo |
toFileInfo(String key) |
String |
writeBlob(Blob blob)
Should be overriden by subclasses needing something different.
|
initialize, supportsUserUpdate, supportsUserUpdateDefaultFalse, supportsUserUpdateDefaultTrue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAppLinks, getAvailableConversions, getBinaryManager, getStream, getThumbnail, getURI, initialize, supportsUserUpdate
freezeVersion, getConvertedStream
public AbstractLiveConnectBlobProvider()
public void close()
close
in interface BlobProvider
public Blob readBlob(BlobInfo blobInfo) throws IOException
readBlob
in interface BlobProvider
blobInfo
- the blob informationIOException
public String writeBlob(Blob blob) throws IOException
writeBlob
in interface BlobProvider
blob
- the blobIOException
public boolean performsExternalAccessControl(BlobInfo blobInfo)
BlobProvider
performsExternalAccessControl
in interface BlobProvider
blobInfo
- the blob information to be readtrue
if the provider performs security checks before reading a blob, false
otherwisepublic boolean isVersion(ManagedBlob blob)
isVersion
in interface BlobProvider
blob
- the managed blobpublic List<DocumentModel> checkChangesAndUpdateBlob(List<DocumentModel> docs)
BatchUpdateBlobProvider
checkChangesAndUpdateBlob
in interface BatchUpdateBlobProvider
docs
- to be checked for updatepublic void processDocumentsUpdate()
BatchUpdateBlobProvider
processDocumentsUpdate
in interface BatchUpdateBlobProvider
protected 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>
IOException
protected SimpleManagedBlob toBlob(LiveConnectFile file)
protected String buildBlobKey(LiveConnectFileInfo fileInfo)
protected LiveConnectFileInfo toFileInfo(ManagedBlob blob)
protected LiveConnectFileInfo toFileInfo(String key)
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 itIOException
protected com.google.api.client.auth.oauth2.Credential getCredential(LiveConnectFileInfo fileInfo) throws IOException
IOException
protected com.google.api.client.auth.oauth2.Credential getCredential(NuxeoOAuth2Token token) throws IOException
IOException
public final com.google.api.client.auth.oauth2.Credential getCredential(String user) throws IOException
IOException
protected 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(LiveConnectFileInfo fileInfo)
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 infoIOException
Copyright © 2018 Nuxeo. All rights reserved.