com.atlassian.confluence.rest.client
Class RemoteContentServiceImpl

java.lang.Object
  extended by com.atlassian.confluence.rest.client.AbstractRemoteService<ContentService>
      extended by com.atlassian.confluence.rest.client.RemoteContentServiceImpl
All Implemented Interfaces:
RemoteContentService

public class RemoteContentServiceImpl
extends AbstractRemoteService<ContentService>
implements RemoteContentService

ContentService implementation that communicates with Confluence remotely.


Constructor Summary
RemoteContentServiceImpl(AuthenticatedWebResourceProvider provider, com.google.common.util.concurrent.ListeningExecutorService executor)
           
 
Method Summary
 java.util.concurrent.Future<Content> create(Content newContent)
          Create a piece of content.
 java.util.concurrent.Future<java.lang.Void> delete(Content content)
          Removes an item of Content from the system.
 java.util.concurrent.Future<com.atlassian.fugue.Option<Content>> find(ContentLocator locator, Expansion... expansions)
          Retrieve a piece of content by some more complex criteria (defined by the ContentLocator).
 java.util.concurrent.Future<com.atlassian.fugue.Option<Content>> findById(java.lang.String contentId, Expansion... expansions)
          Retrieve a piece of content by its id.
 java.util.concurrent.Future<com.atlassian.fugue.Option<Macro>> findMacroByHash(java.lang.String contentId, java.lang.String versionId, java.lang.String hash, Expansion... expansions)
          Retrieve details about a macro matching the page, version and macro hash.
 java.util.concurrent.Future<Content> update(Content content)
          Updates a piece of content.
 
Methods inherited from class com.atlassian.confluence.rest.client.AbstractRemoteService
addExpansions, addPageRequestParams, deleteFuture, getFutureGenericCollection, getFutureOption, getFuturePageResponseList, newRestWebResource, postFuture, postFuture, putFuture
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteContentServiceImpl

public RemoteContentServiceImpl(AuthenticatedWebResourceProvider provider,
                                com.google.common.util.concurrent.ListeningExecutorService executor)
Method Detail

findById

public java.util.concurrent.Future<com.atlassian.fugue.Option<Content>> findById(java.lang.String contentId,
                                                                                 Expansion... expansions)
Description copied from interface: RemoteContentService
Retrieve a piece of content by its id.

Specified by:
findById in interface RemoteContentService
Parameters:
contentId - the id of the content you are looking for
Returns:
the content, if one exists matching the id, or none otherwise.

findMacroByHash

public java.util.concurrent.Future<com.atlassian.fugue.Option<Macro>> findMacroByHash(java.lang.String contentId,
                                                                                      java.lang.String versionId,
                                                                                      java.lang.String hash,
                                                                                      Expansion... expansions)
                                                                               throws ServiceException
Description copied from interface: RemoteContentService
Retrieve details about a macro matching the page, version and macro hash.

Specified by:
findMacroByHash in interface RemoteContentService
Parameters:
contentId - The content to scan for the macro
versionId - The version of the page to scan for the macro
hash - The hash identifying the body of the macro
Returns:
Optionally return a Macro matching the given criteria
Throws:
ServiceException

find

public java.util.concurrent.Future<com.atlassian.fugue.Option<Content>> find(ContentLocator locator,
                                                                             Expansion... expansions)
Description copied from interface: RemoteContentService
Retrieve a piece of content by some more complex criteria (defined by the ContentLocator).

Specified by:
find in interface RemoteContentService
Parameters:
locator - the locator containing the criteria for the content you are looking for
Returns:
the content, if one exists matching the criteria, or none otherwise.

create

public java.util.concurrent.Future<Content> create(Content newContent)
                                            throws ServiceException
Description copied from interface: RemoteContentService
Create a piece of content.

Valid ContentRepresentations for the ContentBody can be found in the documentation on the ContentBodyConversionService.

Specified by:
create in interface RemoteContentService
Parameters:
newContent - the content to create
Returns:
the content created
Throws:
ServiceException - if the content cannot be created

update

public java.util.concurrent.Future<Content> update(Content content)
                                            throws ServiceException
Description copied from interface: RemoteContentService
Updates a piece of content.

Valid ContentRepresentations for the ContentBody can be found in the documentation on the ContentBodyConversionService.

Specified by:
update in interface RemoteContentService
Parameters:
content - the updated Content with metadata about the change
Returns:
the updated content after being persisted
Throws:
ServiceException

delete

public java.util.concurrent.Future<java.lang.Void> delete(Content content)
                                                   throws ServiceException
Description copied from interface: RemoteContentService
Removes an item of Content from the system.

Specified by:
delete in interface RemoteContentService
Parameters:
content - if of the content to remove
Throws:
ServiceException - if the content cannot be found, or cannot be deleted


Copyright © 2003-2014 Atlassian. All Rights Reserved.