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

java.lang.Object
  extended by com.atlassian.confluence.rest.client.AbstractRemoteService<T>
Type Parameters:
T - - the interface of the local service that this is a remote service of, used by RemoteServiceProxyCreator
Direct Known Subclasses:
RemoteContentBodyConversionServiceImpl, RemoteContentLabelServiceImpl, RemoteContentServiceImpl, RemoteSpaceServiceImpl

public abstract class AbstractRemoteService<T>
extends java.lang.Object

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


Constructor Summary
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 addPageRequestParams(com.sun.jersey.api.client.WebResource resource, PageRequest request)
          Adds start and limit query params to honour the pageRequest values
protected  java.util.concurrent.Future<java.lang.Void> deleteFuture(com.sun.jersey.api.client.WebResource resource)
           
protected
<E> com.atlassian.util.concurrent.Promise<? extends java.lang.Iterable<E>>
getFutureGenericCollection(com.sun.jersey.api.client.WebResource resource, java.lang.Class<? extends java.lang.Iterable> collectionType, java.lang.Class<E> contentType)
           
protected
<T> java.util.concurrent.Future<com.atlassian.fugue.Option<T>>
getFutureOption(com.sun.jersey.api.client.WebResource resource, java.lang.Class<? extends T> entityClass)
           
protected
<E> com.atlassian.util.concurrent.Promise<PageResponse<E>>
getFuturePageResponseList(com.sun.jersey.api.client.WebResource resource, java.lang.Class<E> contentClass)
           
protected  com.sun.jersey.api.client.WebResource newRestWebResource()
           
protected
<E> java.util.concurrent.Future<E>
postFuture(com.sun.jersey.api.client.WebResource resource, java.lang.Class<? extends E> entityClass, java.lang.Object postEntity)
           
protected
<E> com.atlassian.util.concurrent.Promise<E>
postFuture(com.sun.jersey.api.client.WebResource resource, java.lang.Class<E> collectionClass, java.lang.Class contentType, java.lang.Object postEntity)
           
protected
<T> java.util.concurrent.Future<T>
putFuture(com.sun.jersey.api.client.WebResource resource, java.lang.Class<? extends T> entityClass, java.lang.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)
Method Detail

newRestWebResource

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

getFutureOption

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

getFuturePageResponseList

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

getFutureGenericCollection

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

postFuture

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

postFuture

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

putFuture

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

deleteFuture

protected java.util.concurrent.Future<java.lang.Void> deleteFuture(com.sun.jersey.api.client.WebResource resource)

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,
                                                                     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


Copyright © 2003-2014 Atlassian. All Rights Reserved.