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

Remove TODOs (replaced with JIRA tickets)

Issue: SPR-10703
上级 8a4c6eb6
......@@ -42,11 +42,4 @@ public interface MessageHandler {
*/
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;
/**
* TODO
* A resolver for extracting the body of a message.
*
* <p>This {@link HandlerMethodArgumentResolver} should be ordered last as it supports all
* types and does not require the {@link MessageBody} annotation.
......@@ -62,7 +62,6 @@ public class MessageBodyMethodArgumentResolver implements HandlerMethodArgumentR
return message.getPayload();
}
else {
// TODO: use content-type header
return this.converter.fromMessage(message, targetClass);
}
}
......
......@@ -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
* method raised an exception
......
......@@ -339,8 +339,7 @@ public class AnnotationMethodMessageHandler implements MessageHandler, Applicati
invokeExceptionHandler(message, handlerMethod, ex);
}
catch (Throwable ex) {
// TODO
ex.printStackTrace();
logger.error("Error while processing message " + message, ex);
}
}
......
......@@ -255,7 +255,6 @@ public class StompHeaderAccessor extends SimpMessageHeaderAccessor {
return null;
}
String[] rawValues = StringUtils.commaDelimitedListToStringArray(rawValue);
// TODO assertions
return new long[] { Long.valueOf(rawValues[0]), Long.valueOf(rawValues[1])};
}
......
......@@ -73,7 +73,6 @@ public class StompMessageConverter {
String headerContent = new String(byteContent, 0, payloadIndex, STOMP_CHARSET);
Parser parser = new Parser(headerContent);
// TODO: validate command and whether a payload is allowed
StompCommand command = StompCommand.valueOf(parser.nextToken(LF).trim());
Assert.notNull(command, "No command found");
......
......@@ -99,9 +99,6 @@ public class StompProtocolHandler implements SubProtocolHandler {
String payload = ((TextMessage)webSocketMessage).getPayload();
Message<?> message = this.stompMessageConverter.toMessage(payload);
// TODO: validate size limits
// http://stomp.github.io/stomp-specification-1.2.html#Size_Limits
if (logger.isTraceEnabled()) {
logger.trace("Message " + message);
}
......@@ -124,10 +121,6 @@ public class StompProtocolHandler implements SubProtocolHandler {
logger.error("Terminating STOMP session due to failure to send message: ", 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) {
sendErrorMessage(session, error);
......@@ -149,13 +142,11 @@ public class StompProtocolHandler implements SubProtocolHandler {
}
if (StompCommand.MESSAGE.equals(headers.getCommand()) && (headers.getSubscriptionId() == null)) {
// TODO: failed message delivery mechanism
logger.error("Ignoring message, no subscriptionId header: " + message);
return;
}
if (!(message.getPayload() instanceof byte[])) {
// TODO: failed message delivery mechanism
logger.error("Ignoring message, expected byte[] content: " + message);
return;
}
......@@ -197,7 +188,7 @@ public class StompProtocolHandler implements SubProtocolHandler {
else {
throw new StompConversionException("Unsupported version '" + acceptVersions + "'");
}
connectedHeaders.setHeartbeat(0,0); // TODO
connectedHeaders.setHeartbeat(0,0);
Principal principal = session.getPrincipal();
if (principal != null) {
......@@ -210,8 +201,6 @@ public class StompProtocolHandler implements SubProtocolHandler {
}
}
// TODO: security
Message<?> connectedMessage = MessageBuilder.withPayloadAndHeaders(new byte[0], connectedHeaders).build();
byte[] bytes = this.stompMessageConverter.fromMessage(connectedMessage);
session.sendMessage(new TextMessage(new String(bytes, Charset.forName("UTF-8"))));
......
......@@ -188,7 +188,6 @@ public class StompBrokerRelayMessageHandlerIntegrationTests {
stopBrokerAndAwait();
// TODO:
// 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)
// Finish this once the above changes are made.
......
......@@ -89,10 +89,8 @@ public class StandardWebSocketClient extends AbstractWebSocketClient {
configBuidler.preferredSubprotocols(protocols);
try {
// TODO: do not block
Endpoint endpoint = new StandardWebSocketHandlerAdapter(webSocketHandler, session);
this.webSocketContainer.connectToServer(endpoint, configBuidler.build(), uri);
return session;
}
catch (Exception e) {
......
......@@ -20,7 +20,9 @@ import java.net.URI;
import java.security.Principal;
import java.util.List;
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.WebSocketClient;
import org.springframework.context.SmartLifecycle;
......@@ -158,8 +160,8 @@ public class JettyWebSocketClient extends AbstractWebSocketClient implements Sma
JettyWebSocketHandlerAdapter listener = new JettyWebSocketHandlerAdapter(wsHandler, wsSession);
try {
// TODO: do not block
this.client.connect(listener, uri, request).get();
Future<Session> future = this.client.connect(listener, uri, request);
future.get();
return wsSession;
}
catch (Exception e) {
......
......@@ -225,14 +225,6 @@ public class DefaultHandshakeHandler implements HandshakeHandler {
}
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;
}
......
......@@ -50,7 +50,7 @@ public abstract class AbstractHttpSendingTransportHandler extends TransportHandl
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);
// Set content type before writing
......
......@@ -219,7 +219,6 @@ public abstract class AbstractSockJsSession implements WebSocketSession {
}
try {
if (isActive()) {
// TODO: deliver messages "in flight" before sending close frame
try {
// bypass writeFrame
writeFrameInternal(SockJsFrame.closeFrame(status.getCode(), status.getReason()));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册