com.atlassian.confluence.rest.client
Class AbstractRemoteService<P>

java.lang.Object
  extended by com.atlassian.confluence.rest.client.AbstractRemoteService<P>
Type Parameters:
P - - the interface of the local service that this is a remote service of, used by RemoteServiceProxyCreator
Direct Known Subclasses:
RemoteAttachmentServiceImpl, RemoteAttachmentServiceImpl.RemoteAttachmentFinderImpl, RemoteChildContentServiceImpl, RemoteChildContentServiceImpl.RemoteChildContentFinderImpl, RemoteContentBodyConversionServiceImpl, RemoteContentLabelServiceImpl, RemoteContentMacroServiceImpl, RemoteContentMacroServiceImpl.RemoteMacroFinderImpl, RemoteContentPropertyServiceImpl, RemoteContentPropertyServiceImpl.RemoteContentPropertyFinderImpl, RemoteContentRestrictionServiceImpl, RemoteContentServiceImpl, RemoteContentServiceImpl.RemoteContentFinderImpl, RemoteContentTrashServiceImpl, RemoteCQLSearchServiceImpl, RemoteLongTaskServiceImpl, RemoteSpaceServiceImpl, RemoteSpaceServiceImpl.RemoteSpaceContentFinderImpl, RemoteSpaceServiceImpl.RemoteSpaceFinderImpl

public abstract class AbstractRemoteService<P>
extends Object

Common parent class of all Confluence API Remote Service implementations, handling authentication and REST infrastructure.


Constructor Summary
protected AbstractRemoteService(AbstractRemoteService other)
           
protected AbstractRemoteService(AuthenticatedWebResourceProvider provider, com.google.common.util.concurrent.ListeningExecutorService executor)
           
 
Method Summary
protected  com.sun.jersey.api.client.WebResource addExpansions(com.sun.jersey.api.client.WebResource resource, Expansion[] expansions)
          add the expansions to the WebResource as a query param, this specifies which properties on the results to expand
protected  com.sun.jersey.api.client.WebResource addPageRequest(com.sun.jersey.api.client.WebResource resource, PageRequest pageRequest)
           
protected  com.sun.jersey.api.client.WebResource addPageRequestParams(com.sun.jersey.api.client.WebResource resource, PageRequest request)
          Adds start and limit query params to honour the pageRequest values
protected  com.atlassian.util.concurrent.Promise<Void> deleteFuture(com.sun.jersey.api.client.WebResource resource)
           
protected
<T> com.atlassian.util.concurrent.Promise<T>
deleteFuture(com.sun.jersey.api.client.WebResource resource, Class<? extends T> responseClass)
           
protected
<T> com.atlassian.util.concurrent.Promise<T>
getFuture(com.sun.jersey.api.client.WebResource resource, Class<? extends T> entityClass)
           
protected
<E> com.atlassian.util.concurrent.Promise<? extends Iterable<E>>
getFutureGenericCollection(com.sun.jersey.api.client.WebResource resource, Class<? extends Iterable> collectionType, Class<E> contentType)
           
protected
<K,V> com.atlassian.util.concurrent.Promise<Map<K,V>>
getFutureMap(com.sun.jersey.api.client.WebResource resource, Class<K> keyClass, Class<V> valueClass)
           
protected
<K,V> com.atlassian.util.concurrent.Promise<Map<K,PageResponse<V>>>
getFutureMapOfPageResponses(com.sun.jersey.api.client.WebResource resource, Class<K> keyClass, Class<V> listContentClass)
           
protected
<T> com.atlassian.util.concurrent.Promise<com.atlassian.fugue.Option<T>>
getFutureOption(com.sun.jersey.api.client.WebResource resource, Class<? extends T> entityClass)
           
protected
<E> com.atlassian.util.concurrent.Promise<PageResponse<E>>
getFuturePageResponseList(com.sun.jersey.api.client.WebResource resource, Class<E> contentClass)
           
protected  com.sun.jersey.api.client.WebResource newExperimentalRestWebResource()
           
protected  com.sun.jersey.api.client.WebResource newRestWebResource()
           
protected
<E> com.atlassian.util.concurrent.Promise<E>
postFuture(com.sun.jersey.api.client.WebResource resource, Class<? extends E> entityClass, Object postEntity)
           
protected
<E> com.atlassian.util.concurrent.Promise<E>
postFuture(com.sun.jersey.api.client.WebResource resource, Class<? extends E> entityClass, Object postEntity, javax.ws.rs.core.MediaType mediaType)
           
protected
<E> com.atlassian.util.concurrent.Promise<E>
postFuture(com.sun.jersey.api.client.WebResource resource, Class<E> collectionClass, Class contentType, Object postEntity)
           
protected
<T> com.atlassian.util.concurrent.Promise<PageResponse<T>>
postFutureToPageResponse(com.sun.jersey.api.client.WebResource resource, Class<T> entityClass, Object postEntity, javax.ws.rs.core.MediaType mediaType)
           
