1 45 package org.exolab.jms.net.tcp; 46 47 import org.exolab.jms.net.socket.SocketRequestInfo; 48 import org.exolab.jms.net.util.SSLProperties; 49 import org.exolab.jms.net.util.Properties; 50 import org.exolab.jms.net.connector.ResourceException; 51 import org.exolab.jms.net.uri.URI; 52 53 54 62 public class TCPSRequestInfo extends SocketRequestInfo { 63 64 68 private SSLProperties _sslProperties = null; 69 70 75 private boolean _needCientAuth = false; 76 77 81 private static final String NEED_CLIENT_AUTH = "needClientAuth"; 82 83 84 89 public TCPSRequestInfo(URI uri) { 90 super(uri); 91 } 92 93 100 public TCPSRequestInfo(URI uri, Properties properties) 101 throws ResourceException { 102 super(uri, properties); 103 SSLProperties ssl = new SSLProperties(properties); 104 if (!ssl.isEmpty()) { 105 setSSLProperties(ssl); 106 } 107 setNeedClientAuth( 108 properties.getBoolean(NEED_CLIENT_AUTH, _needCientAuth)); 109 } 110 111 116 public SSLProperties getSSLProperties() { 117 return _sslProperties; 118 } 119 120 125 public void setSSLProperties(SSLProperties properties) { 126 _sslProperties = properties; 127 } 128 129 135 public void setNeedClientAuth(boolean required) { 136 _needCientAuth = required; 137 } 138 139 144 public boolean getNeedClientAuth() { 145 return _needCientAuth; 146 } 147 148 153 public void export(Properties properties) { 154 super.export(properties); 155 SSLProperties ssl = getSSLProperties(); 156 if (ssl != null) { 157 ssl.export(properties); 158 } 159 properties.set(NEED_CLIENT_AUTH, getNeedClientAuth()); 160 } 161 162 169 public boolean equals(Object other) { 170 boolean equal = false; 171 if (other instanceof TCPSRequestInfo && super.equals(other)) { 172 TCPSRequestInfo info = (TCPSRequestInfo) other; 173 if (_needCientAuth == info._needCientAuth 174 && equals(_sslProperties, info._sslProperties)) { 175 equal = true; 176 } 177 } 178 return equal; 179 } 180 181 } 182 | Popular Tags |