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
ConstructorDescriptionReconfigBuilderImpl
(CuratorFrameworkImpl 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.void
performBackgroundOperation
(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(CuratorFrameworkImpl 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:Backgroundable
Perform the action in the background- Specified by:
inBackground
in interfaceBackgroundable<ErrorListenerReconfigBuilderMain>
- Returns:
- this
-
inBackground
Description copied from interface:Backgroundable
Perform the action in the background- Specified by:
inBackground
in interfaceBackgroundable<ErrorListenerReconfigBuilderMain>
- Parameters:
context
- context object - will be available from the event sent to the listener- Returns:
- this
-
inBackground
Description copied from interface:Backgroundable
Perform the action in the background- Specified by:
inBackground
in interfaceBackgroundable<ErrorListenerReconfigBuilderMain>
- Parameters:
callback
- a functor that will get called when the operation has completed- Returns:
- this
-
inBackground
Description copied from interface:Backgroundable
Perform the action in the background- Specified by:
inBackground
in 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:Backgroundable
Perform the action in the background- Specified by:
inBackground
in 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:Backgroundable
Perform the action in the background- Specified by:
inBackground
in 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:ErrorListenerReconfigBuilderMain
Set 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:
withUnhandledErrorListener
in interfaceErrorListenerReconfigBuilderMain
- Parameters:
listener
- the listener- Returns:
- this for chaining
-
withNewMembers
Description copied from interface:Membersable
Sets 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:
withNewMembers
in interfaceMembersable<StatConfigureEnsembleable>
- Parameters:
server
- The server joining.- Returns:
- this
-
withNewMembers
Description copied from interface:Membersable
Sets 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:
withNewMembers
in interfaceMembersable<StatConfigureEnsembleable>
- Parameters:
servers
- The servers joining.- Returns:
- this
-
joining
Description copied from interface:Joinable
Adds one or more servers to joining the ensemble. The expected format is server.[id]=[hostname]:[peer port]:[election port]:[type];[client port]- Specified by:
joining
in interfaceJoinable<LeaveStatConfigEnsembleable>
- Parameters:
server
- The server joining.- Returns:
- this
-
joining
Description copied from interface:Joinable
Adds one or more servers to joining the ensemble. The expected format is server.[id]=[hostname]:[peer port]:[election port]:[type];[client port]- Specified by:
joining
in interfaceJoinable<LeaveStatConfigEnsembleable>
- Parameters:
servers
- The servers joining.- Returns:
- this
-
leaving
Description copied from interface:Leaveable
Sets one or more servers to leaving the ensemble.- Specified by:
leaving
in interfaceLeaveable<JoinStatConfigEnsembleable>
- Parameters:
server
- The server ids- Returns:
- this
-
leaving
Description copied from interface:Leaveable
Sets one or more servers to leaving the ensemble.- Specified by:
leaving
in 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
-