This closes #307

This commit is contained in:
Clebert Suconic 2016-01-11 13:22:18 -05:00
commit c4837c2c38
11 changed files with 17 additions and 14 deletions

View File

@ -466,6 +466,7 @@ final class CompressedLargeMessageControllerImpl implements LargeMessageControll
/** from {@link java.io.DataInput} interface */
@Override
@SuppressWarnings("deprecation")
public String readLine() throws IOException {
return getStream().readLine();
}

View File

@ -62,7 +62,6 @@ import io.netty.channel.group.DefaultChannelGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.base64.Base64;
import io.netty.handler.codec.http.ClientCookieEncoder;
import io.netty.handler.codec.http.Cookie;
import io.netty.handler.codec.http.CookieDecoder;
import io.netty.handler.codec.http.DefaultFullHttpRequest;
@ -80,6 +79,7 @@ import io.netty.handler.codec.http.HttpResponse;
import io.netty.handler.codec.http.HttpResponseDecoder;
import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.codec.http.HttpVersion;
import io.netty.handler.codec.http.cookie.ClientCookieEncoder;
import io.netty.handler.ssl.SslHandler;
import io.netty.util.AttributeKey;
import io.netty.util.ResourceLeakDetector;
@ -825,7 +825,7 @@ public class NettyConnector extends AbstractConnector {
Set<Cookie> cookieMap = CookieDecoder.decode(response.headers().get(HttpHeaders.Names.SET_COOKIE));
for (Cookie cookie : cookieMap) {
if (cookie.getName().equals("JSESSIONID")) {
this.cookie = ClientCookieEncoder.encode(cookie);
this.cookie = ClientCookieEncoder.LAX.encode(cookie);
}
}
active = true;

View File

@ -78,6 +78,7 @@ public class ActiveMQJMSVendor extends JMSVendor {
}
@Override
@SuppressWarnings("deprecation")
public Destination createDestination(String name) {
return super.createDestination(name);
}

View File

@ -33,13 +33,13 @@ import org.apache.http.auth.Credentials;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.HttpClient;
import org.apache.http.client.protocol.ClientContext;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.impl.auth.BasicScheme;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.protocol.ExecutionContext;
import org.apache.http.protocol.HttpContext;
import org.apache.http.protocol.HttpCoreContext;
import org.apache.activemq.artemis.api.core.client.ClientMessage;
import org.apache.activemq.artemis.rest.ActiveMQRestLogger;
import org.apache.activemq.artemis.rest.queue.push.xml.XmlHttpHeader;
@ -199,20 +199,19 @@ public class UriStrategy implements PushStrategy {
@Override
public void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException {
AuthState authState = (AuthState) context.getAttribute(ClientContext.TARGET_AUTH_STATE);
AuthState authState = (AuthState) context.getAttribute(HttpClientContext.TARGET_AUTH_STATE);
// If no auth scheme available yet, try to initialize it preemptively
if (authState.getAuthScheme() == null) {
AuthScheme authScheme = (AuthScheme) context.getAttribute("preemptive-auth");
CredentialsProvider credsProvider = (CredentialsProvider) context.getAttribute(ClientContext.CREDS_PROVIDER);
HttpHost targetHost = (HttpHost) context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
CredentialsProvider credsProvider = (CredentialsProvider) context.getAttribute(HttpClientContext.CREDS_PROVIDER);
HttpHost targetHost = (HttpHost) context.getAttribute(HttpCoreContext.HTTP_TARGET_HOST);
if (authScheme != null) {
Credentials creds = credsProvider.getCredentials(new AuthScope(targetHost.getHostName(), targetHost.getPort()));
if (creds == null) {
throw new HttpException("No credentials for preemptive authentication");
}
authState.setAuthScheme(authScheme);
authState.setCredentials(creds);
authState.update(authScheme, creds);
}
}
}

View File

@ -212,6 +212,7 @@ public class RemotingServiceImpl implements RemotingService, ConnectionLifeCycle
Map<String, ProtocolManager> supportedProtocols = new ConcurrentHashMap();
@SuppressWarnings("deprecation")
String protocol = ConfigurationHelper.getStringProperty(TransportConstants.PROTOCOL_PROP_NAME, null, info.getParams());
if (protocol != null) {

View File

@ -1005,6 +1005,7 @@ public interface ActiveMQServerLogger extends BasicLogger {
format = Message.Format.MESSAGE_FORMAT)
void groupingQueueRemoved(int size, SimpleString clusterName);
@SuppressWarnings("deprecation")
@LogMessage(level = Logger.Level.WARN)
@Message(id = 222168, value = "The ''" + TransportConstants.PROTOCOL_PROP_NAME + "'' property is deprecated. If you want this Acceptor to support multiple protocols, use the ''" + TransportConstants.PROTOCOLS_PROP_NAME + "'' property, e.g. with value ''CORE,AMQP,STOMP''",
format = Message.Format.MESSAGE_FORMAT)

View File

@ -79,7 +79,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
this.httpRequest = req;
this.handshaker = wsFactory.newHandshaker(req);
if (this.handshaker == null) {
WebSocketServerHandshakerFactory.sendUnsupportedWebSocketVersionResponse(ctx.channel());
WebSocketServerHandshakerFactory.sendUnsupportedVersionResponse(ctx.channel());
}
else {
ChannelFuture handshake = this.handshaker.handshake(ctx.channel(), req);

View File

@ -47,7 +47,7 @@ public class DestinationGCTest extends EmbeddedBrokerTestSupport {
broker.setMaxPurgedDestinationsPerSweep(1);
PolicyEntry entry = new PolicyEntry();
entry.setGcInactiveDestinations(true);
entry.setInactiveTimoutBeforeGC(3000);
entry.setInactiveTimeoutBeforeGC(3000);
PolicyMap map = new PolicyMap();
map.setDefaultEntry(entry);
broker.setDestinationPolicy(map);

View File

@ -120,7 +120,7 @@ public class AMQ3157Test extends EmbeddedBrokerTestSupport {
PolicyEntry entry = new PolicyEntry();
entry.setGcInactiveDestinations(true);
entry.setInactiveTimoutBeforeGC(5000);
entry.setInactiveTimeoutBeforeGC(5000);
entry.setProducerFlowControl(true);
PolicyMap map = new PolicyMap();
map.setDefaultEntry(entry);

View File

@ -127,7 +127,7 @@ public class AMQ3324Test {
PolicyEntry entry = new PolicyEntry();
entry.setGcInactiveDestinations(true);
entry.setInactiveTimoutBeforeGC(2000);
entry.setInactiveTimeoutBeforeGC(2000);
entry.setProducerFlowControl(true);
entry.setAdvisoryForConsumed(true);
entry.setAdvisoryForFastProducers(true);

View File

@ -267,7 +267,7 @@ public class RequestReplyNoAdvisoryNetworkTest extends JmsMultipleBrokersTestSup
tempReplyQPolicy.setOptimizedDispatch(true);
tempReplyQPolicy.setGcInactiveDestinations(true);
tempReplyQPolicy.setGcWithNetworkConsumers(true);
tempReplyQPolicy.setInactiveTimoutBeforeGC(1000);
tempReplyQPolicy.setInactiveTimeoutBeforeGC(1000);
map.put(replyQWildcard, tempReplyQPolicy);
broker.setDestinationPolicy(map);