001 /*
002 *
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements. See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership. The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License. You may obtain a copy of the License at
010 *
011 * http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing,
014 * software distributed under the License is distributed on an
015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016 * KIND, either express or implied. See the License for the
017 * specific language governing permissions and limitations
018 * under the License.
019 *
020 */
021 package org.apache.qpid.jms;
022
023 import java.util.Map;
024
025 import org.apache.qpid.client.SSLConfiguration;
026
027 public interface BrokerDetails
028 {
029
030 /*
031 * Known URL Options
032 * @see ConnectionURL
033 */
034 public static final String OPTIONS_RETRY = "retries";
035 public static final String OPTIONS_CONNECT_TIMEOUT = "connecttimeout";
036 public static final String OPTIONS_CONNECT_DELAY = "connectdelay";
037 public static final String OPTIONS_IDLE_TIMEOUT = "idle_timeout";
038 public static final String OPTIONS_SASL_MECHS = "sasl_mechs";
039 public static final int DEFAULT_PORT = 5672;
040
041 public static final String SOCKET = "socket";
042 public static final String TCP = "tcp";
043 public static final String VM = "vm";
044
045 public static final String DEFAULT_TRANSPORT = TCP;
046
047 public static final String URL_FORMAT_EXAMPLE =
048 "<transport>://<hostname>[:<port Default=\"" + DEFAULT_PORT + "\">][?<option>='<value>'[,<option>='<value>']]";
049
050 public static final long DEFAULT_CONNECT_TIMEOUT = 30000L;
051 public static final boolean USE_SSL_DEFAULT = false;
052
053 // pulled these properties from the new BrokerDetails class in the qpid package
054 public static final String PROTOCOL_TCP = "tcp";
055 public static final String PROTOCOL_TLS = "tls";
056
057 public static final String VIRTUAL_HOST = "virtualhost";
058 public static final String CLIENT_ID = "client_id";
059 public static final String USERNAME = "username";
060 public static final String PASSWORD = "password";
061
062 String getHost();
063
064 void setHost(String host);
065
066 int getPort();
067
068 void setPort(int port);
069
070 String getTransport();
071
072 void setTransport(String transport);
073
074 String getProperty(String key);
075
076 void setProperty(String key, String value);
077
078 /**
079 * Ex: keystore path
080 *
081 * @return the Properties associated with this connection.
082 */
083 public Map<String,String> getProperties();
084
085 /**
086 * Sets the properties associated with this connection
087 *
088 * @param props the new p[roperties.
089 */
090 public void setProperties(Map<String,String> props);
091
092 long getTimeout();
093
094 void setTimeout(long timeout);
095
096 SSLConfiguration getSSLConfiguration();
097
098 void setSSLConfiguration(SSLConfiguration sslConfiguration);
099
100 boolean useSSL();
101
102 String toString();
103
104 boolean equals(Object o);
105 }
|