public abstract class AlfrescoService extends Object implements Service
ServiceRegistry
Modifier and Type | Field and Description |
---|---|
protected static int |
CONTENT_CACHE |
protected static int |
RENDITION_CACHE |
protected AlfrescoSession |
session
Repository Session.
|
Constructor and Description |
---|
AlfrescoService()
Default empty Constructor.
|
AlfrescoService(AlfrescoSession repositorySession)
Default constructor for service.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear all caches informations used by the service.
|
protected static void |
convertException(Exception t)
Catch all underlying CMIS or not exception and throw them as
AlfrescoServiceException |
protected Node |
convertNode(org.apache.chemistry.opencmis.client.api.CmisObject object)
Wrap and transform cmisobject into NodeObject
|
protected Node |
convertNode(org.apache.chemistry.opencmis.client.api.CmisObject object,
boolean hasAllProperties) |
void |
convertStatusCode(org.apache.chemistry.opencmis.client.bindings.spi.http.Response resp,
int serviceErrorCode)
Try to convert error response from repository into high level
ErrorContent object.
|
protected void |
delete(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url,
int errorCode)
Performs a DELETE on an URL, checks the response code and returns the
result.
|
int |
describeContents() |
protected org.apache.chemistry.opencmis.client.bindings.spi.http.HttpInvoker |
getHttpInvoker()
Gets the HTTP Invoker object.
|
protected org.apache.chemistry.opencmis.client.bindings.spi.BindingSession |
getSessionHttp() |
protected boolean |
isCloudSession() |
protected boolean |
isListNull(List l)
Utils method to check if a list is null/empty.
|
protected boolean |
isMapNull(Map m)
Utils method to check if a map is null/empty.
|
protected boolean |
isObjectNull(Object o)
Utils method to check if an object is null.
|
protected boolean |
isOnPremiseSession() |
protected boolean |
isStringNull(String s)
Utils method to check if a string objec is null or empty.
|
protected org.apache.chemistry.opencmis.client.bindings.spi.http.Response |
post(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url,
String contentType,
org.apache.chemistry.opencmis.client.bindings.spi.http.Output writer,
int errorCode)
Performs a POST on an URL, checks the response code and returns the
result.
|
protected org.apache.chemistry.opencmis.client.bindings.spi.http.Response |
put(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url,
String contentType,
Map<String,String> headers,
org.apache.chemistry.opencmis.client.bindings.spi.http.Output writer,
int errorCode)
Performs a PUT on an URL, checks the response code and returns the
result.
|
protected org.apache.chemistry.opencmis.client.bindings.spi.http.Response |
read(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url,
int errorCode)
Performs a GET on an URL, checks the response code and returns the
result.
|
protected ContentFile |
saveContentStream(ContentStream contentStream,
String cacheFileName,
int storageType)
Allow to save a contentStream inside the devices file system.
|
void |
writeToParcel(android.os.Parcel dest,
int arg1) |
protected AlfrescoSession session
protected static final int RENDITION_CACHE
protected static final int CONTENT_CACHE
public AlfrescoService()
public AlfrescoService(AlfrescoSession repositorySession)
ServiceRegistry
.repositorySession
- : Repository Session.cmisSession
- : CMIS session.protected org.apache.chemistry.opencmis.client.bindings.spi.http.Response read(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url, int errorCode)
url
- : requested URL. @ : if network or internal problems occur
during the process.protected org.apache.chemistry.opencmis.client.bindings.spi.http.Response post(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url, String contentType, org.apache.chemistry.opencmis.client.bindings.spi.http.Output writer, int errorCode)
protected void delete(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url, int errorCode)
protected org.apache.chemistry.opencmis.client.bindings.spi.http.Response put(org.apache.chemistry.opencmis.commons.impl.UrlBuilder url, String contentType, Map<String,String> headers, org.apache.chemistry.opencmis.client.bindings.spi.http.Output writer, int errorCode)
protected org.apache.chemistry.opencmis.client.bindings.spi.BindingSession getSessionHttp()
protected org.apache.chemistry.opencmis.client.bindings.spi.http.HttpInvoker getHttpInvoker()
protected Node convertNode(org.apache.chemistry.opencmis.client.api.CmisObject object)
object
- : Underlying OpenCMIS Objectprotected Node convertNode(org.apache.chemistry.opencmis.client.api.CmisObject object, boolean hasAllProperties)
protected boolean isObjectNull(Object o)
o
- : object to checkprotected boolean isStringNull(String s)
s
- : String to checkprotected boolean isListNull(List l)
l
- : object to checkprotected boolean isMapNull(Map m)
l
- : object to checkprotected boolean isOnPremiseSession()
protected boolean isCloudSession()
protected static void convertException(Exception t)
AlfrescoServiceException
t
- : exceptions catchedpublic void convertStatusCode(org.apache.chemistry.opencmis.client.bindings.spi.http.Response resp, int serviceErrorCode)
resp
- : http response.serviceErrorCode
- : service from which the error occurs.protected ContentFile saveContentStream(ContentStream contentStream, String cacheFileName, int storageType)
contentStream
- : Content stream of any contentcacheFileName
- : Name of the cache filestorageType
- : Determine in which subfolders the content is storedpublic void clear()
Service
public int describeContents()
describeContents
in interface android.os.Parcelable
public void writeToParcel(android.os.Parcel dest, int arg1)
writeToParcel
in interface android.os.Parcelable
Copyright © 2012-2018 Alfresco Software. All Rights Reserved.