public abstract class AbstractAtomPubService extends Object implements LinkAccess
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractAtomPubService.IdentifierType |
Modifier and Type | Field and Description |
---|---|
protected static String |
NAME_COLLECTION |
protected static String |
NAME_NUM_ITEMS |
protected static String |
NAME_PATH_SEGMENT |
protected static String |
NAME_RELATIVE_PATH_SEGMENT |
protected static String |
NAME_URI_TEMPLATE |
Constructor and Description |
---|
AbstractAtomPubService() |
Modifier and Type | Method and Description |
---|---|
protected void |
addCollection(String repositoryId,
String collection,
String link)
Adds a collection to the cache.
|
protected void |
addLink(String repositoryId,
String id,
AtomLink link)
Adds a link to the cache.
|
protected void |
addLink(String repositoryId,
String id,
String rel,
String type,
String link)
Adds a link to the cache.
|
protected void |
addRepositoryLink(String repositoryId,
AtomLink link)
Adds a repository link to the cache.
|
protected void |
addRepositoryLink(String repositoryId,
String rel,
String link)
Adds a repository link to the cache.
|
protected void |
addTemplate(String repositoryId,
String type,
String link)
Adds an URI template to the cache.
|
protected void |
addTypeLink(String repositoryId,
String typeId,
AtomLink link)
Adds a type link to the cache.
|
protected void |
addTypeLink(String repositoryId,
String typeId,
String rel,
String type,
String link)
Adds a type link to the cache.
|
protected CmisBaseException |
convertStatusCode(int code,
String message,
String errorContent,
Throwable t)
Converts a HTTP status code into an Exception.
|
protected ObjectData |
createIdObject(String objectId)
Creates a CMIS object that only contains an id in the property list.
|
protected ObjectDataImpl |
createObject(Properties properties,
String changeToken,
List<String> policies)
Creates a CMIS object with properties and policy ids.
|
protected void |
delete(UrlBuilder url)
Performs a DELETE on an URL, checks the response code and returns the
result.
|
protected String |
extractErrorMessage(String message,
String errorContent) |
protected String |
extractException(String errorContent) |
Acl |
getAclInternal(String repositoryId,
String objectId,
Boolean onlyBasicPermissions,
ExtensionsData extension)
Retrieves the ACL of an object.
|
protected CmisVersion |
getCmisVersion(String repositoryId)
Return the CMIS version of the given repository.
|
protected String |
getCollection(String repositoryId,
String collection)
Gets a collection from the cache.
|
protected HttpInvoker |
getHttpInvoker()
Gets the HTTP Invoker object.
|
protected String |
getLink(String repositoryId,
String id,
String rel)
Gets a link from the cache.
|
protected String |
getLink(String repositoryId,
String id,
String rel,
String type)
Gets a link from the cache.
|
protected LinkCache |
getLinkCache()
Returns the link cache or creates a new cache if it doesn't exist.
|
protected ObjectData |
getObjectInternal(String repositoryId,
AbstractAtomPubService.IdentifierType idOrPath,
String objectIdOrPath,
ReturnVersion returnVersion,
String filter,
Boolean includeAllowableActions,
IncludeRelationships includeRelationships,
String renditionFilter,
Boolean includePolicyIds,
Boolean includeAcl,
ExtensionsData extension)
Retrieves an object from the server and caches the links.
|
protected List<RepositoryInfo> |
getRepositoriesInternal(String repositoryId)
Retrieves the Service Document from the server and caches the repository
info objects, collections, links, URI templates, etc.
|
protected String |
getRepositoryLink(String repositoryId,
String rel)
Gets a repository link from the cache.
|
protected String |
getServiceDocURL()
Returns the service document URL of this session.
|
protected BindingSession |
getSession()
Gets the current session.
|
protected String |
getTemplateLink(String repositoryId,
String type,
Map<String,Object> parameters)
Gets an URI template from the cache.
|
protected TypeDefinition |
getTypeDefinitionInternal(String repositoryId,
String typeId)
Retrieves a type definition.
|
protected String |
getTypeLink(String repositoryId,
String typeId,
String rel)
Gets a type link from the cache.
|
protected String |
getTypeLink(String repositoryId,
String typeId,
String rel,
String type)
Gets a type link from the cache.
|
protected boolean |
is(String name,
AtomElement element) |
protected boolean |
isAclMergeRequired(Acl addAces,
Acl removeAces)
Checks if at least one ACE list is not empty.
|
protected boolean |
isInt(String name,
AtomElement element) |
protected boolean |
isNextLink(AtomElement element) |
protected boolean |
isStr(String name,
AtomElement element) |
protected String |
loadCollection(String repositoryId,
String collection)
Gets a collection from the cache if it is there or loads it into the
cache if it is not there.
|
String |
loadContentLink(String repositoryId,
String id)
Gets the content link from the cache if it is there or loads it into the
cache if it is not there.
|
String |
loadLink(String repositoryId,
String id,
String rel,
String type)
Gets a link from the cache if it is there or loads it into the cache if
it is not there.
|
protected String |
loadRepositoryLink(String repositoryId,
String rel)
Gets a repository link from the cache if it is there or loads it into the
cache if it is not there.
|
protected String |
loadTemplateLink(String repositoryId,
String type,
Map<String,Object> parameters)
Gets a template link from the cache if it is there or loads it into the
cache if it is not there.
|
protected String |
loadTypeLink(String repositoryId,
String typeId,
String rel,
String type)
Gets a link from the cache if it is there or loads it into the cache if
it is not there.
|
protected void |
lockLinks()
Locks the link cache.
|
protected void |
lockTypeLinks()
Locks the type link cache.
|
protected Acl |
mergeAcls(Acl originalAces,
Acl addAces,
Acl removeAces)
Merges the new ACL from original, add and remove ACEs lists.
|
protected <T extends AtomBase> |
parse(InputStream stream,
Class<T> clazz)
Parses an input stream.
|
protected Response |
post(UrlBuilder url,
String contentType,
Output writer)
Performs a POST on an URL, checks the response code and returns the
result.
|
protected Response |
put(UrlBuilder url,
String contentType,
Map<String,String> headers,
Output writer)
Performs a PUT on an URL, checks the response code and returns the
result.
|
protected Response |
put(UrlBuilder url,
String contentType,
Output writer)
Performs a PUT on an URL, checks the response code and returns the
result.
|
protected Response |
read(UrlBuilder url)
Performs a GET on an URL, checks the response code and returns the
result.
|
protected void |
removeLinks(String repositoryId,
String id)
Removes all links of an object.
|
protected void |
removeTypeLinks(String repositoryId,
String id)
Removes all links of a type.
|
protected void |
setSession(BindingSession session)
Sets the current session.
|
protected void |
throwLinkException(String repositoryId,
String id,
String rel,
String type)
Checks a link throw an appropriate exception.
|
protected void |
unlockLinks()
Unlocks the link cache.
|
protected void |
unlockTypeLinks()
Unlocks the type link cache.
|
protected AtomAcl |
updateAcl(String repositoryId,
String objectId,
Acl acl,
AclPropagation aclPropagation)
Updates the ACL of an object.
|
protected static final String NAME_COLLECTION
protected static final String NAME_URI_TEMPLATE
protected static final String NAME_PATH_SEGMENT
protected static final String NAME_RELATIVE_PATH_SEGMENT
protected static final String NAME_NUM_ITEMS
protected void setSession(BindingSession session)
protected BindingSession getSession()
protected HttpInvoker getHttpInvoker()
protected String getServiceDocURL()
protected CmisVersion getCmisVersion(String repositoryId)
protected LinkCache getLinkCache()
protected String getLink(String repositoryId, String id, String rel, String type)
protected String getLink(String repositoryId, String id, String rel)
public String loadLink(String repositoryId, String id, String rel, String type)
loadLink
in interface LinkAccess
public String loadContentLink(String repositoryId, String id)
loadContentLink
in interface LinkAccess
protected void addLink(String repositoryId, String id, String rel, String type, String link)
protected void addLink(String repositoryId, String id, AtomLink link)
protected void removeLinks(String repositoryId, String id)
protected void lockLinks()
protected void unlockLinks()
protected void throwLinkException(String repositoryId, String id, String rel, String type)
protected String getTypeLink(String repositoryId, String typeId, String rel, String type)
protected String getTypeLink(String repositoryId, String typeId, String rel)
protected String loadTypeLink(String repositoryId, String typeId, String rel, String type)
protected void addTypeLink(String repositoryId, String typeId, String rel, String type, String link)
protected void addTypeLink(String repositoryId, String typeId, AtomLink link)
protected void removeTypeLinks(String repositoryId, String id)
protected void lockTypeLinks()
protected void unlockTypeLinks()
protected String getCollection(String repositoryId, String collection)
protected String loadCollection(String repositoryId, String collection)
protected void addCollection(String repositoryId, String collection, String link)
protected String getRepositoryLink(String repositoryId, String rel)
protected String loadRepositoryLink(String repositoryId, String rel)
protected void addRepositoryLink(String repositoryId, String rel, String link)
protected void addRepositoryLink(String repositoryId, AtomLink link)
protected String getTemplateLink(String repositoryId, String type, Map<String,Object> parameters)
protected String loadTemplateLink(String repositoryId, String type, Map<String,Object> parameters)
protected void addTemplate(String repositoryId, String type, String link)
protected CmisBaseException convertStatusCode(int code, String message, String errorContent, Throwable t)
protected boolean is(String name, AtomElement element)
protected boolean isStr(String name, AtomElement element)
protected boolean isInt(String name, AtomElement element)
protected boolean isNextLink(AtomElement element)
protected ObjectDataImpl createObject(Properties properties, String changeToken, List<String> policies)
protected ObjectData createIdObject(String objectId)
protected <T extends AtomBase> T parse(InputStream stream, Class<T> clazz)
protected Response read(UrlBuilder url)
protected Response post(UrlBuilder url, String contentType, Output writer)
protected Response put(UrlBuilder url, String contentType, Output writer)
protected Response put(UrlBuilder url, String contentType, Map<String,String> headers, Output writer)
protected void delete(UrlBuilder url)
protected boolean isAclMergeRequired(Acl addAces, Acl removeAces)
protected Acl mergeAcls(Acl originalAces, Acl addAces, Acl removeAces)
protected List<RepositoryInfo> getRepositoriesInternal(String repositoryId)
protected ObjectData getObjectInternal(String repositoryId, AbstractAtomPubService.IdentifierType idOrPath, String objectIdOrPath, ReturnVersion returnVersion, String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds, Boolean includeAcl, ExtensionsData extension)
protected TypeDefinition getTypeDefinitionInternal(String repositoryId, String typeId)
public Acl getAclInternal(String repositoryId, String objectId, Boolean onlyBasicPermissions, ExtensionsData extension)
protected AtomAcl updateAcl(String repositoryId, String objectId, Acl acl, AclPropagation aclPropagation)
Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.