本文整理汇总了Java中org.opendaylight.controller.sal.core.TimeStamp类的典型用法代码示例。如果您正苦于以下问题:Java TimeStamp类的具体用法?Java TimeStamp怎么用?Java TimeStamp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TimeStamp类属于org.opendaylight.controller.sal.core包,在下文中一共展示了TimeStamp类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RawPacket
import org.opendaylight.controller.sal.core.TimeStamp; //导入依赖的package包/类
/**
* Copy Constructor for RawPacket, it performs a copy of the packet so each
* packet can be modified independently without worrying that source packet
* content is touched
*
* @param src
* packet to copy data from
*
*/
public RawPacket(RawPacket src) throws ConstructionException {
if (src == null) {
throw new ConstructionException("null source packet");
}
if (src.getPacketData() != null) {
this.packetData = new byte[src.getPacketData().length];
System.arraycopy(src.getPacketData(), 0, this.packetData, 0,
src.getPacketData().length);
} else {
throw new ConstructionException("Empty packetData");
}
this.encap = src.getEncap();
this.incomingTime = src.getIncomingTime();
this.incomingNodeConnector = src.getIncomingNodeConnector();
this.outgoingNodeConnector = src.getOutgoingNodeConnector();
this.props = (src.props == null ? null : new HashMap<Object, Object>(
src.props));
this.copyTime = new TimeStamp(System.currentTimeMillis(), "CopyTime");
}
示例2: getUptime
import org.opendaylight.controller.sal.core.TimeStamp; //导入依赖的package包/类
@RequestMapping(value = "/uptime", method = RequestMethod.GET)
@ResponseBody
public TroubleshootingJsonBean getUptime(HttpServletRequest request, @RequestParam(required = false) String container) {
List<Map<String, String>> lines = new ArrayList<Map<String, String>>();
String containerName = (container == null) ? GlobalConstants.DEFAULT.toString() : container;
// Derive the privilege this user has on the current container
String userName = request.getUserPrincipal().getName();
Privilege privilege = DaylightWebUtil.getContainerPrivilege(userName, containerName, this);
if (privilege != Privilege.NONE) {
ISwitchManager switchManager = (ISwitchManager) ServiceHelper
.getInstance(ISwitchManager.class, containerName, this);
Set<Node> nodeSet = (switchManager != null) ? switchManager.getNodes() : null;
if (nodeSet != null) {
for (Node node : nodeSet) {
Map<String, String> device = new HashMap<String, String>();
device.put("nodeName", getNodeDesc(node, switchManager));
device.put("nodeId", node.toString());
TimeStamp timeStamp = (TimeStamp) switchManager.getNodeProp(
node, TimeStamp.TimeStampPropName);
Long time = (timeStamp == null) ? 0 : timeStamp.getValue();
String date = (time == 0) ? "" : (new Date(time)).toString();
device.put("connectedSince", date);
lines.add(device);
}
}
}
TroubleshootingJsonBean result = new TroubleshootingJsonBean();
result.setColumnNames(nodeStatsColumnNames);
result.setNodeData(lines);
return result;
}
示例3: addNode
import org.opendaylight.controller.sal.core.TimeStamp; //导入依赖的package包/类
private void addNode(ISwitch sw) {
Node node = NodeCreator.createOFNode(sw.getId());
UpdateType type = UpdateType.ADDED;
Set<Property> props = new HashSet<Property>();
Long sid = (Long) node.getID();
Date connectedSince = controller.getSwitches().get(sid)
.getConnectedDate();
Long connectedSinceTime = (connectedSince == null) ? 0 : connectedSince
.getTime();
props.add(new TimeStamp(connectedSinceTime, "connectedSince"));
props.add(new MacAddress(deriveMacAddress(sid)));
byte tables = sw.getTables();
Tables t = new Tables(tables);
if (t != null) {
props.add(t);
}
int cap = sw.getCapabilities();
Capabilities c = new Capabilities(cap);
if (c != null) {
props.add(c);
}
int act = sw.getActions();
Actions a = new Actions(act);
if (a != null) {
props.add(a);
}
int buffers = sw.getBuffers();
Buffers b = new Buffers(buffers);
if (b != null) {
props.add(b);
}
nodeProps.put(node, props);
// Notify all internal and external listeners
notifyInventoryShimListener(node, type, props);
}
示例4: getIncomingTime
import org.opendaylight.controller.sal.core.TimeStamp; //导入依赖的package包/类
/**
* Read the time stamp when the packet has entered the system
*
* @return The time stamp when the packet has entered the system
*/
public TimeStamp getIncomingTime() {
return this.incomingTime;
}
示例5: getCopyTime
import org.opendaylight.controller.sal.core.TimeStamp; //导入依赖的package包/类
/**
* Returns the time at which the current instance of RawPacket was created
* as a copy of the original one.
*
* @return The time stamp at which this RawPacket instance was created. null
* if this is the original instance.
*/
public TimeStamp getCopyTime() {
return this.copyTime;
}