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


Java QoSTypeOfService类代码示例

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


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

示例1: init

import net.floodlightcontroller.qos.QoSTypeOfService; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
		throws FloodlightModuleException {
	//initiate services
	floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class);
	flowPusher = context.getServiceImpl(IStaticFlowEntryPusherService.class);
	logger = LoggerFactory.getLogger(QoS.class);
	storageSource = context.getServiceImpl(IStorageSourceService.class);
       restApi = context.getServiceImpl(IRestApiService.class);
       policies = new ArrayList<QoSPolicy>();
       services = new ArrayList<QoSTypeOfService>();
       logger = LoggerFactory.getLogger(QoS.class);
       
       // start disabled
       enabled = false;
}
 
开发者ID:wallnerryan,项目名称:FL_HAND,代码行数:17,代码来源:QoS.java

示例2: startUp

import net.floodlightcontroller.qos.QoSTypeOfService; //导入依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context) {
	// initialize REST interface
       restApi.addRestletRoutable(new QoSWebRoutable());
       floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this);
       
       //Storage for policies
       storageSource.createTable(TABLE_NAME, null);
       storageSource.setTablePrimaryKeyName(TABLE_NAME, COLUMN_POLID);
       //avoid thread issues for concurrency
       synchronized (policies) {
           this.policies = readPoliciesFromStorage(); 
           }
       
       //Storage for services
       storageSource.createTable(TOS_TABLE_NAME, null);
       storageSource.setTablePrimaryKeyName(TOS_TABLE_NAME, COLUMN_SID);
       //avoid thread issues for concurrency
       synchronized (services) {
           this.services = readServicesFromStorage(); 
           }
       
       // create default "Best Effort" service
       // most networks use this as default, adding here for defaulting
       try{
       	QoSTypeOfService service = new QoSTypeOfService();
       	service.name = "Best Effort";
       	service.tos = (byte)0x00;
       	service.sid = service.genID();
       	this.addService(service);
       }catch(Exception e){
       	logger.error("Error adding default Best Effort {}", e);
       }
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:35,代码来源:QoS.java

示例3: addService

import net.floodlightcontroller.qos.QoSTypeOfService; //导入依赖的package包/类
/**
 * Add a service class to use in policies
 * Used to make ToS/DiffServ Bits human readable. 
 * Bit notation 000000 becomes "Best Effort"
 * @param QoSTypeOfService
 */
@Override
public synchronized void addService(QoSTypeOfService service) {
	//debug
	logger.debug("Adding Service to List and Storage");
	//create the UID
	service.sid = service.genID();
	
	//check tos bits are within bounds
       if (service.tos >= (byte)0x00 && service.tos <= (byte)0x3F ){
       	try{
       		//Add to the list of services
       		//un-ordered, naturally a short list
       		this.services.add(service);
       		
       		//add to the storage source
       		Map<String, Object> serviceEntry = new HashMap<String,Object>();
       		serviceEntry.put(COLUMN_SID, Integer.toString(service.sid));
       		serviceEntry.put(COLUMN_SNAME, service.name);
       		serviceEntry.put(COLUMN_TOSBITS, Byte.toString(service.tos));
       		
       		//ad to storage
       		storageSource.insertRow(TOS_TABLE_NAME, serviceEntry);
       		
       	}catch(Exception e){
       		logger.debug("Error adding service, error: {}" ,e);
       	}
       }
       else{
       	logger.debug("Type of Service must be 0-64");
       }
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:38,代码来源:QoS.java

示例4: deleteService

import net.floodlightcontroller.qos.QoSTypeOfService; //导入依赖的package包/类
/**
 * Removes a Network Type of Service
 * @category by sid
 */
@Override
public synchronized void deleteService(int sid) {
	Iterator<QoSTypeOfService> sIter = this.services.iterator();
	while(sIter.hasNext()){
		QoSTypeOfService s = sIter.next();
		if(s.sid == sid){
			sIter.remove();
			break; //done only one can exist
		}
	}
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:16,代码来源:QoS.java

示例5: startUp

import net.floodlightcontroller.qos.QoSTypeOfService; //导入依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context) {
	// initialize REST interface
       restApi.addRestletRoutable(new QoSWebRoutable());
       //listen to packet_in for applied QoS messages
       floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this);
       
       //Storage for policies
       storageSource.createTable(TABLE_NAME, null);
       storageSource.setTablePrimaryKeyName(TABLE_NAME, COLUMN_POLID);
       //avoid thread issues for concurrency
       synchronized (policies) {
           this.policies = readPoliciesFromStorage(); 
           }
       
       //Storage for services
       storageSource.createTable(TOS_TABLE_NAME, null);
       storageSource.setTablePrimaryKeyName(TOS_TABLE_NAME, COLUMN_SID);
       //avoid thread issues for concurrency
       synchronized (services) {
           this.services = readServicesFromStorage(); 
           }
       
       // create default "Best Effort" service
       // most networks use this as default, adding here for defaulting
       try{
       	QoSTypeOfService service = new QoSTypeOfService();
       	service.name = "Best Effort";
       	service.tos = (byte)0x00;
       	service.sid = service.genID();
       	this.addService(service);
       }catch(Exception e){
       	logger.error("Error adding default Best Effort {}", e);
       }
}
 
