当前位置: 首页>>代码示例>>Java>>正文


Java Restlet类代码示例

本文整理汇总了Java中org.restlet.Restlet的典型用法代码示例。如果您正苦于以下问题:Java Restlet类的具体用法?Java Restlet怎么用?Java Restlet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Restlet类属于org.restlet包,在下文中一共展示了Restlet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createInboundRoot

import org.restlet.Restlet; //导入依赖的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;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:27,代码来源:RestApiServer.java

示例2: getRestlet

import org.restlet.Restlet; //导入依赖的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;
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:20,代码来源:CoreWebRoutable.java

示例3: createInboundRoot

import org.restlet.Restlet; //导入依赖的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;
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:27,代码来源:RestApiServer.java

示例4: getRestlet

import org.restlet.Restlet; //导入依赖的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;
}
 
开发者ID:hexec,项目名称:floodlight-simple-multicast,代码行数:12,代码来源:MulticastWebRoutable.java

示例5: getRestlet

import org.restlet.Restlet; //导入依赖的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;
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:9,代码来源:SwitchManagerWebRoutable.java

示例6: createInboundRoot

import org.restlet.Restlet; //导入依赖的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;
}
 
开发者ID:rtr-nettest,项目名称:open-rmbt,代码行数:11,代码来源:RestletApplication.java

示例7: createInboundRoot

import org.restlet.Restlet; //导入依赖的package包/类
@Override
public Restlet createInboundRoot()
{
    final Router router = new Router(getContext());
    
    router.attach("/version", VersionResource.class);
    
    final PointTiles pointTiles = new PointTiles();
    router.attach("/tiles/points/{zoom}/{x}/{y}.png", pointTiles);
    router.attach("/tiles/points", pointTiles);
    
    final HeatmapTiles heatmapTiles = new HeatmapTiles();
    router.attach("/tiles/heatmap/{zoom}/{x}/{y}.png", heatmapTiles);
    router.attach("/tiles/heatmap", heatmapTiles);
    
    final ShapeTiles shapeTiles = new ShapeTiles();
    router.attach("/tiles/shapes/{zoom}/{x}/{y}.png", shapeTiles);
    router.attach("/tiles/shapes", shapeTiles);
    
    router.attach("/tiles/markers", MarkerResource.class);
    
    router.attach("/tiles/info", InfoResource.class);
    router.attach("/v2/tiles/info", at.rtr.rmbt.mapServer.v2.InfoResource.class);
    
    return router;
}
 
开发者ID:rtr-nettest,项目名称:open-rmbt,代码行数:27,代码来源:MapServer.java

示例8: getRestlet

import org.restlet.Restlet; //导入依赖的package包/类
@Override
public Restlet getRestlet(Context context) {
    Router router = new Router(context);
    router.attach("/data/json", PerfMonDataResource.class);
    router.attach("/{perfmonstate}/json", PerfMonToggleResource.class); // enable, disable, or reset
    return router;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:8,代码来源:PerfWebRoutable.java

示例9: getRestlet

import org.restlet.Restlet; //导入依赖的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;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:9,代码来源:DeviceRoutable.java

示例10: getRestlet

import org.restlet.Restlet; //导入依赖的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;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:11,代码来源:VirtualNetworkWebRoutable.java

示例11: getRestlet

import org.restlet.Restlet; //导入依赖的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;
 }
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:16,代码来源:LoadBalancerWebRoutable.java

示例12: getRestlet

import org.restlet.Restlet; //导入依赖的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;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:8,代码来源:StaticWebRoutable.java

示例13: getRestlet

import org.restlet.Restlet; //导入依赖的package包/类
/**
    * Create the Restlet router and bind to the proper resources.
    */
@Override
public Restlet getRestlet(Context context) {
       Router router = new Router(context);
       router.attach("/rules/json", ACLRuleResource.class);
       router.attach("/clear/json", ClearACRulesResource.class);
       return router;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:11,代码来源:ACLWebRoutable.java

示例14: getRestlet

import org.restlet.Restlet; //导入依赖的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;
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:14,代码来源:StaticFlowEntryWebRoutable.java

示例15: getRestlet

import org.restlet.Restlet; //导入依赖的package包/类
@Override
public Restlet getRestlet(Context context) {
    Router router = new Router(context);
    router.attach("/masks/json", ObfuscationRestApiResourceMasks.class);
    router.attach("/links/json", ObfuscationRestApiResourceLinks.class);
    //router.attach("/tm/json", ObfuscationRestApiResourceTrafficMatrix.class);
    return router;
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:9,代码来源:ObfuscationRestApiWebRoutable.java


注:本文中的org.restlet.Restlet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。