Browse Source

Remove TODOs (replaced with JIRA tickets)

Issue: SPR-10703
pull/351/head
Rossen Stoyanchev 11 years ago
parent
commit
1c47c8f35c
  1. 7
      spring-messaging/src/main/java/org/springframework/messaging/MessageHandler.java
  2. 3
      spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageBodyMethodArgumentResolver.java
  3. 2
      spring-messaging/src/main/java/org/springframework/messaging/handler/method/InvocableHandlerMethod.java
  4. 3
      spring-messaging/src/main/java/org/springframework/messaging/simp/handler/AnnotationMethodMessageHandler.java
  5. 1
      spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java
  6. 1
      spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompMessageConverter.java
  7. 13
      spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompProtocolHandler.java
  8. 1
      spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandlerIntegrationTests.java
  9. 2
      spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/StandardWebSocketClient.java
  10. 6
      spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java
  11. 8
      spring-websocket/src/main/java/org/springframework/web/socket/server/DefaultHandshakeHandler.java
  12. 2
      spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/AbstractHttpSendingTransportHandler.java
  13. 1
      spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractSockJsSession.java

7
spring-messaging/src/main/java/org/springframework/messaging/MessageHandler.java

@ -42,11 +42,4 @@ public interface MessageHandler { @@ -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
*/
}

3
spring-messaging/src/main/java/org/springframework/messaging/handler/annotation/support/MessageBodyMethodArgumentResolver.java

@ -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
* 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();
}
else {
// TODO: use content-type header
return this.converter.fromMessage(message, targetClass);
}
}

2
spring-messaging/src/main/java/org/springframework/messaging/handler/method/InvocableHandlerMethod.java

@ -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
* method raised an exception

3
spring-messaging/src/main/java/org/springframework/messaging/simp/handler/AnnotationMethodMessageHandler.java

@ -339,8 +339,7 @@ public class AnnotationMethodMessageHandler implements MessageHandler, Applicati @@ -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);
}
}

1
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java

@ -255,7 +255,6 @@ public class StompHeaderAccessor extends SimpMessageHeaderAccessor { @@ -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])};
}

1
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompMessageConverter.java

@ -73,7 +73,6 @@ public class StompMessageConverter { @@ -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");

13
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompProtocolHandler.java

@ -99,9 +99,6 @@ public class StompProtocolHandler implements SubProtocolHandler { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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"))));

1
spring-messaging/src/test/java/org/springframework/messaging/simp/stomp/StompBrokerRelayMessageHandlerIntegrationTests.java

@ -188,7 +188,6 @@ public class StompBrokerRelayMessageHandlerIntegrationTests { @@ -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.

2
spring-websocket/src/main/java/org/springframework/web/socket/client/endpoint/StandardWebSocketClient.java

@ -89,10 +89,8 @@ public class StandardWebSocketClient extends AbstractWebSocketClient { @@ -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) {

6
spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java

@ -20,7 +20,9 @@ import java.net.URI; @@ -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 @@ -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) {

8
spring-websocket/src/main/java/org/springframework/web/socket/server/DefaultHandshakeHandler.java

@ -225,14 +225,6 @@ public class DefaultHandshakeHandler implements HandshakeHandler { @@ -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;
}

2
spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/AbstractHttpSendingTransportHandler.java

@ -50,7 +50,7 @@ public abstract class AbstractHttpSendingTransportHandler extends TransportHandl @@ -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

1
spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractSockJsSession.java

@ -219,7 +219,6 @@ public abstract class AbstractSockJsSession implements WebSocketSession { @@ -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()));

Loading…
Cancel
Save