diff options
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/dmaap')
4 files changed, 0 insertions, 342 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/dmaap/CreateEcompOperationEnvironmentBean.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/dmaap/CreateEcompOperationEnvironmentBean.java deleted file mode 100644 index 1f3457e6e0..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/dmaap/CreateEcompOperationEnvironmentBean.java +++ /dev/null @@ -1,172 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.apihandlerinfra.tenantisolation.dmaap; - - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonPropertyOrder({ -"operationalEnvironmentId", -"operationalEnvironmentName", -"operationalEnvironmentType", -"tenantContext", -"workloadContext" -}) - -public class CreateEcompOperationEnvironmentBean { - -@JsonProperty("operationalEnvironmentId") -private String operationalEnvironmentId; -@JsonProperty("operationalEnvironmentName") -private String operationalEnvironmentName; -@JsonProperty("operationalEnvironmentType") -private String operationalEnvironmentType; -@JsonProperty("tenantContext") -private String tenantContext; -@JsonProperty("workloadContext") -private String workloadContext; -@JsonProperty("action") -private String action; - - -/** -* No args constructor for use in serialization -* -*/ -public CreateEcompOperationEnvironmentBean() { - } - -/** -* -* @param operationalEnvironmentId -* @param operationalEnvironmentName -* @param operationalEnvironmentType -* @param tenantContext -* @param workloadContext -*/ -public CreateEcompOperationEnvironmentBean(String operationalEnvironmentId, String operationalEnvironmentName, String operationalEnvironmentType, String tenantContext, String workloadContext, String action) { -super(); -this.operationalEnvironmentId = operationalEnvironmentId; -this.operationalEnvironmentName = operationalEnvironmentName; -this.operationalEnvironmentType = operationalEnvironmentType; -this.tenantContext = tenantContext; -this.workloadContext = workloadContext; -this.action = action; - } - -@JsonProperty("operationalEnvironmentId") -public String getOperationalEnvironmentId() { -return operationalEnvironmentId; - } - -@JsonProperty("operationalEnvironmentId") -public void setOperationalEnvironmentId(String operationalEnvironmentId) { -this.operationalEnvironmentId = operationalEnvironmentId; - } - -public CreateEcompOperationEnvironmentBean withOperationalEnvironmentId(String operationalEnvironmentId) { -this.operationalEnvironmentId = operationalEnvironmentId; -return this; - } - - -@JsonProperty("operationalEnvironmentName") -public String getoperationalEnvironmentName() { -return operationalEnvironmentName; - } - -@JsonProperty("operationalEnvironmentName") -public void setoperationalEnvironmentName(String operationalEnvironmentName) { -this.operationalEnvironmentName = operationalEnvironmentName; - } - -public CreateEcompOperationEnvironmentBean withOperationalEnvironmentName(String operationalEnvironmentName) { -this.operationalEnvironmentName = operationalEnvironmentName; -return this; - } - -@JsonProperty("operationalEnvironmentType") -public String getoperationalEnvironmentType() { -return operationalEnvironmentType; - } - -@JsonProperty("operationalEnvironmentType") -public void setoperationalEnvironmentType(String operationalEnvironmentType) { -this.operationalEnvironmentType = operationalEnvironmentType; - } - -public CreateEcompOperationEnvironmentBean withOperationalEnvironmentType(String operationalEnvironmentType) { -this.operationalEnvironmentType = operationalEnvironmentType; -return this; - } - -@JsonProperty("tenantContext") -public String gettenantContext() { -return tenantContext; - } - -@JsonProperty("tenantContext") -public void settenantContext(String tenantContext) { -this.tenantContext = tenantContext; - } - -public CreateEcompOperationEnvironmentBean withTenantContext(String tenantContext) { -this.tenantContext = tenantContext; -return this; - } - -@JsonProperty("workloadContext") -public String getworkloadContext() { -return workloadContext; - } - -@JsonProperty("workloadContext") -public void setworkloadContext(String workloadContext) { -this.workloadContext = workloadContext; - } - -public CreateEcompOperationEnvironmentBean withWorkloadContext(String workloadContext) { -this.workloadContext = workloadContext; -return this; - } - - -@JsonProperty("action") -public String getaction() { -return action; - } - -@JsonProperty("action") -public void setaction(String action) { -this.action = action; - } - -public CreateEcompOperationEnvironmentBean withaction(String action) { -this.action = action; -return this; - } - - - -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/dmaap/DmaapOperationalEnvClient.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/dmaap/DmaapOperationalEnvClient.java deleted file mode 100644 index 4d47acdd22..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/dmaap/DmaapOperationalEnvClient.java +++ /dev/null @@ -1,67 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.apihandlerinfra.tenantisolation.dmaap; - -import java.io.IOException; - - -import org.openecomp.mso.client.dmaap.DmaapPublisher; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class DmaapOperationalEnvClient { - - - protected String buildRequest(String operationalEnvironmentId, String operationalEnvironmentName, String operationalEnvironmentType, String tenantContext, String workloadContext, String action ) - throws JsonProcessingException { - final CreateEcompOperationEnvironmentBean operationalEnv = new CreateEcompOperationEnvironmentBean(); - operationalEnv.withOperationalEnvironmentId(operationalEnvironmentId) - .withOperationalEnvironmentName(operationalEnvironmentName) - .withOperationalEnvironmentType(operationalEnvironmentType) - .withTenantContext(tenantContext) - .withWorkloadContext(workloadContext) - .withaction(action); - - return this.getJson(operationalEnv); - - } - - protected String getJson(CreateEcompOperationEnvironmentBean obj) throws JsonProcessingException { - - final ObjectMapper mapper = new ObjectMapper(); - return mapper.writeValueAsString(obj); - - } - - protected DmaapPublisher getPublisher() throws IOException { - return new OperationalEnvironmentPublisher(); - } - - public void dmaapPublishOperationalEnvRequest(String operationalEnvironmentId, String operationalEnvironmentName, String operationalEnvironmentType, - String tenantContext, String workloadContext, String action ) throws Exception { - - String request = this.buildRequest(operationalEnvironmentId, operationalEnvironmentName, operationalEnvironmentType, tenantContext, workloadContext, action); - final DmaapPublisher publisher = this.getPublisher(); - publisher.send(request); - - } - -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/dmaap/DmaapPropertiesImpl.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/dmaap/DmaapPropertiesImpl.java deleted file mode 100644 index 3ce4759577..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/dmaap/DmaapPropertiesImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.apihandlerinfra.tenantisolation.dmaap; - -import java.util.Map; - -import org.openecomp.mso.apihandlerinfra.MsoPropertiesUtils; -import org.openecomp.mso.client.dmaap.DmaapProperties; -import org.openecomp.mso.properties.MsoJavaProperties; - -public class DmaapPropertiesImpl implements DmaapProperties { - - private final Map<String, String> props; - - public DmaapPropertiesImpl () { - - MsoJavaProperties properties = MsoPropertiesUtils.loadMsoProperties(); - this.props = properties.asMap(); - } - - @Override - public Map<String, String> getProperties() { - - return this.props; - } - -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/dmaap/OperationalEnvironmentPublisher.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/dmaap/OperationalEnvironmentPublisher.java deleted file mode 100644 index 36c1085655..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/openecomp/mso/apihandlerinfra/tenantisolation/dmaap/OperationalEnvironmentPublisher.java +++ /dev/null @@ -1,58 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.apihandlerinfra.tenantisolation.dmaap; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Optional; - -import org.openecomp.mso.client.dmaap.DmaapPublisher; - -public class OperationalEnvironmentPublisher extends DmaapPublisher { - - - public OperationalEnvironmentPublisher() throws FileNotFoundException, IOException { - super(); - } - - @Override - public String getUserName() { - - return this.msoProperties.get("so.operational-environment.dmaap.username"); - } - - @Override - public String getPassword() { - - return this.msoProperties.get("so.operational-environment.dmaap.password"); - } - - @Override - public String getTopic() { - - return this.msoProperties.get("so.operational-environment.publisher.topic"); - } - - @Override - public Optional<String> getHost() { - return Optional.ofNullable(this.msoProperties.get("so.operational-environment.dmaap.host")); - } -}
\ No newline at end of file |