diff options
Diffstat (limited to 'ecomp-sdk/epsdk-core')
-rw-r--r-- | ecomp-sdk/epsdk-core/pom.xml | 16 | ||||
-rw-r--r-- | ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/socket/WebRTCSocket.java | 33 |
2 files changed, 26 insertions, 23 deletions
diff --git a/ecomp-sdk/epsdk-core/pom.xml b/ecomp-sdk/epsdk-core/pom.xml index 8837e656..64409326 100644 --- a/ecomp-sdk/epsdk-core/pom.xml +++ b/ecomp-sdk/epsdk-core/pom.xml @@ -19,7 +19,7 @@ <!-- properties are inherited from parent --> <properties> - <drools.version>6.4.0.Final</drools.version> + <drools.version>7.0.0.Final</drools.version> </properties> <!-- repositories are inherited from parent --> @@ -154,7 +154,7 @@ <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> - <version>1.3.0.RELEASE</version> + <version>1.5.11.RELEASE</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> @@ -228,7 +228,7 @@ <dependency> <groupId>com.mchange</groupId> <artifactId>c3p0</artifactId> - <version>0.9.5.2</version> + <version>0.9.5.3</version> </dependency> <!-- Apache Tiles --> <dependency> @@ -439,7 +439,7 @@ <dependency> <groupId>org.apache.wicket</groupId> <artifactId>wicket-core</artifactId> - <version>1.5.16</version> + <version>8.5.0</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> @@ -464,7 +464,7 @@ <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> - <version>3.5-FINAL</version> + <version>3.14</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> @@ -479,7 +479,7 @@ <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> - <version>3.5-FINAL</version> + <version>3.17</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> @@ -494,7 +494,7 @@ <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-scratchpad</artifactId> - <version>3.5-FINAL</version> + <version>3.14</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> @@ -509,7 +509,7 @@ <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-contrib</artifactId> - <version>3.5-FINAL</version> + <version>3.6</version> <exclusions> <exclusion> <groupId>commons-logging</groupId> diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/socket/WebRTCSocket.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/socket/WebRTCSocket.java index ed8e89e3..dc18c3be 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/socket/WebRTCSocket.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/web/socket/WebRTCSocket.java @@ -33,13 +33,14 @@ * * ============LICENSE_END============================================ * - * + * */ package org.onap.portalsdk.core.web.socket; -import java.util.Hashtable; +import java.util.HashMap; import java.util.Map; +import java.util.Map.Entry; import javax.websocket.OnClose; import javax.websocket.OnMessage; import javax.websocket.OnOpen; @@ -55,8 +56,9 @@ public class WebRTCSocket { private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WebRTCSocket.class); - private final static Map<String, Hashtable<String, Object[]>> channelMap = new Hashtable<String, Hashtable<String, Object[]>>(); - private final Map<String, String> sessionMap = new Hashtable<String, String>(); + private static final Map<String, HashMap<String, Object[]>> channelMap = new HashMap<>(); + private static final String MESSAGE_FAILED = "mesage failed"; + private final Map<String, String> sessionMap = new HashMap<>(); private final ObjectMapper mapper = new ObjectMapper(); @OnMessage @@ -69,11 +71,11 @@ public class WebRTCSocket { if (isOpen != null && (Boolean) isOpen) { String channel = (String) jsonObject.get("channel"); Object value = channelMap.get(channel); - Hashtable<String, Object[]> sourceDestMap; + HashMap<String, Object[]> sourceDestMap; if (value == null) - sourceDestMap = new Hashtable<>(); + sourceDestMap = new HashMap<>(); else - sourceDestMap = (Hashtable<String, Object[]>) value; + sourceDestMap = (HashMap<String, Object[]>) value; sourceDestMap.put(session.getId(), new Object[] { session }); channelMap.put(channel, sourceDestMap); @@ -81,7 +83,7 @@ public class WebRTCSocket { } } catch (Exception je) { - logger.error(EELFLoggerDelegate.errorLogger, "mesage failed", je); + logger.error(EELFLoggerDelegate.errorLogger, MESSAGE_FAILED, je); } try { @@ -97,26 +99,27 @@ public class WebRTCSocket { else channel = (String) jsonObject.get("channel"); } catch (Exception json) { - logger.error(EELFLoggerDelegate.errorLogger, "mesage failed", json); + logger.error(EELFLoggerDelegate.errorLogger, MESSAGE_FAILED, json); } - Hashtable<String, Object[]> sourceDestMap = channelMap.get(channel); + HashMap<String, Object[]> sourceDestMap = channelMap.get(channel); if (sourceDestMap != null) - for (String id : sourceDestMap.keySet()) { - if (!id.equals(session.getId())) { - Session otherSession = (Session) (sourceDestMap.get(id))[0]; + for (Entry<String, Object[]> entry : sourceDestMap.entrySet()){ + + if (!entry.getKey().equals(session.getId())) { + Session otherSession = (Session) (entry.getValue())[0]; if (otherSession.isOpen()) otherSession.getBasicRemote().sendText(mapper.writeValueAsString(dataObj)); } } } catch (Exception je) { - logger.error(EELFLoggerDelegate.errorLogger, "mesage failed", je); + logger.error(EELFLoggerDelegate.errorLogger, MESSAGE_FAILED, je); } } catch (Exception je) { - logger.error(EELFLoggerDelegate.errorLogger, "mesage failed", je); + logger.error(EELFLoggerDelegate.errorLogger, MESSAGE_FAILED, je); } } |