开发者ID:wallnerryan,项目名称:FL_HAND,代码行数:36,代码来源:QoS.java

示例6: getServices

import net.floodlightcontroller.qos.QoSTypeOfService; //导入依赖的package包/类
/**
 * Returns a list of services available for Network Type of Service
 * @return List
 */
@Override
public List<QoSTypeOfService> getServices() {
	return this.services;
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:9,代码来源:QoS.java

示例7: startUp

import net.floodlightcontroller.qos.QoSTypeOfService; //导入依赖的package包/类
@Override
public void startUp(FloodlightModuleContext context) {
	// initialize REST interface
       restApi.addRestletRoutable(new QoSWebRoutable());
       floodlightProvider.addOFMessageListener(OFType.PACKET_IN, this);
       
       //Storage for policies
       storageSource.createTable(TABLE_NAME, null);
       storageSource.setTablePrimaryKeyName(TABLE_NAME, COLUMN_POLID);
       //avoid thread issues for concurrency
       synchronized (policies) {
           this.policies = readPoliciesFromStorage(); 
           }
       
       //Storage for services
       storageSource.createTable(TOS_TABLE_NAME, null);
       storageSource.setTablePrimaryKeyName(TOS_TABLE_NAME, COLUMN_SID);
       //avoid thread issues for concurrency
       synchronized (services) {
           this.services = readServicesFromStorage(); 
           }
       
       // create default "Best Effort" service
       // most networks use this as default, adding here for defaulting
       try{
       	QoSTypeOfService service = new QoSTypeOfService();
       	service.name = "Best Effort";
       	service.tos = (byte)0x00;
       	service.sid = service.genID();
       	this.addService(service);
       }catch(Exception e){
       	logger.error("Error adding default Best Effort {}", e);
       }
       
       enabled = true ;
       // test
     /*  String qosJson = new String();
       qosJson = "{\n \"ip-src\": \"10.0.0.1\",\n \"protocol\": \"6\",\n \"name\": \"Qoos.00:00:00:00:00:00:00:02\",\n \"ip-dst\": \"10.0.0.2\",\n \"queue\": \"2\",\n \"eth-type\": \"0x0800\"\n}\n"; // 設定Json
       System.out.println(qosJson); // 印出
       try{
       QoSPolicy p = QoSPoliciesResource.jsonToPolicy(qosJson); // 轉
       addPolicy(p);
       }
       catch (Exception e){
       System.out.println("\n\n fail\n\n");
       }
       */
       
}
 
开发者ID:jimmyoic,项目名称:floodlight-qosmanager,代码行数:50,代码来源:QoS.java


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