Class SetDataBuilderImpl
- java.lang.Object
-
- org.apache.curator.framework.imps.SetDataBuilderImpl
-
- All Implemented Interfaces:
Backgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>,BackgroundPathAndBytesable<org.apache.zookeeper.data.Stat>,Compressible<SetDataBackgroundVersionable>,ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>,PathAndBytesable<org.apache.zookeeper.data.Stat>,SetDataBuilder,Versionable<BackgroundPathAndBytesable<org.apache.zookeeper.data.Stat>>
public class SetDataBuilderImpl extends java.lang.Object implements SetDataBuilder, ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>
-
-
Constructor Summary
Constructors Constructor Description SetDataBuilderImpl(CuratorFrameworkImpl client, Backgrounding backgrounding, int version, boolean compress)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SetDataBackgroundVersionablecompressed()Cause the data to be compressed using the configured compression providerorg.apache.zookeeper.data.StatforPath(java.lang.String path)Commit the currently building operation using the given path and the default data for the client (usually a byte[0] unless changed viaCuratorFrameworkFactory.Builder.defaultData(byte[])).org.apache.zookeeper.data.StatforPath(java.lang.String path, byte[] data)Commit the currently building operation using the given path and dataErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>inBackground()Perform the action in the backgroundErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>inBackground(java.lang.Object context)Perform the action in the backgroundErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>inBackground(BackgroundCallback callback)Perform the action in the backgroundErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>inBackground(BackgroundCallback callback, java.lang.Object context)Perform the action in the backgroundErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>inBackground(BackgroundCallback callback, java.lang.Object context, java.util.concurrent.Executor executor)Perform the action in the backgroundErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>inBackground(BackgroundCallback callback, java.util.concurrent.Executor executor)Perform the action in the backgroundvoidperformBackgroundOperation(org.apache.curator.framework.imps.OperationAndData<org.apache.curator.framework.imps.PathAndBytes> operationAndData)PathAndBytesable<org.apache.zookeeper.data.Stat>withUnhandledErrorListener(UnhandledErrorListener listener)Set an error listener for this background operation.BackgroundPathAndBytesable<org.apache.zookeeper.data.Stat>withVersion(int version)Use the given version (the default is -1)
-
-
-
Constructor Detail
-
SetDataBuilderImpl
public SetDataBuilderImpl(CuratorFrameworkImpl client, Backgrounding backgrounding, int version, boolean compress)
-
-
Method Detail
-
compressed
public SetDataBackgroundVersionable compressed()
Description copied from interface:CompressibleCause the data to be compressed using the configured compression provider- Specified by:
compressedin interfaceCompressible<SetDataBackgroundVersionable>- Returns:
- this
-
withVersion
public BackgroundPathAndBytesable<org.apache.zookeeper.data.Stat> withVersion(int version)
Description copied from interface:VersionableUse the given version (the default is -1)- Specified by:
withVersionin interfaceVersionable<BackgroundPathAndBytesable<org.apache.zookeeper.data.Stat>>- Parameters:
version- version to use- Returns:
- this
-
inBackground
public ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(BackgroundCallback callback, java.lang.Object context)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>- Parameters:
callback- a functor that will get called when the operation has completedcontext- context object - will be available from the event sent to the listener- Returns:
- this
-
inBackground
public ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(BackgroundCallback callback, java.lang.Object context, java.util.concurrent.Executor executor)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>- Parameters:
callback- a functor that will get called when the operation has completedcontext- context object - will be available from the event sent to the listenerexecutor- executor to use for the background call- Returns:
- this
-
inBackground
public ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(BackgroundCallback callback)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>- Parameters:
callback- a functor that will get called when the operation has completed- Returns:
- this
-
inBackground
public ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground()
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>- Returns:
- this
-
inBackground
public ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(java.lang.Object context)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>- Parameters:
context- context object - will be available from the event sent to the listener- Returns:
- this
-
inBackground
public ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat> inBackground(BackgroundCallback callback, java.util.concurrent.Executor executor)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>>- Parameters:
callback- a functor that will get called when the operation has completedexecutor- executor to use for the background call- Returns:
- this
-
withUnhandledErrorListener
public PathAndBytesable<org.apache.zookeeper.data.Stat> withUnhandledErrorListener(UnhandledErrorListener listener)
Description copied from interface:ErrorListenerPathAndBytesableSet an error listener for this background operation. If an exception occurs while processing the call in the background, this listener will be called- Specified by:
withUnhandledErrorListenerin interfaceErrorListenerPathAndBytesable<org.apache.zookeeper.data.Stat>- Parameters:
listener- the listener- Returns:
- this for chaining
-
performBackgroundOperation
public void performBackgroundOperation(org.apache.curator.framework.imps.OperationAndData<org.apache.curator.framework.imps.PathAndBytes> operationAndData) throws java.lang.Exception- Throws:
java.lang.Exception
-
forPath
public org.apache.zookeeper.data.Stat forPath(java.lang.String path) throws java.lang.ExceptionDescription copied from interface:PathAndBytesableCommit the currently building operation using the given path and the default data for the client (usually a byte[0] unless changed viaCuratorFrameworkFactory.Builder.defaultData(byte[])).- Specified by:
forPathin interfacePathAndBytesable<org.apache.zookeeper.data.Stat>- Parameters:
path- the path- Returns:
- operation result if any
- Throws:
java.lang.Exception- errors
-
forPath
public org.apache.zookeeper.data.Stat forPath(java.lang.String path, byte[] data) throws java.lang.ExceptionDescription copied from interface:PathAndBytesableCommit the currently building operation using the given path and data- Specified by:
forPathin interfacePathAndBytesable<org.apache.zookeeper.data.Stat>- Parameters:
path- the pathdata- the data- Returns:
- operation result if any
- Throws:
java.lang.Exception- errors
-
-