protected
<T> com.atlassian.util.concurrent.Promise<T>
putFuture(com.sun.jersey.api.client.WebResource resource, Class<? extends T> entityClass, Object putEntity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRemoteService

protected AbstractRemoteService(AuthenticatedWebResourceProvider provider,
                                com.google.common.util.concurrent.ListeningExecutorService executor)

AbstractRemoteService

protected AbstractRemoteService(AbstractRemoteService other)
Method Detail

newRestWebResource

protected com.sun.jersey.api.client.WebResource newRestWebResource()

newExperimentalRestWebResource

protected com.sun.jersey.api.client.WebResource newExperimentalRestWebResource()

getFuture

protected <T> com.atlassian.util.concurrent.Promise<T> getFuture(com.sun.jersey.api.client.WebResource resource,
                                                                 Class<? extends T> entityClass)

getFutureOption

protected <T> com.atlassian.util.concurrent.Promise<com.atlassian.fugue.Option<T>> getFutureOption(com.sun.jersey.api.client.WebResource resource,
                                                                                                   Class<? extends T> entityClass)

getFuturePageResponseList

protected <E> com.atlassian.util.concurrent.Promise<PageResponse<E>> getFuturePageResponseList(com.sun.jersey.api.client.WebResource resource,
                                                                                               Class<E> contentClass)

getFutureMapOfPageResponses

protected <K,V> com.atlassian.util.concurrent.Promise<Map<K,PageResponse<V>>> getFutureMapOfPageResponses(com.sun.jersey.api.client.WebResource resource,
                                                                                                          Class<K> keyClass,
                                                                                                          Class<V> listContentClass)

getFutureMap

protected <K,V> com.atlassian.util.concurrent.Promise<Map<K,V>> getFutureMap(com.sun.jersey.api.client.WebResource resource,
                                                                             Class<K> keyClass,
                                                                             Class<V> valueClass)

getFutureGenericCollection

protected <E> com.atlassian.util.concurrent.Promise<? extends Iterable<E>> getFutureGenericCollection(com.sun.jersey.api.client.WebResource resource,
                                                                                                      Class<? extends Iterable> collectionType,
                                                                                                      Class<E> contentType)

postFuture

protected <E> com.atlassian.util.concurrent.Promise<E> postFuture(com.sun.jersey.api.client.WebResource resource,
                                                                  Class<? extends E> entityClass,
                                                                  Object postEntity)

postFuture

protected <E> com.atlassian.util.concurrent.Promise<E> postFuture(com.sun.jersey.api.client.WebResource resource,
                                                                  Class<? extends E> entityClass,
                                                                  Object postEntity,
                                                                  javax.ws.rs.core.MediaType mediaType)

postFuture

protected <E> com.atlassian.util.concurrent.Promise<E> postFuture(com.sun.jersey.api.client.WebResource resource,
                                                                  Class<E> collectionClass,
                                                                  Class contentType,
                                                                  Object postEntity)

postFutureToPageResponse

protected <T> com.atlassian.util.concurrent.Promise<PageResponse<T>> postFutureToPageResponse(com.sun.jersey.api.client.WebResource resource,
                                                                                              Class<T> entityClass,
                                                                                              Object postEntity,
                                                                                              javax.ws.rs.core.MediaType mediaType)

putFuture

protected <T> com.atlassian.util.concurrent.Promise<T> putFuture(com.sun.jersey.api.client.WebResource resource,
                                                                 Class<? extends T> entityClass,
                                                                 Object putEntity)

deleteFuture

protected com.atlassian.util.concurrent.Promise<Void> deleteFuture(com.sun.jersey.api.client.WebResource resource)

deleteFuture

protected <T> com.atlassian.util.concurrent.Promise<T> deleteFuture(com.sun.jersey.api.client.WebResource resource,
                                                                    Class<? extends T> responseClass)

addExpansions

protected com.sun.jersey.api.client.WebResource addExpansions(com.sun.jersey.api.client.WebResource resource,
                                                              Expansion[] expansions)
add the expansions to the WebResource as a query param, this specifies which properties on the results to expand

Parameters:
resource - - the WebResource to add the query param to, a copy of this resource will be returned
expansions - - the expansions to add
Returns:
a new WebResource with the expansions added to it

addPageRequestParams

protected com.sun.jersey.api.client.WebResource addPageRequestParams(com.sun.jersey.api.client.WebResource resource,
                                                                     @Nullable
                                                                     PageRequest request)
Adds start and limit query params to honour the pageRequest values

Parameters:
resource - - the resource to add the query params to
request - - the pageRequest supplying the values for the query params, may be null

addPageRequest

protected com.sun.jersey.api.client.WebResource addPageRequest(com.sun.jersey.api.client.WebResource resource,
                                                               PageRequest pageRequest)


Copyright © 2003–2015 Atlassian. All rights reserved.