Class RemoteAccessModeServiceImpl
- java.lang.Object
-
- com.atlassian.confluence.rest.client.AbstractRemoteService<AccessModeService>
-
- com.atlassian.confluence.rest.client.RemoteAccessModeServiceImpl
-
- All Implemented Interfaces:
RemoteAccessModeService
public class RemoteAccessModeServiceImpl extends AbstractRemoteService<AccessModeService> implements RemoteAccessModeService
-
-
Field Summary
-
Fields inherited from class com.atlassian.confluence.rest.client.AbstractRemoteService
provider
-
-
Constructor Summary
Constructors Constructor Description RemoteAccessModeServiceImpl(AuthenticatedWebResourceProvider provider, com.google.common.util.concurrent.ListeningExecutorService executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description com.atlassian.util.concurrent.Promise<AccessMode>
getAccessMode()
Deprecated.since 7.0.1.CompletionStage<AccessMode>
getAccessModeCompletionStage()
com.atlassian.util.concurrent.Promise<Boolean>
isReadOnlyAccessModeEnabled()
'Proxied' method to check if readonly access mode is enabled.CompletionStage<Boolean>
isReadOnlyAccessModeEnabledCompletionStage()
com.atlassian.util.concurrent.Promise<Boolean>
shouldEnforceReadOnlyAccess()
CompletionStage<Boolean>
shouldEnforceReadOnlyAccessCompletionStage()
com.atlassian.util.concurrent.Promise<Void>
updateAccessMode(AccessMode accessMode)
'Proxied' method to update the access mode.CompletionStage<Void>
updateAccessModeCompletionStage(AccessMode accessMode)
<T> com.atlassian.util.concurrent.Promise<T>
withReadOnlyAccessExemption(Callable<T> callable)
Execute a method that needs to be exempt from read-only access check in the permission manager layer.<T> CompletionStage<T>
withReadOnlyAccessExemptionCompletionStage(Callable<T> callable)
Execute a method that needs to be exempt from read-only access check in the permission manager layer.-
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, postVoidCompletionStage, putCompletionStage, putFuture
-
-
-
-
Constructor Detail
-
RemoteAccessModeServiceImpl
public RemoteAccessModeServiceImpl(AuthenticatedWebResourceProvider provider, com.google.common.util.concurrent.ListeningExecutorService executor)
-
-
Method Detail
-
getAccessMode
@Deprecated public com.atlassian.util.concurrent.Promise<AccessMode> getAccessMode()
Deprecated.since 7.0.1. UsegetAccessModeCompletionStage()
instead.- Specified by:
getAccessMode
in interfaceRemoteAccessModeService
-
updateAccessMode
public com.atlassian.util.concurrent.Promise<Void> updateAccessMode(AccessMode accessMode) throws ServiceException
'Proxied' method to update the access mode. Not implemented because updating the access mode is not supported through the REST API endpoint. An endpoint exists at /rest/backdoor/admin/accessmode as implemented in AccessModeResource in confluence-test-plugins but this is for testing purposes. Actual updating of the accessmode status is currently performed through an XWorks action.- Specified by:
updateAccessMode
in interfaceRemoteAccessModeService
- Parameters:
accessMode
- the access Mode to 'set'.- Throws:
ServiceException
- the exception is thrown if the dark feature is not enabled or the access mode cannot be updated.
-
isReadOnlyAccessModeEnabled
public com.atlassian.util.concurrent.Promise<Boolean> isReadOnlyAccessModeEnabled()
'Proxied' method to check if readonly access mode is enabled. Not implemented because this method is functionally equivalent to getAccessMode, which is exposed as a REST API.- Specified by:
isReadOnlyAccessModeEnabled
in interfaceRemoteAccessModeService
- Returns:
-
shouldEnforceReadOnlyAccess
public com.atlassian.util.concurrent.Promise<Boolean> shouldEnforceReadOnlyAccess()
- Specified by:
shouldEnforceReadOnlyAccess
in interfaceRemoteAccessModeService
-
withReadOnlyAccessExemption
public <T> com.atlassian.util.concurrent.Promise<T> withReadOnlyAccessExemption(Callable<T> callable) throws ServiceException
Description copied from interface:RemoteAccessModeService
Execute a method that needs to be exempt from read-only access check in the permission manager layer.- Specified by:
withReadOnlyAccessExemption
in interfaceRemoteAccessModeService
- Type Parameters:
T
- the return type of the method- Parameters:
callable
- the method- Returns:
- the value returned by the callable method
- Throws:
ServiceException
-
getAccessModeCompletionStage
public CompletionStage<AccessMode> getAccessModeCompletionStage()
- Specified by:
getAccessModeCompletionStage
in interfaceRemoteAccessModeService
-
updateAccessModeCompletionStage
public CompletionStage<Void> updateAccessModeCompletionStage(AccessMode accessMode) throws ServiceException
- Specified by:
updateAccessModeCompletionStage
in interfaceRemoteAccessModeService
- Throws:
ServiceException
-
isReadOnlyAccessModeEnabledCompletionStage
public CompletionStage<Boolean> isReadOnlyAccessModeEnabledCompletionStage()
- Specified by:
isReadOnlyAccessModeEnabledCompletionStage
in interfaceRemoteAccessModeService
-
shouldEnforceReadOnlyAccessCompletionStage
public CompletionStage<Boolean> shouldEnforceReadOnlyAccessCompletionStage()
- Specified by:
shouldEnforceReadOnlyAccessCompletionStage
in interfaceRemoteAccessModeService
-
withReadOnlyAccessExemptionCompletionStage
public <T> CompletionStage<T> withReadOnlyAccessExemptionCompletionStage(Callable<T> callable) throws ServiceException
Description copied from interface:RemoteAccessModeService
Execute a method that needs to be exempt from read-only access check in the permission manager layer.- Specified by:
withReadOnlyAccessExemptionCompletionStage
in interfaceRemoteAccessModeService
- Type Parameters:
T
- the return type of the method- Parameters:
callable
- the method- Returns:
- the value returned by the callable method
- Throws:
ServiceException
-
-