Skip to content

Commit

Permalink
Add core federation and broker connections to the management console
Browse files Browse the repository at this point in the history
  • Loading branch information
ryeats committed Sep 9, 2024
1 parent eef3ea9 commit 28c33b6
Show file tree
Hide file tree
Showing 25 changed files with 1,226 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2744,4 +2744,61 @@ static void getAuthorizationFailureCount(Object source) {

@LogMessage(id = 601781, value = "User {} is getting authorization failure count on target resource: {}", level = LogMessage.Level.INFO)
void getAuthorizationFailureCount(String user, Object source);

static void startFederation(Object source) {
BASE_LOGGER.startFederation(getCaller(), source);
}

@LogMessage(id = 601782, value = "User {} is starting a federation on target resource: {}", level = LogMessage.Level.INFO)
void startFederation(String user, Object source);

static void stopFederation(Object source) {
BASE_LOGGER.stopFederation(getCaller(), source);
}

@LogMessage(id = 601783, value = "User {} is stopping a federation on target resource: {}", level = LogMessage.Level.INFO)
void stopFederation(String user, Object source);

static void isSharedConnection(Object source) {
BASE_LOGGER.isSharedConnection(getCaller(), source);
}

@LogMessage(id = 601784, value = "User {} is querying isSharedConnection on target resource: {}", level = LogMessage.Level.INFO)
void isSharedConnection(String user, Object source);

static void isPull(Object source) {
BASE_LOGGER.isPull(getCaller(), source);
}

@LogMessage(id = 601785, value = "User {} is querying isPull on target resource: {}", level = LogMessage.Level.INFO)
void isPull(String user, Object source);

static void getPriority(Object source) {
BASE_LOGGER.getPriority(getCaller(), source);
}

@LogMessage(id = 601786, value = "User {} is getting priority on target resource: {}", level = LogMessage.Level.INFO)
void getPriority(String user, Object source);

static void isOpen(Object source) {
BASE_LOGGER.isOpen(getCaller(), source);
}

@LogMessage(id = 601787, value = "User {} is querying isOpen on target resource: {}", level = LogMessage.Level.INFO)
void isOpen(String user, Object source);

static void getUri(Object source) {
BASE_LOGGER.getUri(getCaller(), source);
}

@LogMessage(id = 601788, value = "User {} is getting uri on target resource: {}", level = LogMessage.Level.INFO)
void getUri(String user, Object source);

static void getProtocol(Object source) {
BASE_LOGGER.getProtocol(getCaller(), source);
}

@LogMessage(id = 601789, value = "User {} is getting protocol on target resource: {}", level = LogMessage.Level.INFO)
void getProtocol(String user, Object source);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.api.core.management;

/**
* A BrokerConnectionControl is used to manage a BrokerConnections.
*/
public interface BrokerConnectionControl extends ActiveMQComponentControl {

/**
* Returns {@code true} if this connection is open, {@code false} else.
*/
@Attribute(desc = "whether this connection is open")
boolean isOpen();

/**
* Returns the name of this broker connection
*/
@Attribute(desc = "name of this broker connection")
String getName();

/**
* Returns the connection uri for this broker connection.
*/
@Attribute(desc = "connection uri for this broker connection")
String getUri();

/**
* Returns the user this broker connection is using.
*/
@Attribute(desc = "the user this broker connection is using")
String getUser();

/**
* Returns the protocol this broker connection is using.
*/
@Attribute(desc = "protocol this broker connection is using")
String getProtocol();

/**
* Returns the retry interval used by this broker connection.
*/
@Attribute(desc = "retry interval used by this broker connection")
long getRetryInterval();

/**
* Returns the number of reconnection attempts used by this broker connection.
*/
@Attribute(desc = "number of reconnection attempts used by this broker connection")
int getReconnectAttempts();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.api.core.management;

/**
* A federationControl is used to manage a federation.
*/
public interface FederationControl extends ActiveMQComponentControl {

/**
* Returns the name of this federation
*/
@Attribute(desc = "name of this federation")
String getName();

/**
* Returns the name of the user the federation is associated with.
*/
@Attribute(desc = "name of the user the federation is associated with")
String getUser();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.api.core.management;

/**
* A BridgeControl is used to manage a federation stream.
*/
public interface FederationRemoteConsumerControl {

/**
* Returns the name of the queue that is being federated too
*/
@Attribute(desc = "name of the queue that is being federated too")
String getQueueName();

/**
* Returns the address this remote consumer will forward messages from.
*/
@Attribute(desc = "address this remote consumer will forward messages from")
String getAddress();

/**
* Returns the priority of this remote consumer will consumer messages.
*/
@Attribute(desc = "address this remote consumer will consumer messages")
int getPriority();

/**
* Returns the routing type associated with this address.
*/
@Attribute(desc = "routing type for this address")
String getRoutingType();

/**
* Returns the filter string associated with this remote consumer.
*/
@Attribute(desc = "filter string associated with this remote consumer")
String getFilterString();

/**
* Returns the queue filter string associated with this remote consumer.
*/
@Attribute(desc = "queue filter string associated with this remote consumer")
String getQueueFilterString();

/**
* Returns the fully qualified queue name associated with this remote consumer.
*/
// @Attribute(desc = "fully qualified queue name associated with this remote consumer")
// String getFqqn();

/**
* Returns the number of messages that have been federated for this address.
*/
@Attribute(desc = "number of messages that have been federated for this address")
long getFederatedMessageCount();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.api.core.management;

/**
* A BridgeControl is used to manage a federation stream.
*/
public interface FederationStreamControl {

/**
* Returns the name of this federation stream
*/
@Attribute(desc = "name of this federation stream")
String getName();

/**
* Returns any list of static connectors used by this federation stream
*/
@Attribute(desc = "list of static connectors used by this federation stream")
String[] getStaticConnectors() throws Exception;

/**
* Returns the name of the discovery group used by this federation stream.
*/
@Attribute(desc = "name of the discovery group used by this federation stream")
String getDiscoveryGroupName();

/**
* Returns the retry interval used by this federation stream.
*/
@Attribute(desc = "retry interval used by this federation stream")
long getRetryInterval();

/**
* Returns the retry interval multiplier used by this federation stream.
*/
@Attribute(desc = "retry interval multiplier used by this federation stream")
double getRetryIntervalMultiplier();

/**
* Returns the max retry interval used by this federation stream.
*/
@Attribute(desc = "max retry interval used by this federation stream")
long getMaxRetryInterval();

/**
* Returns the number of reconnection attempts used by this federation stream.
*/
@Attribute(desc = "number of reconnection attempts used by this federation stream")
int getReconnectAttempts();

/**
* Returns {@code true} if steam allows a shared connection, {@code false} else.
*/
@Attribute(desc = "whether this stream will allow the connection to be shared")
boolean isSharedConnection();

/**
* Returns {@code true} if this connection is configured to pull, {@code false} else.
*/
@Attribute(desc = "whether this connection is configured to pull")
boolean isPull();

/**
* Returns {@code true} the connection is configured for HA, {@code false} else.
*/
@Attribute(desc = "whether this connection is configured for HA")
boolean isHA();

/**
* Returns the name of the user the federation is associated with
*/
@Attribute(desc = "name of the user the federation is associated with")
String getUser();

}
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ public ObjectName getBroadcastGroupObjectName(final String name) throws Exceptio
return createObjectName("broadcast-group", name);
}

/**
* Returns the ObjectName used by BrokerConnectionControl.
*
* @see BrokerConnectionControl
*/
public ObjectName getBrokerConnectionObjectName(String name) throws Exception {
return createObjectName("broker-connection", name);
}

/**
* Returns the ObjectName used by BridgeControl.
*
Expand All @@ -135,6 +144,15 @@ public ObjectName getBridgeObjectName(final String name) throws Exception {
return createObjectName("bridge", name);
}

/**
* Returns the ObjectName used by FederationControl.
*
* @see FederationControl
*/
public ObjectName getFederationObjectName(String name) throws Exception {
return createObjectName("federation", name);
}

/**
* Returns the ObjectName used by ClusterConnectionControl.
*
Expand Down Expand Up @@ -169,4 +187,28 @@ public ObjectName getManagementContextObjectName() throws Exception {
public ObjectName getSecurityObjectName() throws Exception {
return ObjectName.getInstance("hawtio:type=security,area=jmx,name=ArtemisJMXSecurity");
}

/**
* Returns the ObjectName used by FederationStreamControl.
*
* @see FederationStreamControl
*/
public ObjectName getFederationStreamObjectName(SimpleString federationName,
SimpleString streamName) throws Exception {
return ObjectName.getInstance(String.format("%s,component=federations,name=%s,streamName=%s", getActiveMQServerName(), ObjectName.quote(federationName.toString()), ObjectName.quote(streamName.toString().toLowerCase())));
}

/**
* Returns the ObjectName used by FederationRemoteConsumerControl.
*
* @see FederationRemoteConsumerControl
*/
public ObjectName getFederationRemoteConsumerObjectName(final SimpleString federationName,
final SimpleString streamName,
final SimpleString address,
final SimpleString queueName,
RoutingType routingType) throws Exception {
return ObjectName.getInstance(String.format("%s,component=federations,name=%s,streamName=%s,address=%s,subcomponent=queues,routing-type=%s,queue=%s", getActiveMQServerName(), ObjectName.quote(federationName.toString()), ObjectName.quote(streamName.toString()), ObjectName.quote(address.toString()), ObjectName.quote(routingType.toString().toLowerCase()), ObjectName.quote(queueName.toString())));
}

}
Loading

0 comments on commit 28c33b6

Please sign in to comment.