本文整理匯總了Java中org.restlet.routing.Router.attach方法的典型用法代碼示例。如果您正苦於以下問題:Java Router.attach方法的具體用法?Java Router.attach怎麽用?Java Router.attach使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.restlet.routing.Router
的用法示例。
在下文中一共展示了Router.attach方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createInboundRoot
import org.restlet.routing.Router; //導入方法依賴的package包/類
@Override
public Restlet createInboundRoot() {
Router baseRouter = new Router(context);
baseRouter.setDefaultMatchingMode(Template.MODE_STARTS_WITH);
for (RestletRoutable rr : restlets) {
baseRouter.attach(rr.basePath(), rr.getRestlet(context));
}
Filter slashFilter = new Filter() {
@Override
protected int beforeHandle(Request request, Response response) {
Reference ref = request.getResourceRef();
String originalPath = ref.getPath();
if (originalPath.contains("//"))
{
String newPath = originalPath.replaceAll("/+", "/");
ref.setPath(newPath);
}
return Filter.CONTINUE;
}
};
slashFilter.setNext(baseRouter);
return slashFilter;
}
示例2: getRestlet
import org.restlet.routing.Router; //導入方法依賴的package包/類
@Override
public Restlet getRestlet(Context context) {
Router router = new Router(context);
router.attach("/controller/summary/json", ControllerSummaryResource.class);
router.attach("/module/loaded/json", LoadedModuleLoaderResource.class);
router.attach("/controller/switches/json", ControllerSwitchesResource.class);
router.attach("/groups_info/json", GroupsInfoResource.class);
router.attach("/group_info/json", GroupInfoResource.class);
router.attach("/group_create/json", GroupCreateResource.class);
return router;
}
示例3: getRestlet
import org.restlet.routing.Router; //導入方法依賴的package包/類
@Override
public Restlet getRestlet(Context context) {
Router router = new Router(context);
router.attach("/flow", FlowResource.class);
router.attach("/flows/switch_id/{switch_id}", FlowsResource.class);
router.attach("/meters/switch_id/{switch_id}", MetersResource.class);
return router;
}
示例4: getRestlet
import org.restlet.routing.Router; //導入方法依賴的package包/類
/**
* Create the Restlet router and bind to the proper resources.
*/
@Override
public Router getRestlet(Context context) {
Router router = new Router(context);
router.attach("/module/status/json", FirewallStatusResource.class);
router.attach("/module/enable/json", FirewallEnableResource.class);
router.attach("/module/disable/json", FirewallDisableResource.class);
router.attach("/module/subnet-mask/json", FirewallSubnetMaskResource.class);
router.attach("/module/storageRules/json", FirewallStorageRulesResource.class);
router.attach("/rules/json", FirewallRulesResource.class);
return router;
}
示例5: getRestlet
import org.restlet.routing.Router; //導入方法依賴的package包/類
@Override
public Restlet getRestlet(Context context) {
Router router = new Router(context);
router.attach("/module/all/json", ModuleLoaderResource.class);
router.attach("/module/loaded/json", LoadedModuleLoaderResource.class);
router.attach("/switch/{" + STR_SWITCH_ID + "}/role/json", SwitchRoleResource.class);
router.attach("/switch/all/{" + STR_STAT_TYPE + "}/json", AllSwitchStatisticsResource.class);
router.attach("/switch/{" + STR_SWITCH_ID + "}/{" + STR_STAT_TYPE + "}/json", SwitchStatisticsResource.class);
router.attach("/controller/switches/json", ControllerSwitchesResource.class);
router.attach("/counter/{" + STR_CTR_MODULE + "}/{" + STR_CTR_TITLE + "}/json", CounterResource.class);
router.attach("/memory/json", ControllerMemoryResource.class);
router.attach("/packettrace/json", PacketTraceResource.class);
router.attach("/storage/tables/json", StorageSourceTablesResource.class);
router.attach("/controller/summary/json", ControllerSummaryResource.class);
router.attach("/role/json", ControllerRoleResource.class);
router.attach("/health/json", HealthCheckResource.class);
router.attach("/system/uptime/json", SystemUptimeResource.class);
return router;
}
示例6: createInboundRoot
import org.restlet.routing.Router; //導入方法依賴的package包/類
@Override
public Restlet createInboundRoot() {
Router router = new Router(getContext());
router.attach("/", StatusResource.class);
router.attach("/info/{type}", InfoResource.class);
router.attach("/info/", InfoResource.class);
router.attachDefault(ErrorHandlerResource.class);
return router;
}
示例7: getRestlet
import org.restlet.routing.Router; //導入方法依賴的package包/類
@Override
public Restlet getRestlet(Context context) {
Router router = new Router(context);
router.attach("/all/json", DeviceResource.class);
router.attach("/", DeviceResource.class);
router.attach("/debug", DeviceEntityResource.class);
return router;
}
示例8: getRestlet
import org.restlet.routing.Router; //導入方法依賴的package包/類
/**
* Create the Restlet router and bind to the proper resources.
*/
@Override
public Router getRestlet(Context context) {
Router router = new Router(context);
router.attach("/autoportfast/{state}/json", AutoPortFast.class); // enable/true or disable/false
return router;
}
示例9: getRestlet
import org.restlet.routing.Router; //導入方法依賴的package包/類
@Override
public Restlet getRestlet(Context context) {
Router router = new Router(context);
router.attach("/vips/", VipsResource.class); // GET, POST
router.attach("/vips/{vip}", VipsResource.class); // GET, PUT, DELETE
router.attach("/pools/", PoolsResource.class); // GET, POST
router.attach("/pools/{pool}", PoolsResource.class); // GET, PUT, DELETE
router.attach("/members/", MembersResource.class); // GET, POST
router.attach("/members/{member}", MembersResource.class); // GET, PUT, DELETE
router.attach("/pools/{pool}/members", PoolMemberResource.class); //GET
router.attach("/health_monitors/", MonitorsResource.class); //GET, POST
router.attach("/health_monitors/{monitor}", MonitorsResource.class); //GET, PUT, DELETE
router.attachDefault(NoOp.class);
return router;
}
示例10: getRestlet
import org.restlet.routing.Router; //導入方法依賴的package包/類
@Override
public Restlet getRestlet(Context context) {
Router router = new Router(context);
router.attach("", new Directory(context, "clap://classloader/web/"));
context.setClientDispatcher(new Client(context, Protocol.CLAP));
return router;
}
示例11: getRestlet
import org.restlet.routing.Router; //導入方法依賴的package包/類
@Override
public Restlet getRestlet(Context context) {
Router router = new Router(context);
router.attach("/tenants/{tenant}/networks", NetworkResource.class); // GET
router.attach("/tenants/{tenant}/networks/{network}", NetworkResource.class); // PUT, DELETE
router.attach("/tenants/{tenant}/networks", NetworkResource.class); // POST
router.attach("/tenants/{tenant}/networks/{network}/ports/{port}/attachment", HostResource.class);
router.attachDefault(NoOp.class);
return router;
}
示例12: getRestlet
import org.restlet.routing.Router; //導入方法依賴的package包/類
/**
* Create the Restlet router and bind to the proper resources.
*/
@Override
public Router getRestlet(Context context) {
Router router = new Router(context);
router.attach("/links/json", LinksResource.class);
router.attach("/directed-links/json", DirectedLinksResource.class);
router.attach("/external-links/json", ExternalLinksResource.class);
router.attach("/tunnellinks/json", TunnelLinksResource.class);
router.attach("/switchclusters/json", SwitchClustersResource.class);
router.attach("/broadcastdomainports/json", BroadcastDomainPortsResource.class);
router.attach("/enabledports/json", EnabledPortsResource.class);
router.attach("/blockedports/json", BlockedPortsResource.class);
router.attach("/route/{src-dpid}/{src-port}/{dst-dpid}/{dst-port}/json", RouteResource.class);
return router;
}
示例13: getRestlet
import org.restlet.routing.Router; //導入方法依賴的package包/類
@Override
public Router getRestlet(Context context) {
Router router = new Router(context);
router.attach("/bandwidth/{" + DPID_STR + "}/{" + PORT_STR + "}/json", BandwidthResource.class);
router.attach("/config/enable/json", ConfigResource.class);
router.attach("/config/disable/json", ConfigResource.class);
return router;
}
示例14: createInboundRoot
import org.restlet.routing.Router; //導入方法依賴的package包/類
@Override
public Restlet createInboundRoot() {
Router router = new Router(getContext());
router.attach("/score", ScoreResource.class);
router.attach("/room", RoomResource.class);
router.attach("/leaderboard", LeaderBoardResource.class);
return router;
}
示例15: getRestlet
import org.restlet.routing.Router; //導入方法依賴的package包/類
/**
* Create the Restlet router and bind to the proper resources.
*/
@Override
public Restlet getRestlet(Context context) {
Router router = new Router(context);
router.attach("/json", StaticFlowEntryPusherResource.class);
router.attach("/json/store", StaticFlowEntryPusherResource.class);
router.attach("/json/delete", StaticFlowEntryDeleteResource.class);
router.attach("/clear/{switch}/json", ClearStaticFlowEntriesResource.class);
router.attach("/list/{switch}/json", ListStaticFlowEntriesResource.class);
return router;
}