Package org.bsc.confluence.rest
Class AbstractRESTConfluenceService
- java.lang.Object
-
- org.bsc.confluence.rest.AbstractRESTConfluenceService
-
- All Implemented Interfaces:
IdHelper
- Direct Known Subclasses:
RESTConfluenceService
public abstract class AbstractRESTConfluenceService extends Object implements IdHelper
- Author:
- softphone
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractRESTConfluenceService.ServiceException
-
Field Summary
Fields Modifier and Type Field Description protected okhttp3.OkHttpClient.Builderclient
-
Constructor Summary
Constructors Constructor Description AbstractRESTConfluenceService()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected CompletableFuture<List<javax.json.JsonObject>>addAttachment(String id, Attachment att, InputStream data)protected CompletableFuture<Void>addLabels(String id, String... labels)protected CompletableFuture<List<javax.json.JsonObject>>childrenPages(String id)CompletableFuture<Optional<javax.json.JsonObject>>createPage(javax.json.JsonObject inputData)protected voiddebugBody(okhttp3.Response res)protected CompletableFuture<Boolean>deletePageById(String id)protected CompletableFuture<List<javax.json.JsonObject>>descendantPages(long id)CompletableFuture<Optional<javax.json.JsonObject>>findPage(String spaceKey, String title)protected CompletableFuture<Optional<javax.json.JsonObject>>findPageById(String id)protected CompletableFuture<List<javax.json.JsonObject>>findPages(String spaceKey, String title)voidfromRequest(okhttp3.Request req, String description, java.util.function.Consumer<okhttp3.Response> consumer)CompletableFuture<okhttp3.Response>fromRequestAsync(okhttp3.Request req)protected voidfromUrlDELETE(okhttp3.HttpUrl url, String description, java.util.function.Consumer<okhttp3.Response> consumer)protected voidfromUrlGET(okhttp3.HttpUrl url, String description, java.util.function.Consumer<okhttp3.Response> consumer)protected voidfromUrlPOST(okhttp3.HttpUrl url, okhttp3.RequestBody inputBody, String description, java.util.function.Consumer<okhttp3.Response> consumer)protected voidfromUrlPUT(okhttp3.HttpUrl url, okhttp3.RequestBody inputBody, String description, java.util.function.Consumer<okhttp3.Response> consumer)protected CompletableFuture<List<javax.json.JsonObject>>getAttachment(String id, String fileName)protected CompletableFuture<List<javax.json.JsonObject>>getAttachments(String id)abstract ConfluenceService.CredentialsgetCredentials()protected javax.json.JsonObjectmapToObject(okhttp3.Response res)protected java.util.stream.Stream<javax.json.JsonObject>mapToStream(okhttp3.Response res)protected CompletableFuture<Optional<javax.json.JsonObject>>updatePage(String pageId, javax.json.JsonObject inputData)protected abstract okhttp3.HttpUrl.BuilderurlBuilder()
-
-
-
Method Detail
-
getCredentials
public abstract ConfluenceService.Credentials getCredentials()
-
urlBuilder
protected abstract okhttp3.HttpUrl.Builder urlBuilder()
-
fromRequestAsync
public CompletableFuture<okhttp3.Response> fromRequestAsync(okhttp3.Request req)
- Parameters:
req-- Returns:
-
fromRequest
public void fromRequest(okhttp3.Request req, String description, java.util.function.Consumer<okhttp3.Response> consumer)
-
fromUrlGET
protected void fromUrlGET(okhttp3.HttpUrl url, String description, java.util.function.Consumer<okhttp3.Response> consumer)
-
fromUrlDELETE
protected void fromUrlDELETE(okhttp3.HttpUrl url, String description, java.util.function.Consumer<okhttp3.Response> consumer)
-
fromUrlPOST
protected void fromUrlPOST(okhttp3.HttpUrl url, okhttp3.RequestBody inputBody, String description, java.util.function.Consumer<okhttp3.Response> consumer)
-
fromUrlPUT
protected void fromUrlPUT(okhttp3.HttpUrl url, okhttp3.RequestBody inputBody, String description, java.util.function.Consumer<okhttp3.Response> consumer)
-
debugBody
protected void debugBody(okhttp3.Response res)
-
mapToStream
protected java.util.stream.Stream<javax.json.JsonObject> mapToStream(okhttp3.Response res)
-
mapToObject
protected javax.json.JsonObject mapToObject(okhttp3.Response res)
-
findPageById
protected CompletableFuture<Optional<javax.json.JsonObject>> findPageById(String id)
-
findPages
protected CompletableFuture<List<javax.json.JsonObject>> findPages(String spaceKey, String title)
-
descendantPages
protected CompletableFuture<List<javax.json.JsonObject>> descendantPages(long id)
-
childrenPages
protected CompletableFuture<List<javax.json.JsonObject>> childrenPages(String id)
-
findPage
public CompletableFuture<Optional<javax.json.JsonObject>> findPage(String spaceKey, String title)
- Parameters:
spaceKey-title-- Returns:
-
deletePageById
protected CompletableFuture<Boolean> deletePageById(String id)
-
createPage
public final CompletableFuture<Optional<javax.json.JsonObject>> createPage(javax.json.JsonObject inputData)
- Parameters:
inputData-- Returns:
-
updatePage
protected CompletableFuture<Optional<javax.json.JsonObject>> updatePage(String pageId, javax.json.JsonObject inputData)
-
addLabels
protected final CompletableFuture<Void> addLabels(String id, String... labels)
- Parameters:
id-labels-
-
getAttachments
protected CompletableFuture<List<javax.json.JsonObject>> getAttachments(String id)
-
getAttachment
protected CompletableFuture<List<javax.json.JsonObject>> getAttachment(String id, String fileName)
-
addAttachment
protected CompletableFuture<List<javax.json.JsonObject>> addAttachment(String id, Attachment att, InputStream data)
-
-