/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
wsStringMessageListener.receiveString(messageString);
}
}
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Override
+ public boolean isStarted() {
+ return service.isStarted();
+ }
}
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2019 Nordix Foundation.
+ * Modifications Copyright (C) 2019-2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.apex.core.infrastructure.messaging.stringmessaging;
import com.google.common.eventbus.Subscribe;
+
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
+
import org.onap.policy.apex.core.infrastructure.messaging.MessageListener;
import org.onap.policy.apex.core.infrastructure.messaging.MessagingException;
import org.onap.policy.apex.core.infrastructure.messaging.MessagingService;
String lanaddress = "unknown";
try {
lanaddress = MessagingUtils.getLocalHostLanAddress().getHostAddress();
- }
- catch (final UnknownHostException ignore) {
- LOGGER.debug("Failed to find name of local address name",ignore);
+ } catch (final UnknownHostException ignore) {
+ LOGGER.debug("Failed to find name of local address name", ignore);
}
LOGGER.debug("web socket string message server LAN address=" + lanaddress);
String hostaddress = "unknown";
try {
hostaddress = InetAddress.getLocalHost().getHostAddress();
- }
- catch (final UnknownHostException ignore) {
- LOGGER.debug("Failed to find name of local address",ignore);
+ } catch (final UnknownHostException ignore) {
+ LOGGER.debug("Failed to find name of local address", ignore);
}
LOGGER.debug("web socket string message server host address=" + hostaddress);
}
wsStringMessageListener.receiveString(messageString);
}
}
+
+ /**
+ * {@inheritDoc}.
+ */
+ @Override
+ public boolean isStarted() {
+ return service.isStarted();
+ }
}
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ * Modifications Copyright (C) 2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* @param stringMessage the string message to send
*/
void sendString(String stringMessage);
+
+ /**
+ * Check if the string messager is started.
+ */
+ boolean isStarted();
}