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


Java IStorageSourceService.insertRowAsync方法代码示例

本文整理汇总了Java中net.floodlightcontroller.storage.IStorageSourceService.insertRowAsync方法的典型用法代码示例。如果您正苦于以下问题:Java IStorageSourceService.insertRowAsync方法的具体用法?Java IStorageSourceService.insertRowAsync怎么用?Java IStorageSourceService.insertRowAsync使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.floodlightcontroller.storage.IStorageSourceService的用法示例。


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

示例1: store

import net.floodlightcontroller.storage.IStorageSourceService; //导入方法依赖的package包/类
/**
 * Takes a Static Flow Pusher string in JSON format and parses it into
 * our database schema then pushes it to the database.
 * @param fmJson The Static Flow Pusher entry in JSON format.
 * @return A string status message
 */
@Post
@LogMessageDoc(level="ERROR",
    message="Error parsing push flow mod request: {request}",
    explanation="An invalid request was sent to static flow pusher",
    recommendation="Fix the format of the static flow mod request")
public String store(String fmJson) {
    IStorageSourceService storageSource =
            (IStorageSourceService)getContext().getAttributes().
                get(IStorageSourceService.class.getCanonicalName());

    Map<String, Object> rowValues;
    try {
        rowValues = StaticFlowEntries.jsonToStorageEntry(fmJson);
        String status = null;
        if (!checkMatchIp(rowValues)) {
            status = "Warning! Pushing a static flow entry that matches IP " +
                    "fields without matching for IP payload (ether-type 2048) will cause " +
                    "the switch to wildcard higher level fields.";
            log.error(status);
        } else {
            status = "Entry pushed";
        }
        storageSource.insertRowAsync(StaticFlowEntryPusher.TABLE_NAME, rowValues);
        return ("{\"status\" : \"" + status + "\"}");
    } catch (IOException e) {
        log.error("Error parsing push flow mod request: " + fmJson, e);
        return "{\"status\" : \"Error! Could not parse flod mod, see log for details.\"}";
    }
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:36,代码来源:StaticFlowEntryPusherResource.java

示例2: store

import net.floodlightcontroller.storage.IStorageSourceService; //导入方法依赖的package包/类
/**
 * Takes a Static Flow Pusher string in JSON format and parses it into
 * our database schema then pushes it to the database.
 * @param fmJson The Static Flow Pusher entry in JSON format.
 * @return A string status message
 */
@Post
public String store(String fmJson) {
	IStorageSourceService storageSource =
			(IStorageSourceService)getContext().getAttributes().
			get(IStorageSourceService.class.getCanonicalName());

	Map<String, Object> rowValues;
	try {
		rowValues = StaticFlowEntries.jsonToStorageEntry(fmJson);
		String status = null;

		int state = checkFlow(rowValues);
		if (state == 1) {
			status = "Warning! Must specify eth_type of IPv4/IPv6 to " +
					"match on IPv4/IPv6 fields! The flow has been discarded.";
			log.error(status);
		} else if (state == 2) {
			status = "Warning! eth_type not recognized! The flow has been discarded.";
			log.error(status);
		} else if (state == 3) {
			status = "Warning! Must specify ip_proto to match! The flow has been discarded.";
			log.error(status);
		} else if (state == 4) {
			status = "Warning! ip_proto invalid! The flow has been discarded.";
			log.error(status);
		} else if (state == 5) {
			status = "Warning! Must specify icmp6_type to match! The flow has been discarded.";
			log.error(status);
		} else if (state == 6) {
			status = "Warning! icmp6_type invalid! The flow has been discarded.";
			log.error(status);
		} else if (state == 7) {
			status = "Warning! IPv4 & IPv6 fields cannot be specified in the same flow! The flow has been discarded.";
			log.error(status);
		} else if (state == 8) {
			status = "Warning! Must specify switch DPID in flow. The flow has been discarded.";
			log.error(status);
		} else if (state == 9) {
			status = "Warning! Switch DPID invalid! The flow has been discarded.";
			log.error(status);
		} else if (state == 0) {
			status = "Entry pushed";            
			storageSource.insertRowAsync(StaticFlowEntryPusher.TABLE_NAME, rowValues);
		}
		return ("{\"status\" : \"" + status + "\"}");
	} catch (IOException e) {
		log.error("Error parsing push flow mod request: " + fmJson, e);
		return "{\"status\" : \"Error! Could not parse flow mod, see log for details.\"}";
	}        
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:57,代码来源:StaticFlowEntryPusherResource.java

示例3: store

import net.floodlightcontroller.storage.IStorageSourceService; //导入方法依赖的package包/类
/**
 * Takes a Static Flow Pusher string in JSON format and parses it into
 * our database schema then pushes it to the database.
 * @param fmJson The Static Flow Pusher entry in JSON format.
 * @return A string status message
 */
@Post
@LogMessageDoc(level="ERROR",
message="Error parsing push flow mod request: {request}",
explanation="An invalid request was sent to static flow pusher",
recommendation="Fix the format of the static flow mod request")
public String store(String fmJson) {
	IStorageSourceService storageSource =
			(IStorageSourceService)getContext().getAttributes().
			get(IStorageSourceService.class.getCanonicalName());

	Map<String, Object> rowValues;
	try {
		rowValues = StaticFlowEntries.jsonToStorageEntry(fmJson);
		String status = null;

		int state = checkFlow(rowValues);
		if (state == 1) {
			status = "Warning! Must specify eth_type of IPv4/IPv6 to " +
					"match on IPv4/IPv6 fields! The flow has been discarded.";
			log.error(status);
		} else if (state == 2) {
			status = "Warning! eth_type not recognized! The flow has been discarded.";
			log.error(status);
		} else if (state == 3) {
			status = "Warning! Must specify ip_proto to match! The flow has been discarded.";
			log.error(status);
		} else if (state == 4) {
			status = "Warning! ip_proto invalid! The flow has been discarded.";
			log.error(status);
		} else if (state == 5) {
			status = "Warning! Must specify icmp6_type to match! The flow has been discarded.";
			log.error(status);
		} else if (state == 6) {
			status = "Warning! icmp6_type invalid! The flow has been discarded.";
			log.error(status);
		} else if (state == 7) {
			status = "Warning! IPv4 & IPv6 fields cannot be specified in the same flow! The flow has been discarded.";
			log.error(status);
		} else if (state == 0) {
			status = "Entry pushed";            
			storageSource.insertRowAsync(StaticFlowEntryPusher.TABLE_NAME, rowValues);
		}
		return ("{\"status\" : \"" + status + "\"}");
	} catch (IOException e) {
		log.error("Error parsing push flow mod request: " + fmJson, e);
		return "{\"status\" : \"Error! Could not parse flow mod, see log for details.\"}";
	}        
}
 
开发者ID:nsg-ethz,项目名称:iTAP-controller,代码行数:55,代码来源:StaticFlowEntryPusherResource.java

示例4: store

import net.floodlightcontroller.storage.IStorageSourceService; //导入方法依赖的package包/类
/**
 * Takes a Static Flow Pusher string in JSON format and parses it into
 * our database schema then pushes it to the database.
 * @param fmJson The Static Flow Pusher entry in JSON format.
 * @return A string status message
 */
@Post
public String store(String fmJson) {
	IStorageSourceService storageSource =
			(IStorageSourceService)getContext().getAttributes().
			get(IStorageSourceService.class.getCanonicalName());

	Map<String, Object> rowValues;
	try {
		rowValues = StaticFlowEntries.jsonToStorageEntry(fmJson);
		String status = null;

		int state = checkFlow(rowValues);
		if (state == 1) {
			status = "Warning! Must specify eth_type of IPv4/IPv6 to " +
					"match on IPv4/IPv6 fields! The flow has been discarded.";
			log.error(status);
		} else if (state == 2) {
			status = "Warning! eth_type not recognized! The flow has been discarded.";
			log.error(status);
		} else if (state == 3) {
			status = "Warning! Must specify ip_proto to match! The flow has been discarded.";
			log.error(status);
		} else if (state == 4) {
			status = "Warning! ip_proto invalid! The flow has been discarded.";
			log.error(status);
		} else if (state == 5) {
			status = "Warning! Must specify icmp6_type to match! The flow has been discarded.";
			log.error(status);
		} else if (state == 6) {
			status = "Warning! icmp6_type invalid! The flow has been discarded.";
			log.error(status);
		} else if (state == 7) {
			status = "Warning! IPv4 & IPv6 fields cannot be specified in the same flow! The flow has been discarded.";
			log.error(status);
		} else if (state == 8) {
			status = "Warning! Must specify switch DPID in flow. The flow has been discarded.";
			log.error(status);
		} else if (state == 9) {
			status = "Warning! Switch DPID invalid! The flow has been discarded.";
			log.error(status);
		} else if (state == 0) {
			status = "Entry pushed";
			storageSource.insertRowAsync(StaticFlowEntryPusher.TABLE_NAME, rowValues);
		}
		return ("{\"status\" : \"" + status + "\"}");
	} catch (IOException e) {
		log.error("Error parsing push flow mod request: " + fmJson, e);
		return "{\"status\" : \"Error! Could not parse flow mod, see log for details.\"}";
	}
}
 
开发者ID:zhenshengcai,项目名称:floodlight-hardware,代码行数:57,代码来源:StaticFlowEntryPusherResource.java


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