/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2020-2021 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.util.concurrent.atomic.AtomicReference;
import lombok.AccessLevel;
import lombok.Getter;
+import org.apache.commons.lang3.StringUtils;
import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
import org.onap.policy.common.endpoints.event.comm.TopicSink;
import org.onap.policy.common.endpoints.event.comm.TopicSource;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.common.utils.resources.ResourceUtils;
+import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.common.utils.services.ServiceManagerContainer;
import org.onap.policy.models.sim.dmaap.parameters.DmaapSimParameterGroup;
import org.onap.policy.models.sim.dmaap.provider.DmaapSimProvider;
// @formatter:off
for (ClassRestServerParameters restsim : params.getRestServers()) {
AtomicReference<HttpServletServer> ref = new AtomicReference<>();
+ if (StringUtils.isNotBlank(restsim.getResourceLocation())) {
+ String resourceLocationId = restsim.getProviderClass() + "_RESOURCE_LOCATION";
+ addAction(resourceLocationId,
+ () -> Registry.register(resourceLocationId, restsim.getResourceLocation()),
+ () -> Registry.unregister(resourceLocationId));
+ }
addAction(restsim.getName(),
() -> ref.set(buildRestServer(dmaapName, restsim)),
() -> ref.get().shutdown());