Class ReconfigBuilderImpl
- java.lang.Object
-
- org.apache.curator.framework.imps.ReconfigBuilderImpl
-
- All Implemented Interfaces:
Backgroundable<ErrorListenerReconfigBuilderMain>,ErrorListenerReconfigBuilderMain,Joinable<LeaveStatConfigEnsembleable>,Leaveable<JoinStatConfigEnsembleable>,Membersable<StatConfigureEnsembleable>,ReconfigBuilder,ReconfigBuilderMain
public class ReconfigBuilderImpl extends java.lang.Object implements ReconfigBuilder, ErrorListenerReconfigBuilderMain
-
-
Constructor Summary
Constructors Constructor Description ReconfigBuilderImpl(CuratorFrameworkImpl client)ReconfigBuilderImpl(CuratorFrameworkImpl client, Backgrounding backgrounding, org.apache.zookeeper.data.Stat responseStat, long fromConfig, java.util.List<java.lang.String> newMembers, java.util.List<java.lang.String> joining, java.util.List<java.lang.String> leaving)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]forEnsemble()ErrorListenerReconfigBuilderMaininBackground()Perform the action in the backgroundErrorListenerReconfigBuilderMaininBackground(java.lang.Object context)Perform the action in the backgroundErrorListenerReconfigBuilderMaininBackground(BackgroundCallback callback)Perform the action in the backgroundErrorListenerReconfigBuilderMaininBackground(BackgroundCallback callback, java.lang.Object context)Perform the action in the backgroundErrorListenerReconfigBuilderMaininBackground(BackgroundCallback callback, java.lang.Object context, java.util.concurrent.Executor executor)Perform the action in the backgroundErrorListenerReconfigBuilderMaininBackground(BackgroundCallback callback, java.util.concurrent.Executor executor)Perform the action in the backgroundLeaveStatConfigEnsembleablejoining(java.lang.String... server)Adds one or more servers to joining the ensemble.LeaveStatConfigEnsembleablejoining(java.util.List<java.lang.String> servers)Adds one or more servers to joining the ensemble.JoinStatConfigEnsembleableleaving(java.lang.String... server)Sets one or more servers to leaving the ensemble.JoinStatConfigEnsembleableleaving(java.util.List<java.lang.String> servers)Sets one or more servers to leaving the ensemble.voidperformBackgroundOperation(org.apache.curator.framework.imps.OperationAndData<java.lang.Void> data)StatConfigureEnsembleablewithNewMembers(java.lang.String... server)Sets one or more members that are meant to be the ensemble.StatConfigureEnsembleablewithNewMembers(java.util.List<java.lang.String> servers)Sets one or more members that are meant to be the ensemble.ReconfigBuilderMainwithUnhandledErrorListener(UnhandledErrorListener listener)Set an error listener for this background operation.
-
-
-
Constructor Detail
-
ReconfigBuilderImpl
public ReconfigBuilderImpl(CuratorFrameworkImpl client)
-
ReconfigBuilderImpl
public ReconfigBuilderImpl(CuratorFrameworkImpl client, Backgrounding backgrounding, org.apache.zookeeper.data.Stat responseStat, long fromConfig, java.util.List<java.lang.String> newMembers, java.util.List<java.lang.String> joining, java.util.List<java.lang.String> leaving)
-
-
Method Detail
-
forEnsemble
public byte[] forEnsemble() throws java.lang.Exception- Throws:
java.lang.Exception
-
inBackground
public ErrorListenerReconfigBuilderMain inBackground()
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerReconfigBuilderMain>- Returns:
- this
-
inBackground
public ErrorListenerReconfigBuilderMain inBackground(java.lang.Object context)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerReconfigBuilderMain>- Parameters:
context- context object - will be available from the event sent to the listener- Returns:
- this
-
inBackground
public ErrorListenerReconfigBuilderMain inBackground(BackgroundCallback callback)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerReconfigBuilderMain>- Parameters:
callback- a functor that will get called when the operation has completed- Returns:
- this
-
inBackground
public ErrorListenerReconfigBuilderMain inBackground(BackgroundCallback callback, java.lang.Object context)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerReconfigBuilderMain>- 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 ErrorListenerReconfigBuilderMain inBackground(BackgroundCallback callback, java.util.concurrent.Executor executor)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerReconfigBuilderMain>- Parameters:
callback- a functor that will get called when the operation has completedexecutor- executor to use for the background call- Returns:
- this
-
inBackground
public ErrorListenerReconfigBuilderMain 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<ErrorListenerReconfigBuilderMain>- 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
-
withUnhandledErrorListener
public ReconfigBuilderMain withUnhandledErrorListener(UnhandledErrorListener listener)
Description copied from interface:ErrorListenerReconfigBuilderMainSet 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 interfaceErrorListenerReconfigBuilderMain- Parameters:
listener- the listener- Returns:
- this for chaining
-
withNewMembers
public StatConfigureEnsembleable withNewMembers(java.lang.String... server)
Description copied from interface:MembersableSets one or more members that are meant to be the ensemble. The expected format is server.[id]=[hostname]:[peer port]:[election port]:[type];[client port]- Specified by:
withNewMembersin interfaceMembersable<StatConfigureEnsembleable>- Parameters:
server- The server joining.- Returns:
- this
-
withNewMembers
public StatConfigureEnsembleable withNewMembers(java.util.List<java.lang.String> servers)
Description copied from interface:MembersableSets one or more members that are meant to be the ensemble. The expected format is server.[id]=[hostname]:[peer port]:[election port]:[type];[client port]- Specified by:
withNewMembersin interfaceMembersable<StatConfigureEnsembleable>- Parameters:
servers- The servers joining.- Returns:
- this
-
joining
public LeaveStatConfigEnsembleable joining(java.lang.String... server)
Description copied from interface:JoinableAdds one or more servers to joining the ensemble. The expected format is server.[id]=[hostname]:[peer port]:[election port]:[type];[client port]- Specified by:
joiningin interfaceJoinable<LeaveStatConfigEnsembleable>- Parameters:
server- The server joining.- Returns:
- this
-
joining
public LeaveStatConfigEnsembleable joining(java.util.List<java.lang.String> servers)
Description copied from interface:JoinableAdds one or more servers to joining the ensemble. The expected format is server.[id]=[hostname]:[peer port]:[election port]:[type];[client port]- Specified by:
joiningin interfaceJoinable<LeaveStatConfigEnsembleable>- Parameters:
servers- The servers joining.- Returns:
- this
-
leaving
public JoinStatConfigEnsembleable leaving(java.lang.String... server)
Description copied from interface:LeaveableSets one or more servers to leaving the ensemble.- Specified by:
leavingin interfaceLeaveable<JoinStatConfigEnsembleable>- Parameters:
server- The server ids- Returns:
- this
-
leaving
public JoinStatConfigEnsembleable leaving(java.util.List<java.lang.String> servers)
Description copied from interface:LeaveableSets one or more servers to leaving the ensemble.- Specified by:
leavingin interfaceLeaveable<JoinStatConfigEnsembleable>- Parameters:
servers- The server ids- Returns:
- this
-
performBackgroundOperation
public void performBackgroundOperation(org.apache.curator.framework.imps.OperationAndData<java.lang.Void> data) throws java.lang.Exception- Throws:
java.lang.Exception
-
-