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
Constructors Constructor Description RemoteRelationServiceImpl(AuthenticatedWebResourceProvider provider, com.google.common.util.concurrent.ListeningExecutorService executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <S extends Relatable,T extends Relatable>
com.atlassian.util.concurrent.Promise<Void>create(RelationInstance<S,T> relationInstance)
Deprecated.since 7.0.1.<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>
com.atlassian.util.concurrent.Promise<Void>delete(RelationInstance<S,T> relationInstance)
Deprecated.since 7.0.1.<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>
com.atlassian.util.concurrent.Promise<Boolean>isRelated(S source, RelationDescriptor<S,T> relationDescriptor, T target)
Deprecated.since 7.0.1.<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 relation-
Methods inherited from class com.atlassian.confluence.rest.client.AbstractRemoteService
addExpansions, addPageRequest, addPageRequestParams, deleteCompletionStage, deleteCompletionStage, deleteFuture, deleteFuture, getCompletionStage, getCompletionStageGenericCollection, getCompletionStageMap, getCompletionStageMapOfPageResponses, getCompletionStageOptional, getCompletionStagePageResponseList, getCompletionStageSearchPageResponseList, getExecutor, getFuture, getFutureGenericCollection, getFutureMap, getFutureMapOfPageResponses, getFutureOption, getFuturePageResponseList, newExperimentalRestWebResource, newRestWebResource, postCompletionStage, postCompletionStage, postCompletionStage, postCompletionStageToPageResponse, postFuture, postFuture, postFuture, postFutureToPageResponse, putCompletionStage, putFuture
-
-
-
-
Constructor Detail
-
RemoteRelationServiceImpl
public RemoteRelationServiceImpl(AuthenticatedWebResourceProvider provider, com.google.common.util.concurrent.ListeningExecutorService executor)
-
-
Method Detail
-
create
@Deprecated public <S extends Relatable,T extends Relatable> com.atlassian.util.concurrent.Promise<Void> create(RelationInstance<S,T> relationInstance) throws ServiceException
Deprecated.since 7.0.1. UsecreateCompletionStage(RelationInstance)
instead.Description 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:
create
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
-
delete
@Deprecated public <S extends Relatable,T extends Relatable> com.atlassian.util.concurrent.Promise<Void> delete(RelationInstance<S,T> relationInstance) throws ServiceException
Deprecated.since 7.0.1. UsedeleteCompletionStage(RelationInstance)
instead.Description copied from interface:RemoteRelationService
Remove a relation if it exists between a source and a target relatable entity- Specified by:
delete
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
-
createCompletionStage
public <S extends Relatable,T extends Relatable> CompletionStage<Void> createCompletionStage(RelationInstance<S,T> relationInstance) throws ServiceException
Description 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 ServiceException
Description 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
-
isRelated
@Deprecated public <S extends Relatable,T extends Relatable> com.atlassian.util.concurrent.Promise<Boolean> isRelated(S source, RelationDescriptor<S,T> relationDescriptor, T target)
Deprecated.since 7.0.1. UseisRelatedCompletionStage(Relatable, RelationDescriptor, Relatable)
instead.Description copied from interface:RemoteRelationService
Determine whether a given source and target are related by the given relation- Specified by:
isRelated
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
-
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
-
-