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


Java TimeStamp类代码示例

本文整理汇总了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");
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:29,代码来源:RawPacket.java

示例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;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:35,代码来源:Troubleshoot.java

示例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);
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:40,代码来源:InventoryServiceShim.java

示例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;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:9,代码来源:RawPacket.java

示例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;
}
 
开发者ID:lbchen,项目名称:ODL,代码行数:11,代码来源:RawPacket.java


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