-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #106: Do not send error responses via WebSocket for invalid liv…
…e command responses. If for example a device sends an invalid live response it probably is not able to handle an error response from Ditto. However, if it explicitly requests a response it will receive sucha an error response. Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
- Loading branch information
Juergen Fickel
committed
Dec 15, 2021
1 parent
7c645b5
commit 73a333b
Showing
8 changed files
with
289 additions
and
86 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
...vice/src/main/java/org/eclipse/ditto/gateway/service/endpoints/routes/websocket/NoOp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) 2021 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.eclipse.ditto.gateway.service.endpoints.routes.websocket; | ||
|
||
import javax.annotation.Nullable; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
import org.eclipse.ditto.gateway.service.streaming.StreamControlMessage; | ||
|
||
/** | ||
* This is a {@code StreamControlMessage} to explicitly express, that the WebSocket stream should remain as it is. | ||
*/ | ||
@Immutable | ||
final class NoOp implements StreamControlMessage { | ||
|
||
@Nullable private static NoOp instance; | ||
|
||
private NoOp() { | ||
super(); | ||
} | ||
|
||
/** | ||
* Returns an instance of {@code NoOp}. | ||
* | ||
* @return the instance. | ||
*/ | ||
static NoOp getInstance() { | ||
var result = instance; | ||
if (null == result) { | ||
result = new NoOp(); | ||
instance = result; | ||
} | ||
return result; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.