diff options
author | herbert <herbert.eiselt@highstreet-technologies.com> | 2019-12-14 00:22:47 +0100 |
---|---|---|
committer | herbert <herbert.eiselt@highstreet-technologies.com> | 2019-12-16 10:35:58 +0100 |
commit | 7ce54d65de834d2901285e152c42044e8136c473 (patch) | |
tree | 652e29e86489a9a5390db06a34c79833e0fda9b3 /sdnr/wt/websocketmanager2/provider/src/main/java | |
parent | da4fd6169717cfa04d644d0af0d23dd089a6e373 (diff) |
update old version
of apigateway common data-provider helpserver websocketmanager2
Issue-ID: SDNC-1005
Signed-off-by: herbert <herbert.eiselt@highstreet-technologies.com>
Change-Id: I13990aa4329810bb7a7dd815e6149e9890617d07
Signed-off-by: herbert <herbert.eiselt@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/websocketmanager2/provider/src/main/java')
-rw-r--r-- | sdnr/wt/websocketmanager2/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager2/WebSocketManagerProvider.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sdnr/wt/websocketmanager2/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager2/WebSocketManagerProvider.java b/sdnr/wt/websocketmanager2/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager2/WebSocketManagerProvider.java index 2c54d2a78..881ee1a82 100644 --- a/sdnr/wt/websocketmanager2/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager2/WebSocketManagerProvider.java +++ b/sdnr/wt/websocketmanager2/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/websocketmanager2/WebSocketManagerProvider.java @@ -17,16 +17,22 @@ ******************************************************************************/ package org.onap.ccsdk.features.sdnr.wt.websocketmanager2; +import com.google.common.util.concurrent.ListenableFuture; import javax.servlet.ServletException; import org.opendaylight.mdsal.binding.api.RpcProviderService; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.websocketmanager.rev150105.WebsocketEventInput; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.websocketmanager.rev150105.WebsocketEventOutput; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.websocketmanager.rev150105.WebsocketmanagerService; import org.opendaylight.yangtools.concepts.ObjectRegistration; +import org.opendaylight.yangtools.yang.common.RpcResult; +import org.opendaylight.yangtools.yang.common.RpcResultBuilder; +import org.opendaylight.yangtools.yang.common.RpcError.ErrorType; import org.osgi.service.http.HttpService; import org.osgi.service.http.NamespaceException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class WebSocketManagerProvider extends Blueprint { +public class WebSocketManagerProvider extends Blueprint implements WebsocketmanagerService { private static final Logger LOG = LoggerFactory.getLogger(WebSocketManagerProvider.class); private static final String APPLICATION_NAME = WebSocketManagerProvider.class.getName(); @@ -97,4 +103,14 @@ public class WebSocketManagerProvider extends Blueprint { public void setWsServlet(WebSocketManager wsServlet) { this.wsServlet = wsServlet; } + + @Override + public ListenableFuture<RpcResult<WebsocketEventOutput>> websocketEvent(WebsocketEventInput input) { + if (wsServlet != null) { + return wsServlet.websocketEvent(input); + } else { + RpcResultBuilder<WebsocketEventOutput> result = RpcResultBuilder.failed(); + return result.withError(ErrorType.APPLICATION, "Not intialized").buildFuture(); + } + } } |