本文整理汇总了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.\"}";
}
}
示例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.\"}";
}
}
示例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.\"}";
}
}
示例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.\"}";
}
}