Class AsyncRedisReplicator
- java.lang.Object
-
- com.moilioncircle.redis.replicator.AsyncRedisReplicator
-
- All Implemented Interfaces:
AsyncReplicator,ReplicatorListener,ReplicatorRegister
public class AsyncRedisReplicator extends Object implements AsyncReplicator
- Since:
- 3.0.0
- Author:
- Leon Chen
-
-
Field Summary
Fields Modifier and Type Field Description protected Replicatorreplicator
-
Constructor Summary
Constructors Constructor Description AsyncRedisReplicator(RedisURI uri)AsyncRedisReplicator(RedisURI uri, SslConfiguration sslConfiguration)AsyncRedisReplicator(File file, FileType fileType, Configuration configuration)AsyncRedisReplicator(InputStream in, FileType fileType, Configuration configuration)AsyncRedisReplicator(String uri)AsyncRedisReplicator(String host, int port, Configuration configuration)AsyncRedisReplicator(String uri, SslConfiguration sslConfiguration)
-
Method Summary
-
-
-
Field Detail
-
replicator
protected final Replicator replicator
-
-
Constructor Detail
-
AsyncRedisReplicator
public AsyncRedisReplicator(File file, FileType fileType, Configuration configuration) throws FileNotFoundException
- Throws:
FileNotFoundException
-
AsyncRedisReplicator
public AsyncRedisReplicator(InputStream in, FileType fileType, Configuration configuration)
-
AsyncRedisReplicator
public AsyncRedisReplicator(String host, int port, Configuration configuration)
-
AsyncRedisReplicator
public AsyncRedisReplicator(String uri) throws URISyntaxException, IOException
- Throws:
URISyntaxExceptionIOException
-
AsyncRedisReplicator
public AsyncRedisReplicator(RedisURI uri) throws IOException
- Throws:
IOException
-
AsyncRedisReplicator
public AsyncRedisReplicator(String uri, SslConfiguration sslConfiguration) throws URISyntaxException, IOException
- Parameters:
uri- redis uri.sslConfiguration- ssl configuration.- Throws:
IOException- read timeout or read EOF.URISyntaxException- uri syntax error- Since:
- 3.4.2
- See Also:
RedisURI,SslConfiguration
-
AsyncRedisReplicator
public AsyncRedisReplicator(RedisURI uri, SslConfiguration sslConfiguration) throws IOException
- Parameters:
uri- redis uri.sslConfiguration- ssl configuration.- Throws:
IOException- read timeout or read EOF.- Since:
- 3.4.2
- See Also:
RedisURI,SslConfiguration
-
-
Method Detail
-
getReplicator
public <T extends Replicator> T getReplicator()
-
addRawByteListener
public boolean addRawByteListener(RawByteListener listener)
- Specified by:
addRawByteListenerin interfaceReplicatorListener
-
removeRawByteListener
public boolean removeRawByteListener(RawByteListener listener)
- Specified by:
removeRawByteListenerin interfaceReplicatorListener
-
builtInCommandParserRegister
public void builtInCommandParserRegister()
- Specified by:
builtInCommandParserRegisterin interfaceReplicatorRegister
-
getCommandParser
public CommandParser<? extends Command> getCommandParser(CommandName command)
- Specified by:
getCommandParserin interfaceReplicatorRegister
-
addCommandParser
public <T extends Command> void addCommandParser(CommandName command, CommandParser<T> parser)
- Specified by:
addCommandParserin interfaceReplicatorRegister
-
removeCommandParser
public CommandParser<? extends Command> removeCommandParser(CommandName command)
- Specified by:
removeCommandParserin interfaceReplicatorRegister
-
getModuleParser
public ModuleParser<? extends Module> getModuleParser(String moduleName, int moduleVersion)
- Specified by:
getModuleParserin interfaceReplicatorRegister
-
addModuleParser
public <T extends Module> void addModuleParser(String moduleName, int moduleVersion, ModuleParser<T> parser)
- Specified by:
addModuleParserin interfaceReplicatorRegister
-
removeModuleParser
public ModuleParser<? extends Module> removeModuleParser(String moduleName, int moduleVersion)
- Specified by:
removeModuleParserin interfaceReplicatorRegister
-
setRdbVisitor
public void setRdbVisitor(RdbVisitor rdbVisitor)
- Specified by:
setRdbVisitorin interfaceReplicatorRegister
-
getRdbVisitor
public RdbVisitor getRdbVisitor()
- Specified by:
getRdbVisitorin interfaceReplicatorRegister
-
addEventListener
public boolean addEventListener(EventListener listener)
- Specified by:
addEventListenerin interfaceReplicatorListener
-
removeEventListener
public boolean removeEventListener(EventListener listener)
- Specified by:
removeEventListenerin interfaceReplicatorListener
-
addCloseListener
public boolean addCloseListener(CloseListener listener)
- Specified by:
addCloseListenerin interfaceReplicatorListener
-
removeCloseListener
public boolean removeCloseListener(CloseListener listener)
- Specified by:
removeCloseListenerin interfaceReplicatorListener
-
addExceptionListener
public boolean addExceptionListener(ExceptionListener listener)
- Specified by:
addExceptionListenerin interfaceReplicatorListener
-
removeExceptionListener
public boolean removeExceptionListener(ExceptionListener listener)
- Specified by:
removeExceptionListenerin interfaceReplicatorListener
-
addStatusListener
public boolean addStatusListener(StatusListener listener)
- Specified by:
addStatusListenerin interfaceReplicatorListener
-
removeStatusListener
public boolean removeStatusListener(StatusListener listener)
- Specified by:
removeStatusListenerin interfaceReplicatorListener
-
verbose
public boolean verbose()
- Specified by:
verbosein interfaceReplicatorRegister
-
getStatus
public Status getStatus()
- Specified by:
getStatusin interfaceReplicatorRegister
-
getConfiguration
public Configuration getConfiguration()
- Specified by:
getConfigurationin interfaceReplicatorRegister
-
open
public CompletableFuture<Void> open(Executor executor)
- Specified by:
openin interfaceAsyncReplicator
-
close
public CompletableFuture<Void> close(Executor executor)
- Specified by:
closein interfaceAsyncReplicator
-
-