public static Timestamp getDefaultInstance(String defaultValue) { return new Timestamp(Long.valueOf(defaultValue)); }
private ContainerNode createStats(final Stat stat, final Timestamp timestamp) { final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> builder = Builders.containerBuilder().withNodeIdentifier(new NodeIdentifier(Stats.QNAME)); builder.withChild(ImmutableNodes.leafNode(PEER_STATS_TIMESTAMP_QNAME, timestamp.getValue())); final Tlvs tlvs = stat.getTlvs(); if (tlvs != null) { statsForTlvs(tlvs, builder); } return builder.build(); }
private ContainerNode createMirrors(final Mirror mirror, final Timestamp timestamp) { final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> builder = Builders.containerBuilder().withNodeIdentifier(new NodeIdentifier(Mirrors.QNAME)); builder.withChild(ImmutableNodes.leafNode(PEER_MIRROR_INFORMATION_QNAME, toDom(MirrorInformationCode.forValue( mirror.getTlvs().getMirrorInformationTlv().getCode().getIntValue())))); builder.withChild(ImmutableNodes.leafNode(PEER_MIRROR_TIMESTAMP_QNAME, timestamp.getValue())); return builder.build(); }
public static Timestamp getDefaultInstance(String defaultValue) { return new Timestamp(java.lang.Long.valueOf(defaultValue)); }
private ContainerNode createPeerSessionUp(final PeerUp peerUp, final Timestamp timestamp) { final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> builder = Builders .containerBuilder() .withNodeIdentifier(new NodeIdentifier(PeerSession.QNAME)) .withChild( ImmutableNodes.leafNode(PEER_LOCAL_ADDRESS_QNAME, getStringIpAddress(peerUp.getLocalAddress()))) .withChild( ImmutableNodes.leafNode(PEER_LOCAL_PORT_QNAME, peerUp .getLocalPort().getValue())) .withChild( ImmutableNodes.leafNode(PEER_REMOTE_PORT_QNAME, peerUp .getRemotePort().getValue())) .withChild(ImmutableNodes.leafNode(PEER_STATUS_QNAME, "up")) .withChild( ImmutableNodes.leafNode(PEER_UP_TIMESTAMP_QNAME, timestamp.getValue())); if (this.receivedOpenCodec != null) { builder.withChild((ContainerNode) this.receivedOpenCodec.serialize(peerUp.getReceivedOpen())); } if (this.sentOpenCodec != null) { builder.withChild((ContainerNode) this.sentOpenCodec.serialize(peerUp.getSentOpen())); } return builder.build(); }
public static Timestamp getDefaultInstance(String defaultValue) { return new Timestamp(Long.valueOf(defaultValue)); }
public static Timestamp getDefaultInstance(String defaultValue) { return new Timestamp(Long.valueOf(defaultValue)); }
private static void updateSentMsg(final Sent sent) { Preconditions.checkNotNull(sent); final long count = sent.getCount() == null ? 0L : sent.getCount().getValue(); sent.setCount(new ZeroBasedCounter32(count + 1)); sent.setTimestamp(new Timestamp(StatisticsUtil.getCurrentTimestampInSeconds())); }
private static void updateReceivedMsg(final Received received) { Preconditions.checkNotNull(received); final long count = received.getCount() == null ? 0L : received.getCount().getValue(); received.setCount(new ZeroBasedCounter32(count + 1)); received.setTimestamp(new Timestamp(StatisticsUtil.getCurrentTimestampInSeconds())); }
private void updateReceivedMsgErr(@Nonnull final Notify error) { Preconditions.checkNotNull(error); final List<ErrorReceived> errList = this.errMsgs.getErrorReceived(); ErrorReceived received = null; for (ErrorReceived err : errList) { if (err.getErrorCode().equals(error.getErrorCode()) && err.getErrorSubcode().equals(error.getErrorSubcode())) { received = err; break; } } if (null == received) { received = new ErrorReceived(); received.setErrorCode(error.getErrorCode()); received.setErrorSubcode(error.getErrorSubcode()); received.setCount(new ZeroBasedCounter32(0L)); errList.add(received); } received.setCount(new ZeroBasedCounter32(received.getCount().getValue() + 1)); final Timestamp curTimestamp = new Timestamp(StatisticsUtil.getCurrentTimestampInSeconds()); received.setTimestamp(curTimestamp); this.errMsgsRecvTotal.setCount(new ZeroBasedCounter32(this.errMsgsRecvTotal.getCount().getValue() + 1)); this.errMsgsRecvTotal.setTimestamp(curTimestamp); }
private void updateSentMsgErr(@Nonnull final Notify error) { Preconditions.checkNotNull(error); final List<ErrorSent> errList = this.errMsgs.getErrorSent(); ErrorSent sent = null; for (ErrorSent err : errList) { if (err.getErrorCode().equals(error.getErrorCode()) && err.getErrorSubcode().equals(error.getErrorSubcode())) { sent = err; break; } } if (null == sent) { sent = new ErrorSent(); sent.setErrorCode(error.getErrorCode()); sent.setErrorSubcode(error.getErrorSubcode()); sent.setCount(new ZeroBasedCounter32(0L)); errList.add(sent); } sent.setCount(new ZeroBasedCounter32(sent.getCount().getValue() + 1)); final Timestamp curTimestamp = new Timestamp(StatisticsUtil.getCurrentTimestampInSeconds()); sent.setTimestamp(curTimestamp); this.errMsgsSentTotal.setCount(new ZeroBasedCounter32(this.errMsgsSentTotal.getCount().getValue() + 1)); this.errMsgsSentTotal.setTimestamp(curTimestamp); }