public class RouterInteractor
extends java.lang.Object
| Constructor and Description |
|---|
RouterInteractor(java.net.InetAddress addr,
int port)
Constructor for a MCRP connection
to the ManagementConsole of a router.
|
RouterInteractor(java.lang.String addr,
int port)
Constructor for a MCRP connection
to the ManagementConsole of a router.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.lang.String> |
appList()
List all app
APP_LIST
|
us.monoid.json.JSONObject |
appStart(java.lang.String className,
java.lang.String[] args)
Start an app.
|
us.monoid.json.JSONObject |
appStop(java.lang.String appName)
Stop an app
APP_STOP app_name
|
us.monoid.json.JSONObject |
createConnection(java.lang.String address)
Create a new router-to-router data connection to another router.
|
us.monoid.json.JSONObject |
createConnection(java.lang.String address,
int weight)
Create a new router-to-router data connection to another router.
|
us.monoid.json.JSONObject |
createConnection(java.lang.String address,
int weight,
java.lang.String name)
Create a new router-to-router data connection to another router.
|
us.monoid.json.JSONObject |
endLink(java.lang.String spec)
End the link from this router to the router with a given spec
|
Address |
getAddress()
Get the address of the router.
|
java.lang.String |
getConnectionPort()
Get the port number to connect to on the router
in order to make a new router-to-router data connection.
|
java.lang.String |
getManagementConsoleAddress()
Get the address of the Management Console as hostname:port
|
java.lang.String |
getManagementConsolePort()
Get the port number of the Management Console
|
java.lang.String |
getName()
Get the name of the router.
|
java.util.List<java.lang.String> |
getNetIFStats()
Get the NetIF stats from a Router.
|
int |
getPort()
Get the port this RouterInteractor is connecting to
|
java.lang.String |
getPortAddress(java.lang.String port)
Get the address of a port on the router.
|
java.lang.String |
getPortName(java.lang.String port)
Get the name of a port on the router.
|
java.lang.String |
getPortRemoteAddress(java.lang.String port)
Get the address of a remote router of a port on the router.
|
java.lang.String |
getPortRemoteRouterName(java.lang.String port)
Get the name of a remote router of a port on the router.
|
java.lang.String |
getPortWeight(java.lang.String port)
Get the weight of a port on the router.
|
java.util.List<java.lang.String> |
getSocketStats()
Get the socket stats from a Router.
|
RouterInteractor |
incomingConnection(java.lang.String connectionID,
java.lang.String name,
Address addr,
int weight,
int port)
Tell the router there has been an incoming connection
on the router-to-router port.
|
java.util.List<java.lang.String> |
listConnections()
List all the router-to-router connections that the router has.
|
RouterInteractor |
monitoringStart(java.net.InetSocketAddress addr,
int howOften)
Monitoring Start.
|
RouterInteractor |
monitoringStop()
Monitoring Stop
|
RouterInteractor |
quit()
Quit talking to the router
Close a connection to the ManagementConsole of the router.
|
boolean |
routerOK()
Check router is responding
|
RouterInteractor |
setAddress(Address addr)
Set the global address of the router.
|
RouterInteractor |
setAP(int GID,
int APGID)
Send a message to a local controller intended for a router to
set its status as an aggregation point
|
RouterInteractor |
setConfigString(java.lang.String config)
Set the configuration string for a router
|
us.monoid.json.JSONObject |
setLinkWeight(java.lang.String spec,
int weight)
Set the link weight from this router to the router with a given spec
|
RouterInteractor |
setName(java.lang.String name)
Set the name of the router.
|
RouterInteractor |
setPortAddress(java.lang.String port,
java.lang.String type,
java.lang.String addr)
Set the address of a port on the router.
|
RouterInteractor |
setPortWeight(java.lang.String port,
java.lang.String weight)
Set the weight of a port on the router.
|
java.lang.Boolean |
shutDown()
Shutdown the Router we are interacting with.
|
public RouterInteractor(java.lang.String addr,
int port)
throws java.net.UnknownHostException,
java.io.IOException
addr - the name of the hostport - the port the server is listening onjava.net.UnknownHostExceptionjava.io.IOExceptionpublic RouterInteractor(java.net.InetAddress addr,
int port)
throws java.net.UnknownHostException,
java.io.IOException
addr - the InetAddress of the hostport - the port the server is listening onjava.net.UnknownHostExceptionjava.io.IOExceptionpublic int getPort()
public RouterInteractor quit() throws java.io.IOException, us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic java.lang.String getName()
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic RouterInteractor setName(java.lang.String name) throws java.io.IOException, us.monoid.json.JSONException
name - the new name of the routerjava.io.IOExceptionus.monoid.json.JSONExceptionpublic Address getAddress() throws java.io.IOException, us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic RouterInteractor setAddress(Address addr) throws java.io.IOException, us.monoid.json.JSONException
addr - the address of the routerjava.io.IOExceptionus.monoid.json.JSONExceptionpublic java.lang.String getManagementConsoleAddress()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getManagementConsolePort()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getConnectionPort()
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic java.lang.String getPortName(java.lang.String port)
throws java.io.IOException,
us.monoid.json.JSONException
port - the port namejava.io.IOExceptionus.monoid.json.JSONExceptionpublic java.lang.String getPortRemoteRouterName(java.lang.String port)
throws java.io.IOException,
us.monoid.json.JSONException
port - the port namejava.io.IOExceptionus.monoid.json.JSONExceptionpublic java.lang.String getPortRemoteAddress(java.lang.String port)
throws java.io.IOException,
us.monoid.json.JSONException
port - the port namejava.io.IOExceptionus.monoid.json.JSONExceptionpublic java.lang.String getPortAddress(java.lang.String port)
throws java.io.IOException,
us.monoid.json.JSONException
port - the port namejava.io.IOExceptionus.monoid.json.JSONExceptionpublic RouterInteractor setPortAddress(java.lang.String port, java.lang.String type, java.lang.String addr) throws java.io.IOException, us.monoid.json.JSONException
port - the port nameaddr - the value for the addressjava.io.IOExceptionus.monoid.json.JSONExceptionpublic java.lang.String getPortWeight(java.lang.String port)
throws java.io.IOException,
us.monoid.json.JSONException
port - the port namejava.io.IOExceptionus.monoid.json.JSONExceptionpublic RouterInteractor setPortWeight(java.lang.String port, java.lang.String weight) throws java.io.IOException, us.monoid.json.JSONException
port - the port nameweight - the value for the weightjava.io.IOExceptionus.monoid.json.JSONExceptionpublic RouterInteractor incomingConnection(java.lang.String connectionID, java.lang.String name, Address addr, int weight, int port) throws java.io.IOException, us.monoid.json.JSONException
connectionID - the name for the incoming connectionname - the name of the router making the connectionaddr - the address of the router making the connectionweight - the weight of the connectionport - the port numberjava.io.IOExceptionus.monoid.json.JSONExceptionpublic java.util.List<java.lang.String> listConnections()
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic us.monoid.json.JSONObject appStart(java.lang.String className,
java.lang.String[] args)
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic us.monoid.json.JSONObject appStop(java.lang.String appName)
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic java.util.List<java.lang.String> appList()
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic us.monoid.json.JSONObject createConnection(java.lang.String address)
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic us.monoid.json.JSONObject createConnection(java.lang.String address,
int weight)
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic us.monoid.json.JSONObject createConnection(java.lang.String address,
int weight,
java.lang.String name)
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic us.monoid.json.JSONObject endLink(java.lang.String spec)
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic us.monoid.json.JSONObject setLinkWeight(java.lang.String spec,
int weight)
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic RouterInteractor setConfigString(java.lang.String config) throws java.io.IOException, us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic RouterInteractor setAP(int GID, int APGID) throws java.io.IOException, us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic java.util.List<java.lang.String> getNetIFStats()
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic java.util.List<java.lang.String> getSocketStats()
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic RouterInteractor monitoringStart(java.net.InetSocketAddress addr, int howOften) throws java.io.IOException, us.monoid.json.JSONException
addr - The InetSocketAddress of the Monitoring data consumerhowOften - How many seconds between measurementsjava.io.IOExceptionus.monoid.json.JSONExceptionpublic RouterInteractor monitoringStop() throws java.io.IOException, us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic boolean routerOK()
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionpublic java.lang.Boolean shutDown()
throws java.io.IOException,
us.monoid.json.JSONException
java.io.IOExceptionus.monoid.json.JSONExceptionUser Space Routing 0.10.3