提交 1c47c8f3 编写于 作者: R Rossen Stoyanchev

Remove TODOs (replaced with JIRA tickets)

Issue: SPR-10703
上级 8a4c6eb6
...@@ -42,11 +42,4 @@ public interface MessageHandler { ...@@ -42,11 +42,4 @@ public interface MessageHandler {
*/ */
void handleMessage(Message<?> message) throws MessagingException; void handleMessage(Message<?> message) throws MessagingException;
/*
* TODO: exceptions
* @throws org.springframework.integration.MessageRejectedException if the handler doesn't accept the message
* @throws org.springframework.integration.MessageHandlingException when something fails during the handling
* @throws org.springframework.integration.MessageDeliveryException when this handler failed to deliver the
*/
} }
...@@ -25,7 +25,7 @@ import org.springframework.util.Assert; ...@@ -25,7 +25,7 @@ import org.springframework.util.Assert;
/** /**
* TODO * A resolver for extracting the body of a message.
* *
* <p>This {@link HandlerMethodArgumentResolver} should be ordered last as it supports all * <p>This {@link HandlerMethodArgumentResolver} should be ordered last as it supports all
* types and does not require the {@link MessageBody} annotation. * types and does not require the {@link MessageBody} annotation.
...@@ -62,7 +62,6 @@ public class MessageBodyMethodArgumentResolver implements HandlerMethodArgumentR ...@@ -62,7 +62,6 @@ public class MessageBodyMethodArgumentResolver implements HandlerMethodArgumentR
return message.getPayload(); return message.getPayload();
} }
else { else {
// TODO: use content-type header
return this.converter.fromMessage(message, targetClass); return this.converter.fromMessage(message, targetClass);
} }
} }
......
...@@ -94,7 +94,7 @@ public class InvocableHandlerMethod extends HandlerMethod { ...@@ -94,7 +94,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
} }
/** /**
* TODO * Invoke the method with the given message.
* *
* @exception Exception raised if no suitable argument resolver can be found, or the * @exception Exception raised if no suitable argument resolver can be found, or the
* method raised an exception * method raised an exception
......
...@@ -339,8 +339,7 @@ public class AnnotationMethodMessageHandler implements MessageHandler, Applicati ...@@ -339,8 +339,7 @@ public class AnnotationMethodMessageHandler implements MessageHandler, Applicati
invokeExceptionHandler(message, handlerMethod, ex); invokeExceptionHandler(message, handlerMethod, ex);
} }
catch (Throwable ex) { catch (Throwable ex) {
// TODO logger.error("Error while processing message " + message, ex);
ex.printStackTrace();
} }
} }
......
...@@ -255,7 +255,6 @@ public class StompHeaderAccessor extends SimpMessageHeaderAccessor { ...@@ -255,7 +255,6 @@ public class StompHeaderAccessor extends SimpMessageHeaderAccessor {
return null; return null;
} }
String[] rawValues = StringUtils.commaDelimitedListToStringArray(rawValue); String[] rawValues = StringUtils.commaDelimitedListToStringArray(rawValue);
// TODO assertions
return new long[] { Long.valueOf(rawValues[0]), Long.valueOf(rawValues[1])}; return new long[] { Long.valueOf(rawValues[0]), Long.valueOf(rawValues[1])};
} }
......
...@@ -73,7 +73,6 @@ public class StompMessageConverter { ...@@ -73,7 +73,6 @@ public class StompMessageConverter {
String headerContent = new String(byteContent, 0, payloadIndex, STOMP_CHARSET); String headerContent = new String(byteContent, 0, payloadIndex, STOMP_CHARSET);
Parser parser = new Parser(headerContent); Parser parser = new Parser(headerContent);
// TODO: validate command and whether a payload is allowed
StompCommand command = StompCommand.valueOf(parser.nextToken(LF).trim()); StompCommand command = StompCommand.valueOf(parser.nextToken(LF).trim());
Assert.notNull(command, "No command found"); Assert.notNull(command, "No command found");
......
...@@ -99,9 +99,6 @@ public class StompProtocolHandler implements SubProtocolHandler { ...@@ -99,9 +99,6 @@ public class StompProtocolHandler implements SubProtocolHandler {
String payload = ((TextMessage)webSocketMessage).getPayload(); String payload = ((TextMessage)webSocketMessage).getPayload();
Message<?> message = this.stompMessageConverter.toMessage(payload); Message<?> message = this.stompMessageConverter.toMessage(payload);
// TODO: validate size limits
// http://stomp.github.io/stomp-specification-1.2.html#Size_Limits
if (logger.isTraceEnabled()) { if (logger.isTraceEnabled()) {
logger.trace("Message " + message); logger.trace("Message " + message);
} }
...@@ -124,10 +121,6 @@ public class StompProtocolHandler implements SubProtocolHandler { ...@@ -124,10 +121,6 @@ public class StompProtocolHandler implements SubProtocolHandler {
logger.error("Terminating STOMP session due to failure to send message: ", t); logger.error("Terminating STOMP session due to failure to send message: ", t);
sendErrorMessage(session, t); sendErrorMessage(session, t);
} }
// TODO: send RECEIPT message if incoming message has "receipt" header
// http://stomp.github.io/stomp-specification-1.2.html#Header_receipt
} }
catch (Throwable error) { catch (Throwable error) {
sendErrorMessage(session, error); sendErrorMessage(session, error);
...@@ -149,13 +142,11 @@ public class StompProtocolHandler implements SubProtocolHandler { ...@@ -149,13 +142,11 @@ public class StompProtocolHandler implements SubProtocolHandler {
} }
if (StompCommand.MESSAGE.equals(headers.getCommand()) && (headers.getSubscriptionId() == null)) { if (StompCommand.MESSAGE.equals(headers.getCommand()) && (headers.getSubscriptionId() == null)) {
// TODO: failed message delivery mechanism
logger.error("Ignoring message, no subscriptionId header: " + message); logger.error("Ignoring message, no subscriptionId header: " + message);
return; return;
} }
if (!(message.getPayload() instanceof byte[])) { if (!(message.getPayload() instanceof byte[])) {
// TODO: failed message delivery mechanism
logger.error("Ignoring message, expected byte[] content: " + message); logger.error("Ignoring message, expected byte[] content: " + message);
return; return;
} }
...@@ -197,7 +188,7 @@ public class StompProtocolHandler implements SubProtocolHandler { ...@@ -197,7 +188,7 @@ public class StompProtocolHandler implements SubProtocolHandler {
else { else {
throw new StompConversionException("Unsupported version '" + acceptVersions + "'"); throw new StompConversionException("Unsupported version '" + acceptVersions + "'");
} }
connectedHeaders.setHeartbeat(0,0); // TODO connectedHeaders.setHeartbeat(0,0);
Principal principal = session.getPrincipal(); Principal principal = session.getPrincipal();
if (principal != null) { if (principal != null) {
...@@ -210,8 +201,6 @@ public class StompProtocolHandler implements SubProtocolHandler { ...@@ -210,8 +201,6 @@ public class StompProtocolHandler implements SubProtocolHandler {
} }
} }
// TODO: security
Message<?> connectedMessage = MessageBuilder.withPayloadAndHeaders(new byte[0], connectedHeaders).build(); Message<?> connectedMessage = MessageBuilder.withPayloadAndHeaders(new byte[0], connectedHeaders).build();
byte[] bytes = this.stompMessageConverter.fromMessage(connectedMessage); byte[] bytes = this.stompMessageConverter.fromMessage(connectedMessage);
session.sendMessage(new TextMessage(new String(bytes, Charset.forName("UTF-8")))); session.sendMessage(new TextMessage(new String(bytes, Charset.forName("UTF-8"))));
......
...@@ -188,7 +188,6 @@ public class StompBrokerRelayMessageHandlerIntegrationTests { ...@@ -188,7 +188,6 @@ public class StompBrokerRelayMessageHandlerIntegrationTests {
stopBrokerAndAwait(); stopBrokerAndAwait();
// TODO:
// 1st message will see ERROR frame (broker shutdown is not but should be detected) // 1st message will see ERROR frame (broker shutdown is not but should be detected)
// 2nd message will be queued (a side effect of CONNECT/CONNECTED-buffering, likely to be removed) // 2nd message will be queued (a side effect of CONNECT/CONNECTED-buffering, likely to be removed)
// Finish this once the above changes are made. // Finish this once the above changes are made.
......
...@@ -89,10 +89,8 @@ public class StandardWebSocketClient extends AbstractWebSocketClient { ...@@ -89,10 +89,8 @@ public class StandardWebSocketClient extends AbstractWebSocketClient {
configBuidler.preferredSubprotocols(protocols); configBuidler.preferredSubprotocols(protocols);
try { try {
// TODO: do not block
Endpoint endpoint = new StandardWebSocketHandlerAdapter(webSocketHandler, session); Endpoint endpoint = new StandardWebSocketHandlerAdapter(webSocketHandler, session);
this.webSocketContainer.connectToServer(endpoint, configBuidler.build(), uri); this.webSocketContainer.connectToServer(endpoint, configBuidler.build(), uri);
return session; return session;
} }
catch (Exception e) { catch (Exception e) {
......
...@@ -20,7 +20,9 @@ import java.net.URI; ...@@ -20,7 +20,9 @@ import java.net.URI;
import java.security.Principal; import java.security.Principal;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.Future;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.client.ClientUpgradeRequest; import org.eclipse.jetty.websocket.client.ClientUpgradeRequest;
import org.eclipse.jetty.websocket.client.WebSocketClient; import org.eclipse.jetty.websocket.client.WebSocketClient;
import org.springframework.context.SmartLifecycle; import org.springframework.context.SmartLifecycle;
...@@ -158,8 +160,8 @@ public class JettyWebSocketClient extends AbstractWebSocketClient implements Sma ...@@ -158,8 +160,8 @@ public class JettyWebSocketClient extends AbstractWebSocketClient implements Sma
JettyWebSocketHandlerAdapter listener = new JettyWebSocketHandlerAdapter(wsHandler, wsSession); JettyWebSocketHandlerAdapter listener = new JettyWebSocketHandlerAdapter(wsHandler, wsSession);
try { try {
// TODO: do not block Future<Session> future = this.client.connect(listener, uri, request);
this.client.connect(listener, uri, request).get(); future.get();
return wsSession; return wsSession;
} }
catch (Exception e) { catch (Exception e) {
......
...@@ -225,14 +225,6 @@ public class DefaultHandshakeHandler implements HandshakeHandler { ...@@ -225,14 +225,6 @@ public class DefaultHandshakeHandler implements HandshakeHandler {
} }
protected boolean isValidOrigin(ServerHttpRequest request) { protected boolean isValidOrigin(ServerHttpRequest request) {
String origin = request.getHeaders().getOrigin();
if (origin != null) {
// UriComponentsBuilder uriBuilder = UriComponentsBuilder.fromHttpUrl(origin);
// TODO
// A simple strategy checks against the current request's scheme/port/host
// Or match scheme, port, and host against configured allowed origins (wild cards for hosts?)
// return false;
}
return true; return true;
} }
......
...@@ -50,7 +50,7 @@ public abstract class AbstractHttpSendingTransportHandler extends TransportHandl ...@@ -50,7 +50,7 @@ public abstract class AbstractHttpSendingTransportHandler extends TransportHandl
AbstractHttpSockJsSession sockJsSession = (AbstractHttpSockJsSession) wsSession; AbstractHttpSockJsSession sockJsSession = (AbstractHttpSockJsSession) wsSession;
String protocol = null; // TODO: https://github.com/sockjs/sockjs-client/issues/130 String protocol = null; // https://github.com/sockjs/sockjs-client/issues/130
sockJsSession.setAcceptedProtocol(protocol); sockJsSession.setAcceptedProtocol(protocol);
// Set content type before writing // Set content type before writing
......
...@@ -219,7 +219,6 @@ public abstract class AbstractSockJsSession implements WebSocketSession { ...@@ -219,7 +219,6 @@ public abstract class AbstractSockJsSession implements WebSocketSession {
} }
try { try {
if (isActive()) { if (isActive()) {
// TODO: deliver messages "in flight" before sending close frame
try { try {
// bypass writeFrame // bypass writeFrame
writeFrameInternal(SockJsFrame.closeFrame(status.getCode(), status.getReason())); writeFrameInternal(SockJsFrame.closeFrame(status.getCode(), status.getReason()));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册