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
-
Fields inherited from interface org.bsc.confluence.ConfluenceService
connectTimeoutInSeconds, readTimeoutInSeconds, writeTimeoutInSeconds
-
-
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, buildUrl, childrenPages, createPage, deletePageById, descendantPages, findPage, findPageById, findPages, 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
-
fromRequest
protected void fromRequest(HttpRequest.Builder reqBuilder, String description, Consumer<HttpResponse<String>> consumer)
- Overrides:
fromRequestin classAbstractRESTConfluenceService
-
fromRequestAsync
public CompletableFuture<HttpResponse<String>> fromRequestAsync(HttpRequest.Builder reqBuilder)
- Overrides:
fromRequestAsyncin classAbstractRESTConfluenceService- Returns:
-
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 URI urlBuilder() throws URISyntaxException
- Specified by:
urlBuilderin classAbstractRESTConfluenceService- Returns:
- Throws:
URISyntaxException
-
getCredentials
public ConfluenceService.Credentials getCredentials()
- Specified by:
getCredentialsin interfaceConfluenceService- Specified by:
getCredentialsin classAbstractRESTConfluenceService
-
newPage
public ConfluenceService.Model.Page newPage(ConfluenceService.Model.ID id, String space, String title, int version)
- Specified by:
newPagein interfaceConfluenceService
-
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
-
newAttachment
public ConfluenceService.Model.Attachment newAttachment()
- Specified by:
newAttachmentin interfaceConfluenceService
-
getAttachment
public CompletableFuture<Optional<ConfluenceService.Model.Attachment>> getAttachment(ConfluenceService.Model.ID 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
-
createBlogpost
public ConfluenceService.Model.Blogpost createBlogpost(String space, String title, ConfluenceService.Storage content, int version)
- Specified by:
createBlogpostin interfaceConfluenceService
-
addBlogpost
public CompletableFuture<ConfluenceService.Model.Blogpost> addBlogpost(ConfluenceService.Model.Blogpost blogpost)
- Specified by:
addBlogpostin interfaceConfluenceService
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-