Package org.bsc.confluence.rest
Class RESTConfluenceService
- java.lang.Object
-
- org.bsc.confluence.rest.AbstractRESTConfluenceService
-
- org.bsc.confluence.rest.RESTConfluenceService
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ConfluenceService,IdHelper
public class RESTConfluenceService extends AbstractRESTConfluenceService implements ConfluenceService
- Author:
- bosrrentino
- See Also:
- "https://docs.atlassian.com/confluence/REST/latest/"
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRESTConfluenceService.ContentType-
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
-
-
Field Summary
-
Fields inherited from class org.bsc.confluence.rest.AbstractRESTConfluenceService
client
-
-
Constructor Summary
Constructors Constructor Description RESTConfluenceService(String url, ConfluenceService.Credentials credentials, SSLCertificateInfo sslInfo)
-
Method Summary
-
Methods inherited from class org.bsc.confluence.rest.AbstractRESTConfluenceService
addAttachment, addLabels, childrenPages, createPage, debugBody, deletePageById, descendantPages, findPage, findPageById, findPages, fromRequest, fromRequestAsync, fromUrlDELETE, fromUrlGET, fromUrlPOST, fromUrlPUT, getAttachment, getAttachments, mapToObject, mapToStream, 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
addLabelsByName, getOrCreatePage, retry
-
-
-
-
Constructor Detail
-
RESTConfluenceService
public RESTConfluenceService(String url, ConfluenceService.Credentials credentials, SSLCertificateInfo sslInfo)
- Parameters:
url-credentials-sslInfo-
-
-
Method Detail
-
jsonForCreatingContent
public final javax.json.JsonObjectBuilder jsonForCreatingContent(RESTConfluenceService.ContentType type, String spaceKey, String title, ConfluenceService.Storage content)
-
jsonForCreatingContent
public final javax.json.JsonObjectBuilder jsonForCreatingContent(RESTConfluenceService.ContentType type, String spaceKey, long parentPageId, String title, ConfluenceService.Storage content)
-
jsonAddBody
public final javax.json.JsonObjectBuilder jsonAddBody(javax.json.JsonObjectBuilder builder, ConfluenceService.Storage storage)
-
createPageByTitle
public final CompletableFuture<ConfluenceService.Model.Page> createPageByTitle(String spaceKey, String title, ConfluenceService.Storage content)
- Parameters:
spaceKey-title-- Returns:
-
urlBuilder
protected okhttp3.HttpUrl.Builder urlBuilder()
- Specified by:
urlBuilderin classAbstractRESTConfluenceService- Returns:
-
getCredentials
public ConfluenceService.Credentials getCredentials()
- Specified by:
getCredentialsin interfaceConfluenceService- Specified by:
getCredentialsin classAbstractRESTConfluenceService
-
getPageByTitle
public CompletableFuture<Optional<? extends ConfluenceService.Model.PageSummary>> getPageByTitle(ConfluenceService.Model.ID parentPageId, String title)
- Specified by:
getPageByTitlein interfaceConfluenceService
-
getPage
public CompletableFuture<Optional<ConfluenceService.Model.Page>> getPage(ConfluenceService.Model.ID 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 CompletableFuture<List<ConfluenceService.Model.PageSummary>> getDescendents(ConfluenceService.Model.ID pageId)
- Specified by:
getDescendentsin interfaceConfluenceService
-
createPage
public CompletableFuture<ConfluenceService.Model.Page> createPage(ConfluenceService.Model.Page parentPage, String title, ConfluenceService.Storage content)
- Specified by:
createPagein interfaceConfluenceService
-
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
-
removePage
public CompletableFuture<Boolean> removePage(ConfluenceService.Model.Page parentPage, String title)
- Specified by:
removePagein interfaceConfluenceService
-
removePage
public CompletableFuture<Boolean> removePage(ConfluenceService.Model.ID pageId)
- Specified by:
removePagein interfaceConfluenceService
-
addLabelsByName
public CompletableFuture<Void> addLabelsByName(ConfluenceService.Model.ID id, String[] labels)
- Specified by:
addLabelsByNamein interfaceConfluenceService
-
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(ConfluenceService.Model.ID pageId, String name, String version)
- Specified by:
getAttachmentin interfaceConfluenceService- Returns:
-
addAttachment
public CompletableFuture<ConfluenceService.Model.Attachment> addAttachment(ConfluenceService.Model.Page page, ConfluenceService.Model.Attachment attachment, InputStream source)
- Specified by:
addAttachmentin interfaceConfluenceService- Returns:
-
createBlogpost
public ConfluenceService.Model.Blogpost createBlogpost(String space, String title, ConfluenceService.Storage content, int version)
Description copied from interface:ConfluenceServicefactory method- Specified by:
createBlogpostin interfaceConfluenceService- Parameters:
space- space idtitle- post's titlecontent- post's content- Returns:
-
addBlogpost
public CompletableFuture<ConfluenceService.Model.Blogpost> addBlogpost(ConfluenceService.Model.Blogpost blogpost)
- Specified by:
addBlogpostin interfaceConfluenceService- Returns:
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-