summaryrefslogtreecommitdiffstats
path: root/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket')
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/ApexWebSocketConsumer.java11
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/ApexWebSocketProducer.java31
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/WebSocketCarrierTechnologyParameters.java (renamed from plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/WEBSOCKETCarrierTechnologyParameters.java)4
3 files changed, 23 insertions, 23 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/ApexWebSocketConsumer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/ApexWebSocketConsumer.java
index e80efa2ee..fe3e47b82 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/ApexWebSocketConsumer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/ApexWebSocketConsumer.java
@@ -50,9 +50,6 @@ public class ApexWebSocketConsumer implements ApexEventConsumer, WsStringMessage
// Get a reference to the logger
private static final Logger LOGGER = LoggerFactory.getLogger(ApexWebSocketConsumer.class);
- // The Web Socket properties
- private WEBSOCKETCarrierTechnologyParameters webSocketConsumerProperties;
-
// The web socket messager, may be WS a server or a client
private WsStringMessager wsStringMessager;
@@ -79,12 +76,14 @@ public class ApexWebSocketConsumer implements ApexEventConsumer, WsStringMessage
this.name = consumerName;
// Check and get the Kafka Properties
- if (!(consumerParameters.getCarrierTechnologyParameters() instanceof WEBSOCKETCarrierTechnologyParameters)) {
+ if (!(consumerParameters.getCarrierTechnologyParameters() instanceof WebSocketCarrierTechnologyParameters)) {
LOGGER.warn("specified consumer properties are not applicable to a web socket consumer");
throw new ApexEventException("specified consumer properties are not applicable to a web socket consumer");
}
- webSocketConsumerProperties =
- (WEBSOCKETCarrierTechnologyParameters) consumerParameters.getCarrierTechnologyParameters();
+
+ // The Web Socket properties
+ WebSocketCarrierTechnologyParameters webSocketConsumerProperties =
+ (WebSocketCarrierTechnologyParameters) consumerParameters.getCarrierTechnologyParameters();
// Check if this is a server or a client Web Socket
if (webSocketConsumerProperties.isWsClient()) {
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/ApexWebSocketProducer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/ApexWebSocketProducer.java
index 6be8a3d1a..7dd1ab947 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/ApexWebSocketProducer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/ApexWebSocketProducer.java
@@ -46,9 +46,6 @@ public class ApexWebSocketProducer implements ApexEventProducer, WsStringMessage
// Get a reference to the logger
private static final Logger LOGGER = LoggerFactory.getLogger(ApexWebSocketProducer.class);
- // The Web Socket properties
- private WEBSOCKETCarrierTechnologyParameters webSocketProducerProperties;
-
// The web socket messager, may be WS a server or a client
private WsStringMessager wsStringMessager;
@@ -60,23 +57,25 @@ public class ApexWebSocketProducer implements ApexEventProducer, WsStringMessage
@Override
public void init(final String producerName, final EventHandlerParameters producerParameters)
- throws ApexEventException {
+ throws ApexEventException {
this.name = producerName;
// Check and get the web socket Properties
- if (!(producerParameters.getCarrierTechnologyParameters() instanceof WEBSOCKETCarrierTechnologyParameters)) {
- LOGGER.warn(
- "specified producer properties for " + this.name + "are not applicable to a web socket producer");
+ if (!(producerParameters.getCarrierTechnologyParameters() instanceof WebSocketCarrierTechnologyParameters)) {
+ String message = "specified producer properties for " + this.name
+ + "are not applicable to a web socket producer";
+ LOGGER.warn(message);
throw new ApexEventException("specified producer properties are not applicable to a web socket producer");
}
- webSocketProducerProperties =
- (WEBSOCKETCarrierTechnologyParameters) producerParameters.getCarrierTechnologyParameters();
+ // The Web Socket properties
+ WebSocketCarrierTechnologyParameters webSocketProducerProperties =
+ (WebSocketCarrierTechnologyParameters) producerParameters.getCarrierTechnologyParameters();
// Check if this is a server or a client Web Socket
if (webSocketProducerProperties.isWsClient()) {
// Create a WS client
wsStringMessager = new WsStringMessageClient(webSocketProducerProperties.getHost(),
- webSocketProducerProperties.getPort());
+ webSocketProducerProperties.getPort());
} else {
wsStringMessager = new WsStringMessageServer(webSocketProducerProperties.getPort());
}
@@ -85,7 +84,8 @@ public class ApexWebSocketProducer implements ApexEventProducer, WsStringMessage
try {
wsStringMessager.start(this);
} catch (final MessagingException e) {
- LOGGER.warn("could not start web socket producer (" + this.name + ")");
+ String message = "could not start web socket producer (" + this.name + ")";
+ LOGGER.warn(message);
}
}
@@ -130,8 +130,8 @@ public class ApexWebSocketProducer implements ApexEventProducer, WsStringMessage
@Override
public void sendEvent(final long executionId, final String eventName, final Object event) {
// Check if this is a synchronized event, if so we have received a reply
- final SynchronousEventCache synchronousEventCache =
- (SynchronousEventCache) peerReferenceMap.get(EventHandlerPeeredMode.SYNCHRONOUS);
+ final SynchronousEventCache synchronousEventCache = (SynchronousEventCache) peerReferenceMap
+ .get(EventHandlerPeeredMode.SYNCHRONOUS);
if (synchronousEventCache != null) {
synchronousEventCache.removeCachedEventToApexIfExists(executionId);
}
@@ -160,7 +160,8 @@ public class ApexWebSocketProducer implements ApexEventProducer, WsStringMessage
*/
@Override
public void receiveString(final String messageString) {
- LOGGER.warn("received message \"" + messageString + "\" on web socket producer (" + this.name
- + ") , no messages should be received on a web socket producer");
+ String message = "received message \"" + messageString + "\" on web socket producer (" + this.name
+ + ") , no messages should be received on a web socket producer";
+ LOGGER.warn(message);
}
}
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/WEBSOCKETCarrierTechnologyParameters.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/WebSocketCarrierTechnologyParameters.java
index e04a81d1d..9febeb45b 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/WEBSOCKETCarrierTechnologyParameters.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-websocket/src/main/java/org/onap/policy/apex/plugins/event/carrier/websocket/WebSocketCarrierTechnologyParameters.java
@@ -29,7 +29,7 @@ import org.onap.policy.common.parameters.ValidationStatus;
*
* @author Liam Fallon (liam.fallon@ericsson.com)
*/
-public class WEBSOCKETCarrierTechnologyParameters extends CarrierTechnologyParameters {
+public class WebSocketCarrierTechnologyParameters extends CarrierTechnologyParameters {
// @formatter:off
private static final int MIN_USER_PORT = 1024;
private static final int MAX_USER_PORT = 65535;
@@ -57,7 +57,7 @@ public class WEBSOCKETCarrierTechnologyParameters extends CarrierTechnologyParam
* Constructor to create a web socket carrier technology parameters instance and register the instance with the
* parameter service.
*/
- public WEBSOCKETCarrierTechnologyParameters() {
+ public WebSocketCarrierTechnologyParameters() {
super();
// Set the carrier technology properties for the web socket carrier technology