Package org.bsc.confluence.rest
Class RESTConfluenceServiceImpl
- java.lang.Object
-
- org.bsc.confluence.rest.AbstractRESTConfluenceService
-
- org.bsc.confluence.rest.RESTConfluenceServiceImpl
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ConfluenceService
public class RESTConfluenceServiceImpl extends AbstractRESTConfluenceService implements ConfluenceService
- Author:
- bosrrentino
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.bsc.confluence.rest.AbstractRESTConfluenceService
AbstractRESTConfluenceService.ServiceException
-
Nested classes/interfaces inherited from interface org.bsc.confluence.ConfluenceService
ConfluenceService.Credentials, ConfluenceService.Model, ConfluenceService.Protocol, ConfluenceService.Storage
-
-
Constructor Summary
Constructors Constructor Description RESTConfluenceServiceImpl(String url, ConfluenceService.Credentials credentials, SSLCertificateInfo sslInfo)
-
Method Summary
-
Methods inherited from class org.bsc.confluence.rest.AbstractRESTConfluenceService
addAttachment, childrenPages, createPage, debugBody, findPage, findPageById, fromRequest, fromUrlDELETE, fromUrlGET, fromUrlPOST, fromUrlPUT, getAttachment, getAttachments, mapToObject, mapToStream, rxAddLabels, rxDeletePageById, rxDescendantPages, rxfindPages, updatePage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bsc.confluence.ConfluenceService
getOrCreatePage
-
-
-
-
Constructor Detail
-
RESTConfluenceServiceImpl
public RESTConfluenceServiceImpl(String url, ConfluenceService.Credentials credentials, SSLCertificateInfo sslInfo)
- Parameters:
url-credentials-sslInfo-
-
-
Method Detail
-
jsonForCreatingPage
public final javax.json.JsonObjectBuilder jsonForCreatingPage(String spaceKey, String title)
-
jsonForCreatingPage
public final javax.json.JsonObjectBuilder jsonForCreatingPage(String spaceKey, int parentPageId, String title)
-
jsonAddBody
public final javax.json.JsonObjectBuilder jsonAddBody(javax.json.JsonObjectBuilder builder, ConfluenceService.Storage storage)
-
urlBuilder
protected okhttp3.HttpUrl.Builder urlBuilder()
- Specified by:
urlBuilderin classAbstractRESTConfluenceService- Returns:
-
getCredentials
public ConfluenceService.Credentials getCredentials()
- Specified by:
getCredentialsin interfaceConfluenceService- Specified by:
getCredentialsin classAbstractRESTConfluenceService
-
findPageByTitle
public ConfluenceService.Model.PageSummary findPageByTitle(String parentPageId, String title) throws Exception
- Specified by:
findPageByTitlein interfaceConfluenceService- Throws:
Exception
-
createPage
public CompletableFuture<ConfluenceService.Model.Page> createPage(ConfluenceService.Model.Page parentPage, String title)
- Specified by:
createPagein interfaceConfluenceService
-
getPage
public CompletableFuture<Optional<ConfluenceService.Model.Page>> getPage(String pageId)
- Specified by:
getPagein interfaceConfluenceService- Parameters:
pageId-- Returns:
- Throws:
Exception
-
getPage
public CompletableFuture<Optional<ConfluenceService.Model.Page>> getPage(String spaceKey, String pageTitle)
- Specified by:
getPagein interfaceConfluenceService
-
getDescendents
public List<ConfluenceService.Model.PageSummary> getDescendents(String pageId) throws Exception
- Specified by:
getDescendentsin interfaceConfluenceService- Throws:
Exception
-
storePage
public CompletableFuture<ConfluenceService.Model.Page> storePage(ConfluenceService.Model.Page page, ConfluenceService.Storage content)
- Specified by:
storePagein interfaceConfluenceService
-
storePage
public CompletableFuture<ConfluenceService.Model.Page> storePage(ConfluenceService.Model.Page page)
- Specified by:
storePagein interfaceConfluenceService
-
addLabelByName
public boolean addLabelByName(String label, long id) throws Exception
- Specified by:
addLabelByNamein interfaceConfluenceService- Throws:
Exception
-
exportPage
public void exportPage(String url, String spaceKey, String pageTitle, ExportFormat exfmt, File outputFile) throws Exception
- Specified by:
exportPagein interfaceConfluenceService- Throws:
Exception
-
createAttachment
public ConfluenceService.Model.Attachment createAttachment()
Description copied from interface:ConfluenceServicefactory method- Specified by:
createAttachmentin interfaceConfluenceService- Returns:
-
getAttachment
public CompletableFuture<Optional<ConfluenceService.Model.Attachment>> getAttachment(String pageId, String name, String version)
- Specified by:
getAttachmentin interfaceConfluenceService
-
addAttachment
public CompletableFuture<ConfluenceService.Model.Attachment> addAttachment(ConfluenceService.Model.Page page, ConfluenceService.Model.Attachment attachment, InputStream source)
- Specified by:
addAttachmentin interfaceConfluenceService
-
removePage
public CompletableFuture<Boolean> removePage(ConfluenceService.Model.Page parentPage, String title)
- Specified by:
removePagein interfaceConfluenceService
-
removePage
public void removePage(String pageId) throws Exception
- Specified by:
removePagein interfaceConfluenceService- Throws:
Exception
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-