Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package org.apache.activemq.artemis.core.management.impl.view;

import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Set;
Expand All @@ -30,8 +31,6 @@
import org.apache.activemq.artemis.utils.JsonLoader;
import org.apache.activemq.artemis.utils.StringUtil;

import static org.apache.activemq.artemis.utils.TimestampUtil.formatEpochMillis;

public class ConnectionView extends ActiveMQAbstractView<RemotingConnection> {

private static final String defaultSortField = ConnectionField.CONNECTION_ID.getName();
Expand Down Expand Up @@ -62,7 +61,7 @@ public JsonObjectBuilder toJson(RemotingConnection connection) {
.add(ConnectionField.CONNECTION_ID.getName(), toString(connection.getID()))
.add(ConnectionField.REMOTE_ADDRESS.getName(), toString(connection.getRemoteAddress()))
.add(ConnectionField.USERS.getName(), StringUtil.joinStringList(users, ","))
.add(ConnectionField.CREATION_TIME.getName(), formatEpochMillis((connection.getCreationTime())))
.add(ConnectionField.CREATION_TIME.getName(), new Date(connection.getCreationTime()).toString())
.add(ConnectionField.IMPLEMENTATION.getName(), toString(connection.getClass().getSimpleName()))
.add(ConnectionField.PROTOCOL.getName(), toString(connection.getProtocolName()))
.add(ConnectionField.CLIENT_ID.getName(), toString(connection.getClientID()))
Expand All @@ -89,7 +88,7 @@ public Object getField(RemotingConnection connection, String fieldName) {
}
return StringUtil.joinStringList(users, ",");
case CREATION_TIME:
return connection.getCreationTime();
return new Date(connection.getCreationTime());
case IMPLEMENTATION:
return connection.getClass().getSimpleName();
case PROTOCOL:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
package org.apache.activemq.artemis.core.management.impl.view;

import java.util.Date;

import org.apache.activemq.artemis.core.management.impl.ActiveMQServerControlImpl;
import org.apache.activemq.artemis.core.management.impl.view.predicate.ConsumerFilterPredicate;
import org.apache.activemq.artemis.core.server.ActiveMQServer;
Expand All @@ -24,8 +26,6 @@
import org.apache.activemq.artemis.json.JsonObjectBuilder;
import org.apache.activemq.artemis.utils.JsonLoader;

import static org.apache.activemq.artemis.utils.TimestampUtil.formatEpochMillis;

public class ConsumerView extends ActiveMQAbstractView<ServerConsumer> {

public static final String CONSUMER_STATUS_OK = "OK";
Expand Down Expand Up @@ -69,15 +69,15 @@ public JsonObjectBuilder toJson(ServerConsumer consumer) {
.add(ConsumerField.ADDRESS.getName(), toString(consumer.getQueueAddress()))
.add(ConsumerField.LOCAL_ADDRESS.getName(), toString(consumer.getConnectionLocalAddress()))
.add(ConsumerField.REMOTE_ADDRESS.getName(), toString(consumer.getConnectionRemoteAddress()))
.add(ConsumerField.CREATION_TIME.getName(), formatEpochMillis(consumer.getCreationTime()))
.add(ConsumerField.CREATION_TIME.getName(), new Date(consumer.getCreationTime()).toString())
.add(ConsumerField.MESSAGES_IN_TRANSIT.getName(), toString(consumer.getMessagesInTransit()))
.add(ConsumerField.MESSAGES_IN_TRANSIT_SIZE.getName(), toString(consumer.getMessagesInTransitSize()))
.add(ConsumerField.MESSAGES_DELIVERED.getName(), toString(consumer.getMessagesDelivered()))
.add(ConsumerField.MESSAGES_DELIVERED_SIZE.getName(), toString(consumer.getMessagesDeliveredSize()))
.add(ConsumerField.MESSAGES_ACKNOWLEDGED.getName(), toString(consumer.getMessagesAcknowledged()))
.add(ConsumerField.MESSAGES_ACKNOWLEDGED_AWAITING_COMMIT.getName(), toString(consumer.getMessagesAcknowledgedAwaitingCommit()))
.add(ConsumerField.LAST_DELIVERED_TIME.getName(), formatEpochMillis(consumer.getLastDeliveredTime()))
.add(ConsumerField.LAST_ACKNOWLEDGED_TIME.getName(), formatEpochMillis(consumer.getLastAcknowledgedTime()))
.add(ConsumerField.LAST_DELIVERED_TIME.getName(), consumer.getLastDeliveredTime())
.add(ConsumerField.LAST_ACKNOWLEDGED_TIME.getName(), consumer.getLastAcknowledgedTime())
.add(ConsumerField.STATUS.getName(), ConsumerView.checkConsumerStatus(consumer, server));

return obj;
Expand Down Expand Up @@ -106,7 +106,7 @@ public Object getField(ServerConsumer consumer, String fieldName) {
case FILTER -> consumer.getFilterString();
case LOCAL_ADDRESS -> consumer.getConnectionLocalAddress();
case REMOTE_ADDRESS -> consumer.getConnectionRemoteAddress();
case CREATION_TIME -> consumer.getCreationTime();
case CREATION_TIME -> new Date(consumer.getCreationTime());
case MESSAGES_IN_TRANSIT -> consumer.getMessagesInTransit();
case MESSAGES_IN_TRANSIT_SIZE -> consumer.getMessagesInTransitSize();
case MESSAGES_DELIVERED -> consumer.getMessagesDelivered();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import org.apache.activemq.artemis.json.JsonObjectBuilder;
import org.apache.activemq.artemis.utils.JsonLoader;

import static org.apache.activemq.artemis.utils.TimestampUtil.formatEpochMillis;

public class ProducerView extends ActiveMQAbstractView<ServerProducer> {

private static final String defaultSortField = ProducerField.CREATION_TIME.getName();
Expand Down Expand Up @@ -64,7 +62,7 @@ public JsonObjectBuilder toJson(ServerProducer producer) {
.add(ProducerField.ADDRESS.getName(), toString(Objects.requireNonNullElse(producer.getAddress(), session.getDefaultAddress())))
.add(ProducerField.LOCAL_ADDRESS.getName(), toString(session.getRemotingConnection().getTransportConnection().getLocalAddress()))
.add(ProducerField.REMOTE_ADDRESS.getName(), toString(session.getRemotingConnection().getTransportConnection().getRemoteAddress()))
.add(ProducerField.CREATION_TIME.getName(), formatEpochMillis((producer.getCreationTime())))
.add(ProducerField.CREATION_TIME.getName(), toString(producer.getCreationTime()))
.add(ProducerField.MESSAGE_SENT.getName(), producer.getMessagesSent())
.add(ProducerField.MESSAGE_SENT_SIZE.getName(), producer.getMessagesSentSize())
.add(ProducerField.LAST_PRODUCED_MESSAGE_ID.getName(), toString(producer.getLastProducedMessageID()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@
*/
package org.apache.activemq.artemis.core.management.impl.view;

import org.apache.activemq.artemis.json.JsonObjectBuilder;
import java.util.Date;
import java.util.Objects;

import org.apache.activemq.artemis.core.management.impl.view.predicate.SessionFilterPredicate;
import org.apache.activemq.artemis.core.server.ServerSession;
import org.apache.activemq.artemis.json.JsonObjectBuilder;
import org.apache.activemq.artemis.utils.JsonLoader;

import static org.apache.activemq.artemis.utils.TimestampUtil.formatEpochMillis;

public class SessionView extends ActiveMQAbstractView<ServerSession> {

private static final String defaultSortField = SessionField.ID.getName();
Expand All @@ -45,7 +44,7 @@ public JsonObjectBuilder toJson(ServerSession session) {
.add(SessionField.ID.getName(), toString(session.getName()))
.add(SessionField.USER.getName(), toString(session.getUsername()))
.add(SessionField.VALIDATED_USER.getName(), toString(session.getValidatedUser()))
.add(SessionField.CREATION_TIME.getName(), formatEpochMillis((session.getCreationTime())))
.add(SessionField.CREATION_TIME.getName(), new Date(session.getCreationTime()).toString())
.add(SessionField.CONSUMER_COUNT.getName(), session.getConsumerCount())
.add(SessionField.PRODUCER_COUNT.getName(), session.getProducerCount())
.add(SessionField.CONNECTION_ID.getName(), session.getConnectionID().toString())
Expand All @@ -61,7 +60,7 @@ public Object getField(ServerSession session, String fieldName) {
case ID -> session.getName();
case USER -> session.getUsername();
case VALIDATED_USER -> session.getValidatedUser();
case CREATION_TIME -> session.getCreationTime();
case CREATION_TIME -> new Date(session.getCreationTime());
case CONSUMER_COUNT -> session.getConsumerCount();
case PRODUCER_COUNT -> session.getProducerCount();
case CONNECTION_ID -> session.getConnectionID();
Expand Down