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.UnknownHostException
java.io.IOException
public 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.UnknownHostException
java.io.IOException
public int getPort()
public RouterInteractor quit() throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public java.lang.String getName() throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public RouterInteractor setName(java.lang.String name) throws java.io.IOException, us.monoid.json.JSONException
name
- the new name of the routerjava.io.IOException
us.monoid.json.JSONException
public Address getAddress() throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public RouterInteractor setAddress(Address addr) throws java.io.IOException, us.monoid.json.JSONException
addr
- the address of the routerjava.io.IOException
us.monoid.json.JSONException
public java.lang.String getManagementConsoleAddress() throws java.io.IOException
java.io.IOException
public java.lang.String getManagementConsolePort() throws java.io.IOException
java.io.IOException
public java.lang.String getConnectionPort() throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public java.lang.String getPortName(java.lang.String port) throws java.io.IOException, us.monoid.json.JSONException
port
- the port namejava.io.IOException
us.monoid.json.JSONException
public java.lang.String getPortRemoteRouterName(java.lang.String port) throws java.io.IOException, us.monoid.json.JSONException
port
- the port namejava.io.IOException
us.monoid.json.JSONException
public java.lang.String getPortRemoteAddress(java.lang.String port) throws java.io.IOException, us.monoid.json.JSONException
port
- the port namejava.io.IOException
us.monoid.json.JSONException
public java.lang.String getPortAddress(java.lang.String port) throws java.io.IOException, us.monoid.json.JSONException
port
- the port namejava.io.IOException
us.monoid.json.JSONException
public 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.IOException
us.monoid.json.JSONException
public java.lang.String getPortWeight(java.lang.String port) throws java.io.IOException, us.monoid.json.JSONException
port
- the port namejava.io.IOException
us.monoid.json.JSONException
public 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.IOException
us.monoid.json.JSONException
public 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.IOException
us.monoid.json.JSONException
public java.util.List<java.lang.String> listConnections() throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public us.monoid.json.JSONObject appStart(java.lang.String className, java.lang.String[] args) throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public us.monoid.json.JSONObject appStop(java.lang.String appName) throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public java.util.List<java.lang.String> appList() throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public us.monoid.json.JSONObject createConnection(java.lang.String address) throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public us.monoid.json.JSONObject createConnection(java.lang.String address, int weight) throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public 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.IOException
us.monoid.json.JSONException
public us.monoid.json.JSONObject endLink(java.lang.String spec) throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public us.monoid.json.JSONObject setLinkWeight(java.lang.String spec, int weight) throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public RouterInteractor setConfigString(java.lang.String config) throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public RouterInteractor setAP(int GID, int APGID) throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public java.util.List<java.lang.String> getNetIFStats() throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public java.util.List<java.lang.String> getSocketStats() throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public 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.IOException
us.monoid.json.JSONException
public RouterInteractor monitoringStop() throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public boolean routerOK() throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
public java.lang.Boolean shutDown() throws java.io.IOException, us.monoid.json.JSONException
java.io.IOException
us.monoid.json.JSONException
User Space Routing 0.10.3