@Override public TimeStamp clone() { return new TimeStamp(this.timestamp, this.timestampName); }
if (prop instanceof TimeStamp) { TimeStamp t = (TimeStamp) prop; if (t.getTimeStampName().equals("creation")) { found_create = true; break; TimeStamp t = new TimeStamp(System.currentTimeMillis(), "creation"); props.add(t); if (prop instanceof TimeStamp) { TimeStamp tsProp = (TimeStamp) prop; if (tsProp.getTimeStampName().equals("creation")) { timeStamp = tsProp; break; if (prop instanceof TimeStamp) { TimeStamp t = (TimeStamp) prop; if (t.getTimeStampName().equals("creation")) { if (timeStamp != null) { i.remove();
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);
public static TimeStamp toADTimestamp() { final Date date = new Date(); final TimeStamp timestamp = new TimeStamp(date.getTime(), "connectedSince"); return timestamp; }
/** * Constructor for RawPacket * * @param data * content of the packet as bytestream * @param e * datalink encapsulation for the packet * */ public RawPacket(byte[] data, LinkEncap e) throws ConstructionException { if (data == null) { throw new ConstructionException("Empty data"); } if (e == null) { throw new ConstructionException("Encap not known"); } this.packetData = new byte[data.length]; System.arraycopy(data, 0, this.packetData, 0, data.length); this.encap = e; this.incomingTime = new TimeStamp(System.currentTimeMillis(), "IncomingTime"); this.copyTime = null; }
propMap.put(Buffers.BuffersPropName, b); Long connectedSinceTime = 100000L; TimeStamp timeStamp = new TimeStamp(connectedSinceTime, "connectedSince"); propMap.put(TimeStamp.TimeStampPropName, timeStamp);
Long connectedSinceTime = (connectedSince == null) ? 0 : connectedSince .getTime(); props.add(new TimeStamp(connectedSinceTime, "connectedSince")); props.add(new MacAddress(deriveMacAddress(sid)));
/** * 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"); }
Long connectedSinceTime = (connectedSince == null) ? 0 : connectedSince .getTime(); props.add(new TimeStamp(connectedSinceTime, "connectedSince")); props.add(new MacAddress(deriveMacAddress(sid)));