/** * Indicates whether some other object is "equal to" this one. * * @param obj Object with which to compare * @return True if this object is the same as the obj argument; false otherwise. */ @Override public boolean equals(final Object obj) { if (logger.isTraceEnabled()) { logger.trace("equals(" + obj + ")"); } if (obj == null) { return false; } if (obj instanceof ActiveMQResourceAdapter) { return raProperties.equals(((ActiveMQResourceAdapter) obj).getProperties()); } return false; }
/** * Indicates whether some other object is "equal to" this one. * * @param obj Object with which to compare * @return True if this object is the same as the obj argument; false otherwise. */ @Override public boolean equals(final Object obj) { if (logger.isTraceEnabled()) { logger.trace("equals(" + obj + ")"); } if (obj == null) { return false; } if (obj instanceof ActiveMQResourceAdapter) { return raProperties.equals(((ActiveMQResourceAdapter) obj).getProperties()); } return false; }
/** * Get a connection request info instance * * @param info The instance that should be updated; may be <code>null</code> * @return The instance */ private ActiveMQRAConnectionRequestInfo getCRI(final ActiveMQRAConnectionRequestInfo info) { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("getCRI(" + info + ")"); } if (info == null) { // Create a default one return new ActiveMQRAConnectionRequestInfo(ra.getProperties(), mcfProperties.getType()); } else { // Fill the one with any defaults info.setDefaults(ra.getProperties()); return info; } }
/** * Get a connection request info instance * * @param info The instance that should be updated; may be <code>null</code> * @return The instance */ private ActiveMQRAConnectionRequestInfo getCRI(final ActiveMQRAConnectionRequestInfo info) { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("getCRI(" + info + ")"); } if (info == null) { // Create a default one return new ActiveMQRAConnectionRequestInfo(ra.getProperties(), mcfProperties.getType()); } else { // Fill the one with any defaults info.setDefaults(ra.getProperties()); return info; } }
/** * Get the client ID * * @return The client ID * @throws JMSException Thrown if an error occurs */ @Override public String getClientID() throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("getClientID()"); } checkClosed(); if (clientID == null) { return ((ActiveMQResourceAdapter) mcf.getResourceAdapter()).getProperties().getClientID(); } return clientID; }
/** * Get the client ID * * @return The client ID * @throws JMSException Thrown if an error occurs */ @Override public String getClientID() throws JMSException { if (ActiveMQRALogger.LOGGER.isTraceEnabled()) { ActiveMQRALogger.LOGGER.trace("getClientID()"); } checkClosed(); if (clientID == null) { return ((ActiveMQResourceAdapter) mcf.getResourceAdapter()).getProperties().getClientID(); } return clientID; }
@Test public void testConnectionParameterStringParsing() throws Exception { ActiveMQResourceAdapter resourceAdapter = new ActiveMQResourceAdapter(); resourceAdapter.setConnectionParameters("enabledProtocols=TLS1\\,TLS1.2;sslEnabled=true"); assertEquals(resourceAdapter.getProperties().getParsedConnectionParameters().get(0).get("enabledProtocols"), "TLS1,TLS1.2"); resourceAdapter.setConnectionParameters("enabledProtocols=TLS1\\,TLS1.2;sslEnabled=true,enabledProtocols=TLS1.3\\,TLS1.4\\,TLS1.5;sslEnabled=true"); assertEquals(resourceAdapter.getProperties().getParsedConnectionParameters().get(0).get("enabledProtocols"), "TLS1,TLS1.2"); assertEquals(resourceAdapter.getProperties().getParsedConnectionParameters().get(1).get("enabledProtocols"), "TLS1.3,TLS1.4,TLS1.5"); try { resourceAdapter.setConnectionParameters("enabledProtocols=TLS1,TLS1.2;sslEnabled=true,enabledProtocols=TLS1,TLS1.2;sslEnabled=true"); fail("This should have failed"); } catch (Exception e) { // ignore } }
info.setPassword(password); info.setClientID(clientID); info.setDefaults(((ActiveMQResourceAdapter) mcf.getResourceAdapter()).getProperties());
info.setPassword(password); info.setClientID(clientID); info.setDefaults(((ActiveMQResourceAdapter) mcf.getResourceAdapter()).getProperties());