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 Object
implements ReconfigBuilder, ErrorListenerReconfigBuilderMain
-
Constructor Summary
ConstructorsConstructorDescriptionReconfigBuilderImpl(CuratorFrameworkBase client, Backgrounding backgrounding, org.apache.zookeeper.data.Stat responseStat, long fromConfig, List<String> newMembers, List<String> joining, List<String> leaving) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Perform the action in the backgroundinBackground(Object context) Perform the action in the backgroundinBackground(BackgroundCallback callback) Perform the action in the backgroundinBackground(BackgroundCallback callback, Object context) Perform the action in the backgroundinBackground(BackgroundCallback callback, Object context, Executor executor) Perform the action in the backgroundinBackground(BackgroundCallback callback, Executor executor) Perform the action in the backgroundAdds one or more servers to joining the ensemble.Adds one or more servers to joining the ensemble.Sets one or more servers to leaving the ensemble.Sets one or more servers to leaving the ensemble.voidperformBackgroundOperation(org.apache.curator.framework.imps.OperationAndData<Void> data) withNewMembers(String... server) Sets one or more members that are meant to be the ensemble.withNewMembers(List<String> servers) Sets one or more members that are meant to be the ensemble.Set an error listener for this background operation.
-
Constructor Details
-
ReconfigBuilderImpl
-
ReconfigBuilderImpl
public ReconfigBuilderImpl(CuratorFrameworkBase client, Backgrounding backgrounding, org.apache.zookeeper.data.Stat responseStat, long fromConfig, List<String> newMembers, List<String> joining, List<String> leaving)
-
-
Method Details
-
forEnsemble
- Throws:
Exception
-
inBackground
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerReconfigBuilderMain>- Returns:
- this
-
inBackground
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
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
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, 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, Object context, 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
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
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
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
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
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
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
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
-
getBackgroundEventType
-
performBackgroundOperation
public void performBackgroundOperation(org.apache.curator.framework.imps.OperationAndData<Void> data) throws Exception - Throws:
Exception
-