|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sdnplatform.sync.internal.AbstractSyncManager
org.sdnplatform.sync.internal.remote.RemoteSyncManager
public class RemoteSyncManager
Implementation of a sync service that passes its functionality off to a remote sync manager over a TCP connection
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.sdnplatform.sync.ISyncService |
---|
ISyncService.Scope |
Field Summary | |
---|---|
protected AuthScheme |
authScheme
|
protected org.jboss.netty.channel.Channel |
channel
Active connection to server |
protected org.jboss.netty.bootstrap.ClientBootstrap |
clientBootstrap
Client bootstrap |
protected java.lang.String |
hostname
The hostname of the server to connect to |
protected java.lang.String |
keyStorePassword
|
protected java.lang.String |
keyStorePath
|
protected static org.slf4j.Logger |
logger
|
protected int |
port
Port to connect to |
protected boolean |
ready
|
protected java.lang.Object |
readyNotify
|
protected java.lang.Short |
remoteNodeId
The remote node ID of the node we're connected to |
protected boolean |
shutdown
|
Constructor Summary | |
---|---|
RemoteSyncManager()
|
Method Summary | |
---|---|
void |
addListener(java.lang.String storeName,
MappingStoreListener listener)
Add a listener to the specified store |
protected void |
channelDisconnected(SyncException why)
|
protected boolean |
connect(java.lang.String hostname,
int port)
|
void |
dispatchReply(int xid,
SyncReply reply)
|
protected void |
ensureConnected()
|
short |
getLocalNodeId()
Get the local ID of the local node |
java.util.Collection<java.lang.Class<? extends IFloodlightService>> |
getModuleDependencies()
Get a list of Modules that this module depends on. |
IStore<ByteArray,byte[]> |
getStore(java.lang.String storeName)
Get a store object corresponding to the given store name |
int |
getTransactionId()
Get a suitable transaction ID for sending a message |
void |
init(FloodlightModuleContext context)
This is a hook for each module to do its internal initialization, e.g., call setService(context.getService("Service")) All module dependencies are resolved when this is called, but not every module is initialized. |
void |
registerPersistentStore(java.lang.String storeName,
ISyncService.Scope scope)
Create a store with the given store name and scope that will be persistent across reboots. |
void |
registerStore(java.lang.String storeName,
ISyncService.Scope scope)
Create a store with the given store name and scope |
java.util.concurrent.Future<SyncReply> |
sendRequest(int xid,
SyncMessage request)
Send a request to the server and generate a future for the eventual reply. |
void |
shutdown()
Shut down the sync manager. |
void |
startUp(FloodlightModuleContext context)
This is a hook for each module to do its external initializations, e.g., register for callbacks or query for state in other modules It is expected that this function will not block and that modules that want non-event driven CPU will spawn their own threads. |
Methods inherited from class org.sdnplatform.sync.internal.AbstractSyncManager |
---|
getModuleServices, getServiceImpls, getStoreClient, getStoreClient, getStoreClient, getStoreClient, getStoreClient |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.slf4j.Logger logger
protected volatile org.jboss.netty.channel.Channel channel
protected java.lang.Object readyNotify
protected volatile boolean ready
protected volatile boolean shutdown
protected java.lang.Short remoteNodeId
protected org.jboss.netty.bootstrap.ClientBootstrap clientBootstrap
protected java.lang.String hostname
protected int port
protected AuthScheme authScheme
protected java.lang.String keyStorePath
protected java.lang.String keyStorePassword
Constructor Detail |
---|
public RemoteSyncManager()
Method Detail |
---|
public void registerStore(java.lang.String storeName, ISyncService.Scope scope) throws SyncException
ISyncService
storeName
- the name of the storescope
- the distribution scope for the data
SyncException
public void registerPersistentStore(java.lang.String storeName, ISyncService.Scope scope) throws SyncException
ISyncService
storeName
- the name of the storescope
- the distribution scope for the data
SyncException
public void addListener(java.lang.String storeName, MappingStoreListener listener) throws UnknownStoreException
AbstractSyncManager
addListener
in class AbstractSyncManager
storeName
- the name of the storelistener
- the listener to add
UnknownStoreException
public IStore<ByteArray,byte[]> getStore(java.lang.String storeName) throws UnknownStoreException
AbstractSyncManager
getStore
in class AbstractSyncManager
storeName
- the store name
IStore
UnknownStoreException
public short getLocalNodeId()
AbstractSyncManager
getLocalNodeId
in class AbstractSyncManager
public void shutdown()
AbstractSyncManager
shutdown
in class AbstractSyncManager
public void init(FloodlightModuleContext context) throws FloodlightModuleException
IFloodlightModule
FloodlightModuleException
public void startUp(FloodlightModuleContext context) throws FloodlightModuleException
IFloodlightModule
FloodlightModuleException
public java.util.Collection<java.lang.Class<? extends IFloodlightService>> getModuleDependencies()
IFloodlightModule
public int getTransactionId()
public java.util.concurrent.Future<SyncReply> sendRequest(int xid, SyncMessage request) throws RemoteStoreException
xid
- the transaction ID for the requestrequest
- the actual request to send
Future
for the reply message
java.lang.InterruptedException
RemoteStoreException
public void dispatchReply(int xid, SyncReply reply)
protected void channelDisconnected(SyncException why)
protected void ensureConnected()
protected boolean connect(java.lang.String hostname, int port)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |