Project JXTA

net.jxta.impl.endpoint.router
Class RouteControl

java.lang.Object
  extended by net.jxta.impl.endpoint.router.RouteControl

public class RouteControl
extends Object


Field Summary
static int ALREADY_EXIST
           
static int DIRECT_ROUTE
           
static int FAILED
           
static int INVALID_ROUTE
           
static int OK
          return value for operation
 
Constructor Summary
RouteControl(EndpointRouter router, ID pid)
          initialize RouteControl
 
Method Summary
 int addRoute(RouteAdvertisement newRoute)
          add a new route.
 int deleteRoute(PeerID pId)
          Delete route info
 void disableRouteCM()
          disable usage of Route CM cache
 void disableRouteResolver()
          disable usage of Route resolver
 void enableRouteCM()
          enable usage of Route CM cache
 void enableRouteResolver()
          enable usage of Route Resolver
 Vector getAllRoutesInfo()
          get all the know routes by the router.
 RouteAdvertisement getMyLocalRoute()
          get my local route
 RouteAdvertisement getRouteInfo(PeerID pId)
          get a current route info
 boolean useRouteCM()
          get RouteCM usage
 boolean useRouteResolver()
          get RouteResolver usage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OK

public static final int OK
return value for operation

See Also:
Constant Field Values

ALREADY_EXIST

public static final int ALREADY_EXIST
See Also:
Constant Field Values

FAILED

public static final int FAILED
See Also:
Constant Field Values

DIRECT_ROUTE

public static final int DIRECT_ROUTE
See Also:
Constant Field Values

INVALID_ROUTE

public static final int INVALID_ROUTE
See Also:
Constant Field Values
Constructor Detail

RouteControl

public RouteControl(EndpointRouter router,
                    ID pid)
initialize RouteControl

Method Detail

getMyLocalRoute

public RouteAdvertisement getMyLocalRoute()
get my local route

Returns:
RoutAdvertisement of the local route

addRoute

public int addRoute(RouteAdvertisement newRoute)
add a new route. For the route to be usefull, we actively try the route by trying it

Parameters:
newRoute - route to add
Returns:
Integer status (OK, FAILED, INVALID_ROUTE or ROUTE_EXIST)

getRouteInfo

public RouteAdvertisement getRouteInfo(PeerID pId)
get a current route info

Parameters:
pId - destination of the route
Returns:
RouteAdvertisement current route info

deleteRoute

public int deleteRoute(PeerID pId)
Delete route info

Parameters:
pId - destination route to be removed
Returns:
Integer status

getAllRoutesInfo

public Vector getAllRoutesInfo()
get all the know routes by the router. Return a vector of all the routes known. This method which is meant for informational purposes, does not lock the maps that it browses. As a result, it could in some cases generate a concurrent modification exception.

Returns:
vector of known routes

useRouteCM

public boolean useRouteCM()
get RouteCM usage


useRouteResolver

public boolean useRouteResolver()
get RouteResolver usage


enableRouteCM

public void enableRouteCM()
enable usage of Route CM cache


disableRouteCM

public void disableRouteCM()
disable usage of Route CM cache


enableRouteResolver

public void enableRouteResolver()
enable usage of Route Resolver


disableRouteResolver

public void disableRouteResolver()
disable usage of Route resolver


JXTA J2SE