import java.util.Properties;
import org.onap.policy.common.capabilities.Startable;
import org.onap.policy.common.endpoints.http.server.HttpServletServer;
+import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
import org.onap.policy.common.endpoints.parameters.RestServerParameters;
import org.onap.policy.common.gson.GsonMessageBodyHandler;
import org.slf4j.Logger;
//
// Get the server properties
//
- servers = HttpServletServer.factory.build(getServerProperties());
+ servers = HttpServletServerFactoryInstance.getServerFactory().build(getServerProperties());
//
// Start all the servers
//
import java.util.Properties;
import lombok.Getter;
import lombok.Setter;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpoint;
+import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
import org.onap.policy.common.endpoints.event.comm.TopicSource;
import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClientException;
public XacmlPdpActivator(final XacmlPdpParameterGroup xacmlPdpParameterGroup, Properties topicProperties) {
LOGGER.info("Activator initializing using {} and {}", xacmlPdpParameterGroup, topicProperties);
- TopicEndpoint.manager.addTopicSinks(topicProperties);
- TopicEndpoint.manager.addTopicSources(topicProperties);
+ TopicEndpointManager.getManager().addTopicSinks(topicProperties);
+ TopicEndpointManager.getManager().addTopicSources(topicProperties);
final XacmlPdpHearbeatPublisher heartbeat;
final TopicSinkClient sinkClient;
this::unregisterMsgDispatcher);
addAction("topics",
- TopicEndpoint.manager::start,
- TopicEndpoint.manager::shutdown);
+ TopicEndpointManager.getManager()::start,
+ TopicEndpointManager.getManager()::shutdown);
addAction("Terminate PDP",
() -> { },
* Registers the dispatcher with the topic source(s).
*/
private void registerMsgDispatcher() {
- for (TopicSource source : TopicEndpoint.manager.getTopicSources(Arrays.asList(TOPIC))) {
+ for (TopicSource source : TopicEndpointManager.getManager().getTopicSources(Arrays.asList(TOPIC))) {
source.register(msgDispatcher);
}
}
* Unregisters the dispatcher from the topic source(s).
*/
private void unregisterMsgDispatcher() {
- for (TopicSource source : TopicEndpoint.manager.getTopicSources(Arrays.asList(TOPIC))) {
+ for (TopicSource source : TopicEndpointManager.getManager().getTopicSources(Arrays.asList(TOPIC))) {
source.unregister(msgDispatcher);
}
}
import org.junit.rules.TemporaryFolder;
import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClient;
+import org.onap.policy.common.endpoints.http.client.HttpClientConfigException;
+import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.parameters.RestServerParameters;
import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
import org.onap.policy.common.gson.GsonMessageBodyHandler;
return HttpClient.getBody(response, ErrorResponse.class);
}
- private static HttpClient getNoAuthHttpClient()
- throws KeyManagementException, NoSuchAlgorithmException, ClassNotFoundException {
- return HttpClient.factory.build(BusTopicParams.builder()
+ private static HttpClient getNoAuthHttpClient() throws HttpClientConfigException {
+ return HttpClientFactoryInstance.getClientFactory().build(BusTopicParams.builder()
.clientName("testDecisionClient")
.serializationProvider(GsonMessageBodyHandler.class.getName())
.useHttps(false).allowSelfSignedCerts(false).hostname("localhost").port(port)