Class RemoteRelationServiceImpl
java.lang.Object
com.atlassian.confluence.rest.client.AbstractRemoteService<RelationService>
com.atlassian.confluence.rest.client.impl.RemoteRelationServiceImpl
- All Implemented Interfaces:
RemoteRelationService
public class RemoteRelationServiceImpl
extends AbstractRemoteService<RelationService>
implements RemoteRelationService
RelationService
implementation that communicates with Confluence remotely using the Confluence REST API.-
Field Summary
Fields inherited from class com.atlassian.confluence.rest.client.AbstractRemoteService
provider
-
Constructor Summary
ConstructorsConstructorDescriptionRemoteRelationServiceImpl
(AuthenticatedWebResourceProvider provider, ExecutorService executor) -
Method Summary
Modifier and TypeMethodDescription<S extends Relatable,
T extends Relatable>
CompletionStage<Void>createCompletionStage
(RelationInstance<S, T> relationInstance) Creates a directed relation between two relatable entities.<S extends Relatable,
T extends Relatable>
CompletionStage<Void>deleteCompletionStage
(RelationInstance<S, T> relationInstance) Remove a relation if it exists between a source and a target relatable entity<S extends Relatable,
T extends Relatable>
CompletionStage<Boolean>isRelatedCompletionStage
(S source, RelationDescriptor<S, T> relationDescriptor, T target) Determine whether a given source and target are related by the given relationMethods inherited from class com.atlassian.confluence.rest.client.AbstractRemoteService
addExpansions, addPageRequest, addPageRequestParams, deleteCompletionStage, deleteCompletionStage, getCompletionStage, getCompletionStageGenericCollection, getCompletionStageMap, getCompletionStageMapOfGenericListResponse, getCompletionStageMapOfPageResponses, getCompletionStageOptional, getCompletionStagePageResponseList, getCompletionStageSearchPageResponseList, getExecutor, newExperimentalRestWebTarget, newWebTarget, postCompletionStage, postCompletionStage, postCompletionStage, postCompletionStageToPageResponse, postVoidCompletionStage, putCompletionStage, putVoidCompletionStage
-
Constructor Details
-
RemoteRelationServiceImpl
public RemoteRelationServiceImpl(AuthenticatedWebResourceProvider provider, ExecutorService executor) - Since:
- 9.0
-
-
Method Details
-
createCompletionStage
public <S extends Relatable,T extends Relatable> CompletionStage<Void> createCompletionStage(RelationInstance<S, T> relationInstance) throws ServiceExceptionDescription copied from interface:RemoteRelationService
Creates a directed relation between two relatable entities.For example, when a user favourites a space a SpaceFavouriteRelation is created from the user to the space:
relationService.create(RelationInstance.builder(user, new SpaceFavouriteRelation(), space).build))
;- Specified by:
createCompletionStage
in interfaceRemoteRelationService
- Type Parameters:
S
- type of the source entityT
- type of the target entity- Parameters:
relationInstance
- the relation to create- Returns:
- the newly created relationInstance
- Throws:
ServiceException
- if validation fails
-
deleteCompletionStage
public <S extends Relatable,T extends Relatable> CompletionStage<Void> deleteCompletionStage(RelationInstance<S, T> relationInstance) throws ServiceExceptionDescription copied from interface:RemoteRelationService
Remove a relation if it exists between a source and a target relatable entity- Specified by:
deleteCompletionStage
in interfaceRemoteRelationService
- Type Parameters:
S
- type of the source entityT
- type of the target entity- Parameters:
relationInstance
- relation to be deleted- Throws:
ServiceException
- if validation fails
-
isRelatedCompletionStage
public <S extends Relatable,T extends Relatable> CompletionStage<Boolean> isRelatedCompletionStage(S source, RelationDescriptor<S, T> relationDescriptor, T target) Description copied from interface:RemoteRelationService
Determine whether a given source and target are related by the given relation- Specified by:
isRelatedCompletionStage
in interfaceRemoteRelationService
- Type Parameters:
S
- type of the source entityT
- type of the target entity- Returns:
- true if the relation exists between the given source and target
-