001 /* 002 * Copyright 2009 Red Hat, Inc. 003 * Red Hat licenses this file to you under the Apache License, version 004 * 2.0 (the "License"); you may not use this file except in compliance 005 * with the License. You may obtain a copy of the License at 006 * http://www.apache.org/licenses/LICENSE-2.0 007 * Unless required by applicable law or agreed to in writing, software 008 * distributed under the License is distributed on an "AS IS" BASIS, 009 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 010 * implied. See the License for the specific language governing 011 * permissions and limitations under the License. 012 */ 013 014 package org.hornetq.api.core.management; 015 016 import java.util.Map; 017 018 /** 019 * A ClusterConnectionControl is used to manage a cluster connection. 020 * 021 * @author <a href="jmesnil@redhat.com">Jeff Mesnil</a> 022 * 023 */ 024 public interface ClusterConnectionControl extends HornetQComponentControl 025 { 026 /** 027 * Returns the configuration name of this cluster connection. 028 */ 029 String getName(); 030 031 /** 032 * Returns the address used by this cluster connection. 033 */ 034 String getAddress(); 035 036 /** 037 * Returns the node ID used by this cluster connection. 038 */ 039 String getNodeID(); 040 041 /** 042 * Return whether this cluster connection use duplicate detection. 043 */ 044 boolean isDuplicateDetection(); 045 046 /** 047 * Return whether this cluster connection forward messages when it has no local consumers. 048 */ 049 boolean isForwardWhenNoConsumers(); 050 051 /** 052 * Returns the maximum number of hops used by this cluster connection. 053 */ 054 int getMaxHops(); 055 056 /** 057 * Returns the pairs of live-backup connectors used by this cluster connection. 058 */ 059 Object[] getStaticConnectorNamePairs(); 060 061 /** 062 * Returns the pairs of live-backup connectors used by this cluster connection 063 * using JSON serialization. 064 */ 065 String getStaticConnectorNamePairsAsJSON() throws Exception; 066 067 /** 068 * Returns the name of the discovery group used by this cluster connection. 069 */ 070 String getDiscoveryGroupName(); 071 072 /** 073 * Returns the connection retry interval used by this cluster connection. 074 */ 075 long getRetryInterval(); 076 077 /** 078 * Returns a map of the nodes connected to this cluster connection. 079 * <br> 080 * keys are node IDs, values are the addresses used to connect to the nodes. 081 */ 082 Map<String, String> getNodes() throws Exception; 083 }