summaryrefslogtreecommitdiffstats
path: root/so-optimization-clients/src
diff options
context:
space:
mode:
Diffstat (limited to 'so-optimization-clients/src')
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/OofClient.java83
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/OofValidator.java98
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/LicenseDemand.java97
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/LicenseInfo.java49
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/ModelInfo.java110
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/OofProperties.java63
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/OofRequest.java100
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/OofRequestParameters.java74
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/PlacementDemand.java97
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/PlacementInfo.java74
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/RequestInfo.java135
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/Resource.java54
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/ResourceModelInfo.java107
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/ServiceInfo.java73
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/SubscriberInfo.java72
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/SniroClient.java115
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/SniroValidator.java138
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/Candidate.java70
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/CandidateType.java41
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ConductorProperties.java61
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/Demand.java103
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/LicenseInfo.java44
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ManagerProperties.java62
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ModelInfo.java76
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/PlacementInfo.java70
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/RequestInfo.java95
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/Resource.java54
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ServiceInfo.java76
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java66
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java98
-rw-r--r--so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/SubscriberInfo.java64
-rw-r--r--so-optimization-clients/src/test/java/org/onap/so/BaseIntegrationTest.java63
-rw-r--r--so-optimization-clients/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java60
-rw-r--r--so-optimization-clients/src/test/java/org/onap/so/IntegrationTestSuite.java31
-rw-r--r--so-optimization-clients/src/test/java/org/onap/so/TestApplication.java43
-rw-r--r--so-optimization-clients/src/test/java/org/onap/so/client/oof/OofClientTestIT.java218
-rw-r--r--so-optimization-clients/src/test/java/org/onap/so/client/sniro/SniroClientTestIT.java158
-rw-r--r--so-optimization-clients/src/test/resources/application-test.yaml231
-rw-r--r--so-optimization-clients/src/test/resources/schema.sql1195
39 files changed, 4518 insertions, 0 deletions
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/OofClient.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/OofClient.java
new file mode 100644
index 0000000000..71ecc5c478
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/OofClient.java
@@ -0,0 +1,83 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. 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.onap.so.client.oof;
+
+
+import org.onap.so.client.BaseClient;
+import org.onap.so.client.exception.BadResponseException;
+import org.onap.so.client.oof.beans.OofProperties;
+import org.onap.so.client.oof.beans.OofRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Component;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import java.util.LinkedHashMap;
+
+@Component
+public class OofClient {
+
+ private static final Logger logger = LoggerFactory.getLogger(OofClient.class);
+ public static final String X_MINOR_VERSION = "X-MinorVersion";
+ public static final String X_PATCH_VERSION = "X-PatchVersion";
+ public static final String X_LATEST_VERSION = "X-LatestVersion";
+
+ @Autowired
+ private OofProperties oofProperties;
+
+ @Autowired
+ private OofValidator validator;
+
+
+ /**
+ * Makes a rest call to oof to perform homing and licensing for a list of demands
+ *
+ * @param homingRequest
+ * @return
+ * @throws JsonProcessingException
+ * @throws BpmnError
+ */
+ public void postDemands(OofRequest homingRequest) throws BadResponseException, JsonProcessingException {
+ logger.trace("Started oof Client Post Demands");
+ String url = oofProperties.getHost() + oofProperties.getUri();
+ logger.debug("Post demands url: " + url);
+ logger.debug("Post demands payload: " + homingRequest.toJsonString());
+
+ HttpHeaders header = new HttpHeaders();
+ header.setContentType(MediaType.APPLICATION_JSON);
+ header.set(HttpHeaders.AUTHORIZATION, oofProperties.getHeaders().get("auth"));
+ header.set(X_PATCH_VERSION, oofProperties.getHeaders().get("patchVersion"));
+ header.set(X_MINOR_VERSION, oofProperties.getHeaders().get("minorVersion"));
+ header.set(X_LATEST_VERSION, oofProperties.getHeaders().get("latestVersion"));
+ BaseClient<String, LinkedHashMap<?, ?>> baseClient = new BaseClient<>();
+
+ baseClient.setTargetUrl(url);
+ baseClient.setHttpHeader(header);
+
+ LinkedHashMap<?, ?> response =
+ baseClient.post(homingRequest.toJsonString(), new ParameterizedTypeReference<LinkedHashMap<?, ?>>() {});
+ validator.validateDemandsResponse(response);
+ logger.trace("Completed OOF Client Post Demands");
+ }
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/OofValidator.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/OofValidator.java
new file mode 100644
index 0000000000..2c22d9d09e
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/OofValidator.java
@@ -0,0 +1,98 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. 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.onap.so.client.oof;
+
+
+import org.json.JSONObject;
+import org.onap.so.client.exception.BadResponseException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+import java.util.LinkedHashMap;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
+
+
+@Component
+public class OofValidator {
+
+ private static final Logger logger = LoggerFactory.getLogger(OofValidator.class);
+
+ /**
+ * Validates the synchronous homing response from oof
+ *
+ * @throws BadResponseException
+ */
+ public void validateDemandsResponse(LinkedHashMap<?, ?> response) throws BadResponseException {
+ logger.debug("Validating oofs synchronous response");
+ if (!response.isEmpty()) {
+ JSONObject jsonResponse = new JSONObject(response);
+ if (jsonResponse.has("requestStatus")) {
+ String status = jsonResponse.getString("requestStatus");
+ if (status.equals("accepted")) {
+ logger.debug("oofs synchronous response indicates accepted");
+ } else {
+ String message = jsonResponse.getString("statusMessage");
+ if (isNotBlank(message)) {
+ logger.debug("oofs response indicates failed: " + message);
+ } else {
+ logger.debug("oofs response indicates failed: no status message provided");
+ message = "error message not provided";
+ }
+ throw new BadResponseException("oofs synchronous response indicates failed: " + message);
+ }
+ } else {
+ logger.debug("oofs synchronous response does not contain: request status");
+ throw new BadResponseException("oofs synchronous response does not contain: request status");
+ }
+ } else {
+ logger.debug("oofs synchronous response is empty");
+ throw new BadResponseException("oofs synchronous response i is empty");
+ }
+ }
+
+ /**
+ * Validates the asynchronous/callback response from oof which contains the homing and licensing solutions
+ *
+ * @throws BadResponseException
+ */
+ public void validateSolution(String response) throws BadResponseException {
+ logger.debug("Validating oofs asynchronous callback response");
+ if (isNotBlank(response)) {
+ JSONObject jsonResponse = new JSONObject(response);
+ if (!jsonResponse.has("serviceException")) {
+ logger.debug("oofs asynchronous response is valid");
+ } else {
+ String message = jsonResponse.getJSONObject("serviceException").getString("text");
+ if (isNotBlank(message)) {
+ logger.debug("oofs response contains a service exception: " + message);
+ } else {
+ logger.debug("oofs response contains a service exception: no service exception text provided");
+ message = "error message not provided";
+ }
+ throw new BadResponseException("oofs asynchronous response contains a service exception: " + message);
+ }
+ } else {
+ logger.debug("oofs asynchronous response is empty");
+ throw new BadResponseException("oofs asynchronous response is empty");
+ }
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/LicenseDemand.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/LicenseDemand.java
new file mode 100644
index 0000000000..e64a5450b5
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/LicenseDemand.java
@@ -0,0 +1,97 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 Intel Corp. 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.onap.so.client.oof.beans;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import java.io.Serializable;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({"resourceModuleName", "serviceResourceId", "tenantId", "resourceModelInfo"})
+@JsonRootName("licenseDemand")
+public class LicenseDemand implements Serializable {
+
+ private static final long serialVersionUID = -759180997599143791L;
+
+ @JsonProperty("resourceModuleName")
+ private String resourceModuleName;
+ @JsonProperty("serviceResourceId")
+ private String serviceResourceId;
+ @JsonProperty("tenantId")
+ private String tenantId;
+ @JsonProperty("resourceModelInfo")
+ private ResourceModelInfo resourceModelInfo;
+
+ @JsonProperty("resourceModuleName")
+ public String getResourceModuleName() {
+ return resourceModuleName;
+ }
+
+ @JsonProperty("resourceModuleName")
+ public void setResourceModuleName(String resourceModuleName) {
+ this.resourceModuleName = resourceModuleName;
+ }
+
+ @JsonProperty("serviceResourceId")
+ public String getServiceResourceId() {
+ return serviceResourceId;
+ }
+
+ @JsonProperty("serviceResourceId")
+ public void setServiceResourceId(String serviceResourceId) {
+ this.serviceResourceId = serviceResourceId;
+ }
+
+ @JsonProperty("tenantId")
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ @JsonProperty("tenantId")
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ @JsonProperty("resourceModelInfo")
+ public ResourceModelInfo getResourceModelInfo() {
+ return resourceModelInfo;
+ }
+
+ @JsonProperty("resourceModelInfo")
+ public void setResourceModelInfo(ResourceModelInfo resourceModelInfo) {
+ this.resourceModelInfo = resourceModelInfo;
+ }
+
+ public void setResourceModelInfo(ModelInfo modelInfo) {
+ ResourceModelInfo localResourceModelInfo = new ResourceModelInfo();
+ localResourceModelInfo.setModelVersionId(modelInfo.getModelVersionId());
+ localResourceModelInfo.setModelVersionId(modelInfo.getModelVersionId());
+ localResourceModelInfo.setModelVersion(modelInfo.getModelVersion());
+ localResourceModelInfo.setModelName(modelInfo.getModelName());
+ localResourceModelInfo.setModelType(modelInfo.getModelType());
+ localResourceModelInfo.setModelInvariantId(modelInfo.getModelInvariantId());
+ localResourceModelInfo.setModelCustomizationName(modelInfo.getModelCustomizationName());
+ this.resourceModelInfo = localResourceModelInfo;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/LicenseInfo.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/LicenseInfo.java
new file mode 100644
index 0000000000..74ff9339d3
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/LicenseInfo.java
@@ -0,0 +1,49 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2019 Intel Corp. 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.onap.so.client.oof.beans;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import java.io.Serializable;
+import java.util.ArrayList;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonRootName("licenseInfo")
+public class LicenseInfo implements Serializable {
+
+ private static final long serialVersionUID = -759180997599143791L;
+
+ @JsonProperty("licenseDemands")
+ private ArrayList<LicenseDemand> licenseDemands = new ArrayList<>();
+
+
+ @JsonProperty("licenseDemands")
+ public ArrayList<LicenseDemand> getLicenseDemands() {
+ return licenseDemands;
+ }
+
+ @JsonProperty("licenseDemands")
+ public void setLicenseDemands(ArrayList<LicenseDemand> licenseDemands) {
+ this.licenseDemands = licenseDemands;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/ModelInfo.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/ModelInfo.java
new file mode 100644
index 0000000000..433de22aba
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/ModelInfo.java
@@ -0,0 +1,110 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. 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.onap.so.client.oof.beans;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import java.io.Serializable;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({"modelType", "modelInvariantId", "modelVersionId", "modelName", "modelVersion",
+ "modelCustomizationName"})
+@JsonRootName("modelInfo")
+public class ModelInfo implements Serializable {
+
+ private static final long serialVersionUID = -759180997599143791L;
+
+ @JsonProperty("modelType")
+ private String modelType;
+ @JsonProperty("modelInvariantId")
+ private String modelInvariantId;
+ @JsonProperty("modelVersionId")
+ private String modelVersionId;
+ @JsonProperty("modelName")
+ private String modelName;
+ @JsonProperty("modelVersion")
+ private String modelVersion;
+ @JsonProperty("modelCustomizationName")
+ private String modelCustomizationName;
+
+ @JsonProperty("modelType")
+ public String getModelType() {
+ return modelType;
+ }
+
+ @JsonProperty("modelType")
+ public void setModelType(String modelType) {
+ this.modelType = modelType;
+ }
+
+ @JsonProperty("modelInvariantId")
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ @JsonProperty("modelInvariantId")
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ @JsonProperty("modelVersionId")
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ @JsonProperty("modelVersionId")
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ @JsonProperty("modelName")
+ public String getModelName() {
+ return modelName;
+ }
+
+ @JsonProperty("modelName")
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ @JsonProperty("modelVersion")
+ public String getModelVersion() {
+ return modelVersion;
+ }
+
+ @JsonProperty("modelVersion")
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+
+ @JsonProperty("modelCustomizationName")
+ public String getModelCustomizationName() {
+ return modelCustomizationName;
+ }
+
+ @JsonProperty("modelCustomizationName")
+ public void setModelCustomizationName(String modelCustomizationName) {
+ this.modelCustomizationName = modelCustomizationName;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/OofProperties.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/OofProperties.java
new file mode 100644
index 0000000000..84e29b6f2d
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/OofProperties.java
@@ -0,0 +1,63 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. 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.onap.so.client.oof.beans;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import java.util.Map;
+
+@Configuration
+@ConfigurationProperties(prefix = "oof")
+public class OofProperties {
+
+ private String host;
+ private String uri;
+
+ private Map<String, String> headers;
+
+
+ public String getHost() {
+ return host;
+ }
+
+ public void setHost(String host) {
+ this.host = host;
+ }
+
+ public String getUri() {
+ return uri;
+ }
+
+ public void setUri(String uri) {
+ this.uri = uri;
+ }
+
+ public Map<String, String> getHeaders() {
+ return headers;
+ }
+
+ public void setHeaders(Map<String, String> headers) {
+ this.headers = headers;
+ }
+
+
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/OofRequest.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/OofRequest.java
new file mode 100644
index 0000000000..f8896240ba
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/OofRequest.java
@@ -0,0 +1,100 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. 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.onap.so.client.oof.beans;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.ObjectWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import java.io.Serializable;
+
+
+public class OofRequest implements Serializable {
+
+ private static final long serialVersionUID = -1541132882892163132L;
+ private static final Logger logger = LoggerFactory.getLogger(OofRequest.class);
+
+
+ @JsonProperty("requestInfo")
+ private RequestInfo requestInformation;
+
+ @JsonProperty("serviceInfo")
+ private ServiceInfo serviceInformation;
+
+ @JsonProperty("placementInfo")
+ private PlacementInfo placementInformation;
+
+ @JsonProperty("licenseInfo")
+ private LicenseInfo licenseInformation;
+
+
+ public RequestInfo getRequestInformation() {
+ return requestInformation;
+ }
+
+ public void setRequestInformation(RequestInfo requestInformation) {
+ this.requestInformation = requestInformation;
+ }
+
+ public ServiceInfo getServiceInformation() {
+ return serviceInformation;
+ }
+
+ public void setServiceInformation(ServiceInfo serviceInformation) {
+ this.serviceInformation = serviceInformation;
+ }
+
+ public PlacementInfo getPlacementInformation() {
+ return placementInformation;
+ }
+
+ public void setPlacementInformation(PlacementInfo placementInformation) {
+ this.placementInformation = placementInformation;
+ }
+
+ public LicenseInfo getLicenseInformation() {
+ return licenseInformation;
+ }
+
+ public void setLicenseInformation(LicenseInfo licenseInformation) {
+ this.licenseInformation = licenseInformation;
+ }
+
+
+ @JsonInclude(Include.NON_NULL)
+ public String toJsonString() {
+ String json = "";
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.setSerializationInclusion(Include.NON_NULL);
+ ObjectWriter ow = mapper.writer().withDefaultPrettyPrinter();
+ try {
+ json = ow.writeValueAsString(this);
+ } catch (Exception e) {
+ logger.error("Unable to convert oofRequest to string", e);
+ }
+ return json.replaceAll("\\\\", "");
+ }
+
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/OofRequestParameters.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/OofRequestParameters.java
new file mode 100644
index 0000000000..6c9e45c787
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/OofRequestParameters.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. 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.onap.so.client.oof.beans;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import java.io.Serializable;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({"customerLatitude", "customerLongitude", "customerName"})
+@JsonRootName("requestParameters")
+public class OofRequestParameters implements Serializable {
+
+ private static final long serialVersionUID = -759180997599143791L;
+
+
+ @JsonProperty("customerLatitude")
+ private String customerLatitude;
+ @JsonProperty("customerLongitude")
+ private String customerLongitude;
+ @JsonProperty("customerName")
+ private String customerName;
+
+ @JsonProperty("customerLatitude")
+ public String getCustomerLatitude() {
+ return customerLatitude;
+ }
+
+ @JsonProperty("customerLatitude")
+ public void setCustomerLatitude(String customerLatitude) {
+ this.customerLatitude = customerLatitude;
+ }
+
+ @JsonProperty("customerLongitude")
+ public String getCustomerLongitude() {
+ return customerLongitude;
+ }
+
+ @JsonProperty("customerLongitude")
+ public void setCustomerLongitude(String customerLongitude) {
+ this.customerLongitude = customerLongitude;
+ }
+
+ @JsonProperty("customerName")
+ public String getCustomerName() {
+ return customerName;
+ }
+
+ @JsonProperty("customerName")
+ public void setCustomerName(String customerName) {
+ this.customerName = customerName;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/PlacementDemand.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/PlacementDemand.java
new file mode 100644
index 0000000000..631b3707d4
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/PlacementDemand.java
@@ -0,0 +1,97 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. 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.onap.so.client.oof.beans;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import java.io.Serializable;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({"resourceModuleName", "serviceResourceId", "tenantId", "resourceModelInfo"})
+@JsonRootName("placementDemand")
+public class PlacementDemand implements Serializable {
+
+ private static final long serialVersionUID = -759180997599143791L;
+
+ @JsonProperty("resourceModuleName")
+ private String resourceModuleName;
+ @JsonProperty("serviceResourceId")
+ private String serviceResourceId;
+ @JsonProperty("tenantId")
+ private String tenantId;
+ @JsonProperty("resourceModelInfo")
+ private ResourceModelInfo resourceModelInfo;
+
+ @JsonProperty("resourceModuleName")
+ public String getResourceModuleName() {
+ return resourceModuleName;
+ }
+
+ @JsonProperty("resourceModuleName")
+ public void setResourceModuleName(String resourceModuleName) {
+ this.resourceModuleName = resourceModuleName;
+ }
+
+ @JsonProperty("serviceResourceId")
+ public String getServiceResourceId() {
+ return serviceResourceId;
+ }
+
+ @JsonProperty("serviceResourceId")
+ public void setServiceResourceId(String serviceResourceId) {
+ this.serviceResourceId = serviceResourceId;
+ }
+
+ @JsonProperty("tenantId")
+ public String getTenantId() {
+ return tenantId;
+ }
+
+ @JsonProperty("tenantId")
+ public void setTenantId(String tenantId) {
+ this.tenantId = tenantId;
+ }
+
+ @JsonProperty("resourceModelInfo")
+ public ResourceModelInfo getResourceModelInfo() {
+ return resourceModelInfo;
+ }
+
+ @JsonProperty("resourceModelInfo")
+ public void setResourceModelInfo(ResourceModelInfo resourceModelInfo) {
+ this.resourceModelInfo = resourceModelInfo;
+ }
+
+ public void setResourceModelInfo(ModelInfo modelInfo) {
+ ResourceModelInfo localResourceModelInfo = new ResourceModelInfo();
+ localResourceModelInfo.setModelVersionId(modelInfo.getModelVersionId());
+ localResourceModelInfo.setModelVersionId(modelInfo.getModelVersionId());
+ localResourceModelInfo.setModelVersion(modelInfo.getModelVersion());
+ localResourceModelInfo.setModelName(modelInfo.getModelName());
+ localResourceModelInfo.setModelType(modelInfo.getModelType());
+ localResourceModelInfo.setModelInvariantId(modelInfo.getModelInvariantId());
+ localResourceModelInfo.setModelCustomizationName(modelInfo.getModelCustomizationName());
+ this.resourceModelInfo = localResourceModelInfo;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/PlacementInfo.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/PlacementInfo.java
new file mode 100644
index 0000000000..7519e8c87e
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/PlacementInfo.java
@@ -0,0 +1,74 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. 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.onap.so.client.oof.beans;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({"requestParameters", "subscriberInfo", "placementDemands"})
+@JsonRootName("placementInfo")
+public class PlacementInfo implements Serializable {
+
+ private static final long serialVersionUID = -759180997599143791L;
+
+ @JsonProperty("requestParameters")
+ private OofRequestParameters requestParameters;
+ @JsonProperty("subscriberInfo")
+ private SubscriberInfo subscriberInfo;
+ @JsonProperty("placementDemands")
+ private ArrayList<PlacementDemand> placementDemands = new ArrayList<>();
+
+ @JsonProperty("requestParameters")
+ public OofRequestParameters getRequestParameters() {
+ return requestParameters;
+ }
+
+ @JsonProperty("requestParameters")
+ public void setRequestParameters(OofRequestParameters requestParameters) {
+ this.requestParameters = requestParameters;
+ }
+
+ @JsonProperty("subscriberInfo")
+ public SubscriberInfo getSubscriberInfo() {
+ return subscriberInfo;
+ }
+
+ @JsonProperty("subscriberInfo")
+ public void setSubscriberInfo(SubscriberInfo subscriberInfo) {
+ this.subscriberInfo = subscriberInfo;
+ }
+
+ @JsonProperty("placementDemands")
+ public ArrayList<PlacementDemand> getPlacementDemands() {
+ return placementDemands;
+ }
+
+ @JsonProperty("placementDemands")
+ public void setPlacementDemands(ArrayList<PlacementDemand> placementDemands) {
+ this.placementDemands = placementDemands;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/RequestInfo.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/RequestInfo.java
new file mode 100644
index 0000000000..0132ed56e9
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/RequestInfo.java
@@ -0,0 +1,135 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. 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.onap.so.client.oof.beans;
+
+import java.io.Serializable;
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({"transactionId", "requestId", "callbackUrl", "sourceId", "requestType", "numSolutions",
+ "optimizers", "timeout"})
+@JsonRootName("requestInfo")
+public class RequestInfo implements Serializable {
+
+ private static final long serialVersionUID = -759180997599143791L;
+
+ @JsonProperty("transactionId")
+ private String transactionId;
+ @JsonProperty("requestId")
+ private String requestId;
+ @JsonProperty("callbackUrl")
+ private String callbackUrl;
+ @JsonProperty("sourceId")
+ private String sourceId;
+ @JsonProperty("requestType")
+ private String requestType;
+ @JsonProperty("numSolutions")
+ private Integer numSolutions;
+ @JsonProperty("optimizers")
+ private List<String> optimizers = null;
+ @JsonProperty("timeout")
+ private Long timeout;
+
+ @JsonProperty("transactionId")
+ public String getTransactionId() {
+ return transactionId;
+ }
+
+ @JsonProperty("transactionId")
+ public void setTransactionId(String transactionId) {
+ this.transactionId = transactionId;
+ }
+
+ @JsonProperty("requestId")
+ public String getRequestId() {
+ return requestId;
+ }
+
+ @JsonProperty("requestId")
+ public void setRequestId(String requestId) {
+ this.requestId = requestId;
+ }
+
+ @JsonProperty("callbackUrl")
+ public String getCallbackUrl() {
+ return callbackUrl;
+ }
+
+ @JsonProperty("callbackUrl")
+ public void setCallbackUrl(String callbackUrl) {
+ this.callbackUrl = callbackUrl;
+ }
+
+ @JsonProperty("sourceId")
+ public String getSourceId() {
+ return sourceId;
+ }
+
+ @JsonProperty("sourceId")
+ public void setSourceId(String sourceId) {
+ this.sourceId = sourceId;
+ }
+
+ @JsonProperty("requestType")
+ public String getRequestType() {
+ return requestType;
+ }
+
+ @JsonProperty("requestType")
+ public void setRequestType(String requestType) {
+ this.requestType = requestType;
+ }
+
+ @JsonProperty("numSolutions")
+ public Integer getNumSolutions() {
+ return numSolutions;
+ }
+
+ @JsonProperty("numSolutions")
+ public void setNumSolutions(Integer numSolutions) {
+ this.numSolutions = numSolutions;
+ }
+
+ @JsonProperty("optimizers")
+ public List<String> getOptimizers() {
+ return optimizers;
+ }
+
+ @JsonProperty("optimizers")
+ public void setOptimizers(List<String> optimizers) {
+ this.optimizers = optimizers;
+ }
+
+ @JsonProperty("timeout")
+ public Long getTimeout() {
+ return timeout;
+ }
+
+ @JsonProperty("timeout")
+ public void setTimeout(Long timeout) {
+ this.timeout = timeout;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/Resource.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/Resource.java
new file mode 100644
index 0000000000..8d44c63571
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/Resource.java
@@ -0,0 +1,54 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. 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.onap.so.client.oof.beans;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+
+public class Resource implements Serializable {
+
+ private static final long serialVersionUID = 5949861520571440421L;
+
+ @JsonProperty("service-resource-id")
+ private String serviceResourceId;
+ @JsonProperty("status")
+ private String status;
+
+
+ public String getServiceResourceId() {
+ return serviceResourceId;
+ }
+
+ public void setServiceResourceId(String serviceResourceId) {
+ this.serviceResourceId = serviceResourceId;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/ResourceModelInfo.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/ResourceModelInfo.java
new file mode 100644
index 0000000000..9d0352525d
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/ResourceModelInfo.java
@@ -0,0 +1,107 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. 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.onap.so.client.oof.beans;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import java.io.Serializable;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonRootName("resourceModelInfo")
+public class ResourceModelInfo extends ModelInfo implements Serializable {
+
+ private static final long serialVersionUID = -759180997599143791L;
+
+ @JsonProperty("modelInvariantId")
+ private String modelInvariantId;
+ @JsonProperty("modelVersionId")
+ private String modelVersionId;
+ @JsonProperty("modelName")
+ private String modelName;
+ @JsonProperty("modelType")
+ private String modelType;
+ @JsonProperty("modelVersion")
+ private String modelVersion;
+ @JsonProperty("modelCustomizationName")
+ private String modelCustomizationName;
+
+ @JsonProperty("modelInvariantId")
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ @JsonProperty("modelInvariantId")
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ @JsonProperty("modelVersionId")
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ @JsonProperty("modelVersionId")
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ @JsonProperty("modelName")
+ public String getModelName() {
+ return modelName;
+ }
+
+ @JsonProperty("modelName")
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ @JsonProperty("modelType")
+ public String getModelType() {
+ return modelType;
+ }
+
+ @JsonProperty("modelType")
+ public void setModelType(String modelType) {
+ this.modelType = modelType;
+ }
+
+ @JsonProperty("modelVersion")
+ public String getModelVersion() {
+ return modelVersion;
+ }
+
+ @JsonProperty("modelVersion")
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+
+ @JsonProperty("modelCustomizationName")
+ public String getModelCustomizationName() {
+ return modelCustomizationName;
+ }
+
+ @JsonProperty("modelCustomizationName")
+ public void setModelCustomizationName(String modelCustomizationName) {
+ this.modelCustomizationName = modelCustomizationName;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/ServiceInfo.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/ServiceInfo.java
new file mode 100644
index 0000000000..db0e2acd60
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/ServiceInfo.java
@@ -0,0 +1,73 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. 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.onap.so.client.oof.beans;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import java.io.Serializable;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({"serviceInstanceId", "serviceName", "modelInfo"})
+@JsonRootName("serviceInfo")
+public class ServiceInfo implements Serializable {
+
+ private static final long serialVersionUID = -759180997599143791L;
+
+ @JsonProperty("serviceInstanceId")
+ private String serviceInstanceId;
+ @JsonProperty("serviceName")
+ private String serviceName;
+ @JsonProperty("modelInfo")
+ private ModelInfo modelInfo;
+
+ @JsonProperty("serviceInstanceId")
+ public String getServiceInstanceId() {
+ return serviceInstanceId;
+ }
+
+ @JsonProperty("serviceInstanceId")
+ public void setServiceInstanceId(String serviceInstanceId) {
+ this.serviceInstanceId = serviceInstanceId;
+ }
+
+ @JsonProperty("serviceName")
+ public String getServiceName() {
+ return serviceName;
+ }
+
+ @JsonProperty("serviceName")
+ public void setServiceName(String serviceName) {
+ this.serviceName = serviceName;
+ }
+
+ @JsonProperty("modelInfo")
+ public ModelInfo getModelInfo() {
+ return modelInfo;
+ }
+
+ @JsonProperty("modelInfo")
+ public void setModelInfo(ModelInfo modelInfo) {
+ this.modelInfo = modelInfo;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/SubscriberInfo.java b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/SubscriberInfo.java
new file mode 100644
index 0000000000..8fef4c45e7
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/oof/beans/SubscriberInfo.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. 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.onap.so.client.oof.beans;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonRootName;
+import java.io.Serializable;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({"globalSubscriberId", "subscriberName", "subscriberCommonSiteId"})
+@JsonRootName("subscriberInfo")
+public class SubscriberInfo implements Serializable {
+
+ private static final long serialVersionUID = -759180997599143791L;
+
+ @JsonProperty("globalSubscriberId")
+ private String globalSubscriberId;
+ @JsonProperty("subscriberName")
+ private String subscriberName;
+ @JsonProperty("subscriberCommonSiteId")
+ private String subscriberCommonSiteId;
+
+ @JsonProperty("globalSubscriberId")
+ public String getGlobalSubscriberId() {
+ return globalSubscriberId;
+ }
+
+ @JsonProperty("globalSubscriberId")
+ public void setGlobalSubscriberId(String globalSubscriberId) {
+ this.globalSubscriberId = globalSubscriberId;
+ }
+
+ @JsonProperty("subscriberName")
+ public String getSubscriberName() {
+ return subscriberName;
+ }
+
+ @JsonProperty("subscriberName")
+ public void setSubscriberName(String subscriberName) {
+ this.subscriberName = subscriberName;
+ }
+
+ @JsonProperty("subscriberCommonSiteId")
+ public String getSubscriberCommonSiteId() {
+ return subscriberCommonSiteId;
+ }
+
+ @JsonProperty("subscriberCommonSiteId")
+ public void setSubscriberCommonSiteId(String subscriberCommonSiteId) {
+ this.subscriberCommonSiteId = subscriberCommonSiteId;
+ }
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/SniroClient.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/SniroClient.java
new file mode 100644
index 0000000000..6930b6e0af
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/SniroClient.java
@@ -0,0 +1,115 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
+ * 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.onap.so.client.sniro;
+
+import java.util.LinkedHashMap;
+import org.onap.so.client.BaseClient;
+import org.onap.so.client.exception.BadResponseException;
+import org.onap.so.client.sniro.beans.ConductorProperties;
+import org.onap.so.client.sniro.beans.ManagerProperties;
+import org.onap.so.client.sniro.beans.SniroConductorRequest;
+import org.onap.so.client.sniro.beans.SniroManagerRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.ParameterizedTypeReference;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Component;
+
+
+@Component
+public class SniroClient {
+
+ private static final Logger logger = LoggerFactory.getLogger(SniroClient.class);
+
+ @Autowired
+ private ManagerProperties managerProperties;
+
+ @Autowired
+ private SniroValidator validator;
+
+
+ /**
+ * Makes a rest call to sniro manager to perform homing and licensing for a list of demands
+ *
+ * @param homingRequest
+ * @return
+ * @throws BadResponseException
+ */
+ public void postDemands(SniroManagerRequest homingRequest) throws BadResponseException {
+ logger.trace("Started Sniro Client Post Demands");
+ String url = managerProperties.getHost() + managerProperties.getUri().get("v2");
+ logger.debug("Post demands url: {}", url);
+ logger.debug("Post demands payload: {}", homingRequest.toJsonString());
+
+ HttpHeaders header = new HttpHeaders();
+ header.setContentType(MediaType.APPLICATION_JSON);
+ header.set("Authorization", managerProperties.getHeaders().get("auth"));
+ header.set("X-patchVersion", managerProperties.getHeaders().get("patchVersion"));
+ header.set("X-minorVersion", managerProperties.getHeaders().get("minorVersion"));
+ header.set("X-latestVersion", managerProperties.getHeaders().get("latestVersion"));
+ BaseClient<String, LinkedHashMap<String, Object>> baseClient = new BaseClient<>();
+
+ baseClient.setTargetUrl(url);
+ baseClient.setHttpHeader(header);
+
+ LinkedHashMap<String, Object> response = baseClient.post(homingRequest.toJsonString(),
+ new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {});
+ validator.validateDemandsResponse(response);
+ logger.trace("Completed Sniro Client Post Demands");
+ }
+
+ /**
+ * Makes a rest call to sniro conductor to notify them of successful or unsuccessful vnf creation for previously
+ * homed resources
+ *
+ * TODO Temporarily being used in groovy therefore can not utilize autowire. Once java "release" subflow is
+ * developed it will be refactored to use autowire.
+ *
+ * @param releaseRequest
+ * @return
+ * @throws BadResponseException
+ */
+ public void postRelease(SniroConductorRequest releaseRequest) throws BadResponseException {
+ logger.trace("Started Sniro Client Post Release");
+ String url = ConductorProperties.getHost() + ConductorProperties.getUri();
+ logger.debug("Post release url: {}", url);
+ logger.debug("Post release payload: {}", releaseRequest.toJsonString());
+
+ HttpHeaders header = new HttpHeaders();
+ header.setContentType(MediaType.APPLICATION_JSON);
+ header.set("Authorization", ConductorProperties.getAuth());
+ BaseClient<String, LinkedHashMap<String, Object>> baseClient = new BaseClient<>();
+
+ baseClient.setTargetUrl(url);
+ baseClient.setHttpHeader(header);
+
+ LinkedHashMap<String, Object> response = baseClient.post(releaseRequest.toJsonString(),
+ new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {});
+ SniroValidator v = new SniroValidator();
+ v.validateReleaseResponse(response);
+ logger.trace("Completed Sniro Client Post Release");
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/SniroValidator.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/SniroValidator.java
new file mode 100644
index 0000000000..fc16125433
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/SniroValidator.java
@@ -0,0 +1,138 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
+ * 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.onap.so.client.sniro;
+
+
+import static org.apache.commons.lang3.StringUtils.*;
+import java.util.LinkedHashMap;
+import org.json.JSONObject;
+import org.onap.so.client.exception.BadResponseException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+
+
+@Component
+public class SniroValidator {
+
+ private static final Logger logger = LoggerFactory.getLogger(SniroValidator.class);
+
+ /**
+ * Validates the synchronous homing response from sniro manager
+ *
+ * @throws BadResponseException
+ */
+ public void validateDemandsResponse(LinkedHashMap<String, Object> response) throws BadResponseException {
+ logger.debug("Validating Sniro Managers synchronous response");
+ if (!response.isEmpty()) {
+ JSONObject jsonResponse = new JSONObject(response);
+ if (jsonResponse.has("requestStatus")) {
+ String status = jsonResponse.getString("requestStatus");
+ if ("accepted".equals(status)) {
+ logger.debug("Sniro Managers synchronous response indicates accepted");
+ } else {
+ String message = jsonResponse.getString("statusMessage");
+ if (isNotBlank(message)) {
+ logger.debug("Sniro Managers response indicates failed: " + message);
+ } else {
+ logger.debug("Sniro Managers response indicates failed: no status message provided");
+ message = "error message not provided";
+ }
+ throw new BadResponseException("Sniro Managers synchronous response indicates failed: " + message);
+ }
+ } else {
+ logger.debug("Sniro Managers synchronous response does not contain: request status");
+ throw new BadResponseException("Sniro Managers synchronous response does not contain: request status");
+ }
+ } else {
+ logger.debug("Sniro Managers synchronous response is empty");
+ throw new BadResponseException("Sniro Managers synchronous response i is empty");
+ }
+ }
+
+ /**
+ * Validates the asynchronous/callback response from sniro manager which contains the homing and licensing solutions
+ *
+ * @throws BadResponseException
+ */
+ public static void validateSolution(String response) throws BadResponseException {
+ logger.debug("Validating Sniro Managers asynchronous callback response");
+ if (isNotBlank(response)) {
+ JSONObject jsonResponse = new JSONObject(response);
+ if (!jsonResponse.has("serviceException")) {
+ logger.debug("Sniro Managers asynchronous response is valid");
+ } else {
+ String message = jsonResponse.getJSONObject("serviceException").getString("text");
+ if (isNotBlank(message)) {
+ logger.debug("Sniro Managers response contains a service exception: " + message);
+ } else {
+ logger.debug(
+ "Sniro Managers response contains a service exception: no service exception text provided");
+ message = "error message not provided";
+ }
+ throw new BadResponseException(
+ "Sniro Managers asynchronous response contains a service exception: " + message);
+ }
+ } else {
+ logger.debug("Sniro Managers asynchronous response is empty");
+ throw new BadResponseException("Sniro Managers asynchronous response is empty");
+ }
+ }
+
+
+ /**
+ * Validates the release response from sniro conductor
+ *
+ * @throws BadResponseException
+ */
+ public void validateReleaseResponse(LinkedHashMap<String, Object> response) throws BadResponseException {
+ logger.debug("Validating Sniro Conductors response");
+ if (!response.isEmpty()) {
+ String status = (String) response.get("status");
+ if (isNotBlank(status)) {
+ if ("success".equals(status)) {
+ logger.debug("Sniro Conductors synchronous response indicates success");
+ } else {
+ String message = (String) response.get("message");
+ if (isNotBlank(message)) {
+ logger.debug("Sniro Conductors response indicates failed: " + message);
+ } else {
+ logger.debug("Sniro Conductors response indicates failed: error message not provided");
+ message = "error message not provided";
+ }
+ throw new BadResponseException(
+ "Sniro Conductors synchronous response indicates failed: " + message);
+ }
+ } else {
+ logger.debug("Sniro Managers Conductors response does not contain: status");
+ throw new BadResponseException("Sniro Conductors synchronous response does not contain: status");
+ }
+ } else {
+ logger.debug("Sniro Conductors response is empty");
+ throw new BadResponseException("Sniro Conductors response is empty");
+ }
+
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/Candidate.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/Candidate.java
new file mode 100644
index 0000000000..87e81ccaad
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/Candidate.java
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 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.onap.so.client.sniro.beans;
+
+import java.io.Serializable;
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Candidate implements Serializable {
+
+ private static final long serialVersionUID = -5474502255533410907L;
+
+ @JsonProperty("identifierType")
+ private CandidateType identifierType;
+ @JsonProperty("identifiers")
+ private List<String> identifiers;
+ @JsonProperty("cloudOwner")
+ private String cloudOwner;
+
+ public Candidate() {}
+
+ public Candidate(CandidateType identifierType, List<String> identifiers, String cloudOwner) {
+ this.identifierType = identifierType;
+ this.identifiers = identifiers;
+ this.cloudOwner = cloudOwner;
+ }
+
+ public CandidateType getIdentifierType() {
+ return identifierType;
+ }
+
+ public void setIdentifierType(CandidateType identifierType) {
+ this.identifierType = identifierType;
+ }
+
+ public List<String> getIdentifiers() {
+ return identifiers;
+ }
+
+ public void setIdentifiers(List<String> identifiers) {
+ this.identifiers = identifiers;
+ }
+
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/CandidateType.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/CandidateType.java
new file mode 100644
index 0000000000..3ef89184e2
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/CandidateType.java
@@ -0,0 +1,41 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.onap.so.client.sniro.beans;
+
+import com.fasterxml.jackson.annotation.JsonValue;
+
+public enum CandidateType {
+
+
+ SERVICE_INSTANCE_ID("serviceInstanceId"), CLOUD_REGION_ID("cloudRegionId"), VNF_ID("vnfId"), VNF_NAME("vnfName");
+
+ private final String name;
+
+ private CandidateType(String name) {
+ this.name = name;
+ }
+
+ @Override
+ @JsonValue
+ public String toString() {
+ return name;
+ }
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ConductorProperties.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ConductorProperties.java
new file mode 100644
index 0000000000..0250ea06b4
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ConductorProperties.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.onap.so.client.sniro.beans;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+@Component
+@Configuration
+public class ConductorProperties {
+
+ private static Environment environment;
+
+ @Autowired
+ public void setEnvironment(Environment environment) {
+ this.environment = environment;
+ }
+
+ public static String getHost() {
+ return getProperty("sniro.conductor.host");
+ }
+
+ public static String getUri() {
+ return getProperty("sniro.conductor.uri");
+ }
+
+ public static String getAuth() {
+ return getProperty("sniro.conductor.headers.auth");
+ }
+
+ private static String getProperty(String variableName) {
+ if (environment != null) {
+ return environment.getProperty(variableName);
+ } else {
+ return null;
+ }
+ }
+
+
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/Demand.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/Demand.java
new file mode 100644
index 0000000000..0cc993560d
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/Demand.java
@@ -0,0 +1,103 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 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.onap.so.client.sniro.beans;
+
+import java.io.Serializable;
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Demand implements Serializable {
+
+ private static final long serialVersionUID = 5676094538091859816L;
+
+ @JsonProperty("serviceResourceId")
+ private String serviceResourceId;
+ @JsonProperty("resourceModuleName")
+ private String resourceModuleName;
+ @JsonProperty("resourceModelInfo")
+ private ModelInfo modelInfo;
+ @JsonProperty("requiredCandidates")
+ private List<Candidate> requiredCandidates;
+ @JsonProperty("excludedCandidates")
+ private List<Candidate> excludedCandidates;
+ @JsonProperty("existingCandidates")
+ private List<Candidate> existingCandidates;
+ @JsonProperty("filteringAttributes")
+ private List<Candidate> filteringAttributes;
+
+
+ public List<Candidate> getRequiredCandidates() {
+ return requiredCandidates;
+ }
+
+ public void setRequiredCandidates(List<Candidate> requiredCandidates) {
+ this.requiredCandidates = requiredCandidates;
+ }
+
+ public List<Candidate> getExcludedCandidates() {
+ return excludedCandidates;
+ }
+
+ public void setExcludedCandidates(List<Candidate> excludedCandidates) {
+ this.excludedCandidates = excludedCandidates;
+ }
+
+ public String getServiceResourceId() {
+ return serviceResourceId;
+ }
+
+ public void setServiceResourceId(String serviceResourceId) {
+ this.serviceResourceId = serviceResourceId;
+ }
+
+ public String getResourceModuleName() {
+ return resourceModuleName;
+ }
+
+ public void setResourceModuleName(String resourceModuleName) {
+ this.resourceModuleName = resourceModuleName;
+ }
+
+ public ModelInfo getModelInfo() {
+ return modelInfo;
+ }
+
+ public void setModelInfo(ModelInfo modelInfo) {
+ this.modelInfo = modelInfo;
+ }
+
+ public List<Candidate> getExistingCandidates() {
+ return existingCandidates;
+ }
+
+ public void setExistingCandidates(List<Candidate> existingCandidates) {
+ this.existingCandidates = existingCandidates;
+ }
+
+ public List<Candidate> getFilteringAttributes() {
+ return filteringAttributes;
+ }
+
+ public void setFilteringAttributes(List<Candidate> filteringAttributes) {
+ this.filteringAttributes = filteringAttributes;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/LicenseInfo.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/LicenseInfo.java
new file mode 100644
index 0000000000..9ab3ae673a
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/LicenseInfo.java
@@ -0,0 +1,44 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 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.onap.so.client.sniro.beans;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class LicenseInfo implements Serializable {
+
+ private static final long serialVersionUID = 6878164369491185856L;
+
+ @JsonProperty("licenseDemands")
+ private List<Demand> demands = new ArrayList<>();
+
+
+ public List<Demand> getDemands() {
+ return demands;
+ }
+
+ public void setDemands(List<Demand> demands) {
+ this.demands = demands;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ManagerProperties.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ManagerProperties.java
new file mode 100644
index 0000000000..70b1a37b5e
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ManagerProperties.java
@@ -0,0 +1,62 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.onap.so.client.sniro.beans;
+
+import java.util.Map;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+@ConfigurationProperties(prefix = "sniro.manager")
+public class ManagerProperties {
+
+ private String host;
+ private Map<String, String> uri;
+ private Map<String, String> headers;
+
+
+ public String getHost() {
+ return host;
+ }
+
+ public void setHost(String host) {
+ this.host = host;
+ }
+
+ public Map<String, String> getUri() {
+ return uri;
+ }
+
+ public void setUri(Map<String, String> uri) {
+ this.uri = uri;
+ }
+
+ public Map<String, String> getHeaders() {
+ return headers;
+ }
+
+ public void setHeaders(Map<String, String> headers) {
+ this.headers = headers;
+ }
+
+
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ModelInfo.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ModelInfo.java
new file mode 100644
index 0000000000..6c1932e344
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ModelInfo.java
@@ -0,0 +1,76 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 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.onap.so.client.sniro.beans;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonPropertyOrder({"modelName", "modelVersionId", "modelVersion", "modelInvariantId"})
+@JsonRootName("modelInfo")
+public class ModelInfo implements Serializable {
+
+ private static final long serialVersionUID = 1488642558601651075L;
+
+ @JsonProperty("modelInvariantId")
+ private String modelInvariantId;
+ @JsonProperty("modelVersionId")
+ private String modelVersionId;
+ @JsonProperty("modelName")
+ private String modelName;
+ @JsonProperty("modelVersion")
+ private String modelVersion;
+
+
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ public String getModelName() {
+ return modelName;
+ }
+
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ public String getModelVersion() {
+ return modelVersion;
+ }
+
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/PlacementInfo.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/PlacementInfo.java
new file mode 100644
index 0000000000..bbbbf9cfd6
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/PlacementInfo.java
@@ -0,0 +1,70 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 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.onap.so.client.sniro.beans;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonRawValue;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonPropertyOrder({"subscriberInfo", "placementDemands", "requestParameters"})
+@JsonRootName("placementInfo")
+public class PlacementInfo implements Serializable {
+
+ private static final long serialVersionUID = -964488472247386556L;
+
+ @JsonProperty("subscriberInfo")
+ private SubscriberInfo subscriberInfo;
+ @JsonProperty("placementDemands")
+ private List<Demand> demands = new ArrayList<>();
+ @JsonRawValue
+ @JsonProperty("requestParameters")
+ private String requestParameters;
+
+
+ public SubscriberInfo getSubscriberInfo() {
+ return subscriberInfo;
+ }
+
+ public void setSubscriberInfo(SubscriberInfo subscriberInfo) {
+ this.subscriberInfo = subscriberInfo;
+ }
+
+ public List<Demand> getDemands() {
+ return demands;
+ }
+
+ public void setDemands(List<Demand> demands) {
+ this.demands = demands;
+ }
+
+ public String getRequestParameters() {
+ return requestParameters;
+ }
+
+ public void setRequestParameters(String requestParameters) {
+ this.requestParameters = requestParameters;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/RequestInfo.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/RequestInfo.java
new file mode 100644
index 0000000000..fc6aec7d14
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/RequestInfo.java
@@ -0,0 +1,95 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.onap.so.client.sniro.beans;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+
+@JsonRootName("requestInfo")
+public class RequestInfo implements Serializable {
+
+ private static final long serialVersionUID = -759180997599143791L;
+
+ @JsonProperty("transactionId")
+ String transactionId;
+ @JsonProperty("requestId")
+ String requestId;
+ @JsonProperty("callbackUrl")
+ String callbackUrl;
+ @JsonProperty("sourceId")
+ String sourceId = "mso";
+ @JsonProperty("requestType")
+ String requestType;
+ @JsonProperty("timeout")
+ long timeout;
+
+ public String getTransactionId() {
+ return transactionId;
+ }
+
+ public void setTransactionId(String transactionId) {
+ this.transactionId = transactionId;
+ }
+
+ public String getRequestId() {
+ return requestId;
+ }
+
+ public void setRequestId(String requestId) {
+ this.requestId = requestId;
+ }
+
+ public String getCallbackUrl() {
+ return callbackUrl;
+ }
+
+ public void setCallbackUrl(String callbackUrl) {
+ this.callbackUrl = callbackUrl;
+ }
+
+ public String getSourceId() {
+ return sourceId;
+ }
+
+ public void setSourceId(String sourceId) {
+ this.sourceId = sourceId;
+ }
+
+ public String getRequestType() {
+ return requestType;
+ }
+
+ public void setRequestType(String requestType) {
+ this.requestType = requestType;
+ }
+
+ public long getTimeout() {
+ return timeout;
+ }
+
+ public void setTimeout(long timeout) {
+ this.timeout = timeout;
+ }
+
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/Resource.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/Resource.java
new file mode 100644
index 0000000000..b5d40a8e80
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/Resource.java
@@ -0,0 +1,54 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.onap.so.client.sniro.beans;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class Resource implements Serializable {
+
+ private static final long serialVersionUID = 5949861520571440421L;
+
+ @JsonProperty("service-resource-id")
+ private String serviceResourceId;
+ @JsonProperty("status")
+ private String status;
+
+
+ public String getServiceResourceId() {
+ return serviceResourceId;
+ }
+
+ public void setServiceResourceId(String serviceResourceId) {
+ this.serviceResourceId = serviceResourceId;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ServiceInfo.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ServiceInfo.java
new file mode 100644
index 0000000000..8b6f234c1e
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/ServiceInfo.java
@@ -0,0 +1,76 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 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.onap.so.client.sniro.beans;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonPropertyOrder({"modelInfo", "serviceRole", "serviceInstanceId", "serviceName"})
+@JsonRootName("serviceInfo")
+public class ServiceInfo implements Serializable {
+
+ private static final long serialVersionUID = -6866022419398548585L;
+
+ @JsonProperty("serviceInstanceId")
+ private String serviceInstanceId;
+ @JsonProperty("serviceName")
+ private String serviceName;
+ @JsonProperty("serviceRole")
+ private String serviceRole;
+ @JsonProperty("modelInfo")
+ private ModelInfo modelInfo;
+
+
+ public String getServiceInstanceId() {
+ return serviceInstanceId;
+ }
+
+ public void setServiceInstanceId(String serviceInstanceId) {
+ this.serviceInstanceId = serviceInstanceId;
+ }
+
+ public String getServiceName() {
+ return serviceName;
+ }
+
+ public void setServiceName(String serviceName) {
+ this.serviceName = serviceName;
+ }
+
+ public String getServiceRole() {
+ return serviceRole;
+ }
+
+ public void setServiceRole(String serviceRole) {
+ this.serviceRole = serviceRole;
+ }
+
+ public ModelInfo getModelInfo() {
+ return modelInfo;
+ }
+
+ public void setModelInfo(ModelInfo modelInfo) {
+ this.modelInfo = modelInfo;
+ }
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java
new file mode 100644
index 0000000000..b8896a2bab
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java
@@ -0,0 +1,66 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
+ * 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.onap.so.client.sniro.beans;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.ObjectWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class SniroConductorRequest implements Serializable {
+
+ private static final long serialVersionUID = 1906052095861777655L;
+ private static final Logger logger = LoggerFactory.getLogger(SniroConductorRequest.class);
+
+ @JsonProperty("release-locks")
+ private List<Resource> resources = new ArrayList<>();
+
+
+ public List<Resource> getResources() {
+ return resources;
+ }
+
+ @JsonInclude(Include.NON_NULL)
+ public String toJsonString() {
+ String json = "";
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.setSerializationInclusion(Include.NON_NULL);
+ ObjectWriter ow = mapper.writer().withDefaultPrettyPrinter();
+ try {
+ json = ow.writeValueAsString(this);
+ } catch (Exception e) {
+ logger.error("Unable to convert SniroConductorRequest to string", e);
+ }
+ return json;
+ }
+
+
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java
new file mode 100644
index 0000000000..4babbe5c39
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java
@@ -0,0 +1,98 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
+ * 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.onap.so.client.sniro.beans;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.ObjectWriter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class SniroManagerRequest implements Serializable {
+
+ private static final long serialVersionUID = -1541132882892163132L;
+ private static final Logger logger = LoggerFactory.getLogger(SniroManagerRequest.class);
+
+ @JsonProperty("requestInfo")
+ private RequestInfo requestInformation;
+ @JsonProperty("serviceInfo")
+ private ServiceInfo serviceInformation;
+ @JsonProperty("placementInfo")
+ private PlacementInfo placementInformation;
+ @JsonProperty("licenseInfo")
+ private LicenseInfo licenseInformation;
+
+
+ public RequestInfo getRequestInformation() {
+ return requestInformation;
+ }
+
+ public void setRequestInformation(RequestInfo requestInformation) {
+ this.requestInformation = requestInformation;
+ }
+
+ public ServiceInfo getServiceInformation() {
+ return serviceInformation;
+ }
+
+ public void setServiceInformation(ServiceInfo serviceInformation) {
+ this.serviceInformation = serviceInformation;
+ }
+
+ public PlacementInfo getPlacementInformation() {
+ return placementInformation;
+ }
+
+ public void setPlacementInformation(PlacementInfo placementInformation) {
+ this.placementInformation = placementInformation;
+ }
+
+ public LicenseInfo getLicenseInformation() {
+ return licenseInformation;
+ }
+
+ public void setLicenseInformation(LicenseInfo licenseInformation) {
+ this.licenseInformation = licenseInformation;
+ }
+
+
+ @JsonInclude(Include.NON_NULL)
+ public String toJsonString() {
+ String json = "";
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.setSerializationInclusion(Include.NON_NULL);
+ ObjectWriter ow = mapper.writer().withDefaultPrettyPrinter();
+ try {
+ json = ow.writeValueAsString(this);
+ } catch (Exception e) {
+ logger.error("Unable to convert SniroManagerRequest to string", e);
+ }
+ return json.replaceAll("\\\\", "");
+ }
+
+
+}
diff --git a/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/SubscriberInfo.java b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/SubscriberInfo.java
new file mode 100644
index 0000000000..35a4cac459
--- /dev/null
+++ b/so-optimization-clients/src/main/java/org/onap/so/client/sniro/beans/SubscriberInfo.java
@@ -0,0 +1,64 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 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.onap.so.client.sniro.beans;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonRootName;
+
+@JsonRootName("subscriberInfo")
+public class SubscriberInfo implements Serializable {
+
+ private static final long serialVersionUID = -6350949051379748872L;
+
+ @JsonProperty("globalSubscriberId")
+ private String globalSubscriberId;
+ @JsonProperty("subscriberName")
+ private String subscriberName;
+ @JsonProperty("subscriberCommonSiteId")
+ private String subscriberCommonSiteId;
+
+
+ public String getGlobalSubscriberId() {
+ return globalSubscriberId;
+ }
+
+ public void setGlobalSubscriberId(String globalSubscriberId) {
+ this.globalSubscriberId = globalSubscriberId;
+ }
+
+ public String getSubscriberName() {
+ return subscriberName;
+ }
+
+ public void setSubscriberName(String subscriberName) {
+ this.subscriberName = subscriberName;
+ }
+
+ public String getSubscriberCommonSiteId() {
+ return subscriberCommonSiteId;
+ }
+
+ public void setSubscriberCommonSiteId(String subscriberCommonSiteId) {
+ this.subscriberCommonSiteId = subscriberCommonSiteId;
+ }
+
+}
diff --git a/so-optimization-clients/src/test/java/org/onap/so/BaseIntegrationTest.java b/so-optimization-clients/src/test/java/org/onap/so/BaseIntegrationTest.java
new file mode 100644
index 0000000000..7dccfd3208
--- /dev/null
+++ b/so-optimization-clients/src/test/java/org/onap/so/BaseIntegrationTest.java
@@ -0,0 +1,63 @@
+/*-
+ * ============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.onap.so;
+
+import java.io.IOException;
+import java.io.InputStream;
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.onap.so.client.oof.OofClient;
+import org.onap.so.client.sniro.SniroClient;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.mock.mockito.SpyBean;
+import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringRunner;
+import com.github.tomakehurst.wiremock.WireMockServer;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest(classes = TestApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
+@ActiveProfiles("test")
+@ContextConfiguration
+@AutoConfigureWireMock(port = 0)
+public abstract class BaseIntegrationTest {
+
+ @Value("${wiremock.server.port}")
+ protected String wireMockPort;
+
+ @SpyBean
+ protected SniroClient sniroClient;
+
+ @SpyBean
+ protected OofClient oofClient;
+
+ @Autowired
+ protected WireMockServer wireMockServer;
+
+ @Before
+ public void baseTestBefore() {
+ wireMockServer.resetAll();
+ }
+}
+
+
diff --git a/so-optimization-clients/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java b/so-optimization-clients/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java
new file mode 100644
index 0000000000..62d9ecee44
--- /dev/null
+++ b/so-optimization-clients/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java
@@ -0,0 +1,60 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.onap.so;
+
+import ch.vorburger.exec.ManagedProcessException;
+import ch.vorburger.mariadb4j.DBConfigurationBuilder;
+import ch.vorburger.mariadb4j.springframework.MariaDB4jSpringService;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.jdbc.DataSourceBuilder;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import javax.sql.DataSource;
+
+@Configuration
+@Profile({"test"})
+public class EmbeddedMariaDbConfig {
+
+ @Bean
+ MariaDB4jSpringService mariaDB4jSpringService() {
+ MariaDB4jSpringService service = new MariaDB4jSpringService();
+
+
+ service.getConfiguration().addArg("--lower_case_table_names=1");
+ return service;
+ }
+
+ @Bean
+ DataSource dataSource(MariaDB4jSpringService mariaDB4jSpringService,
+ @Value("${mariaDB4j.databaseName}") String databaseName,
+ @Value("${spring.datasource.username}") String datasourceUsername,
+ @Value("${spring.datasource.password}") String datasourcePassword,
+ @Value("${spring.datasource.driver-class-name}") String datasourceDriver) throws ManagedProcessException {
+ // Create our database with default root user and no password
+ mariaDB4jSpringService.getDB().createDB(databaseName);
+
+ DBConfigurationBuilder config = mariaDB4jSpringService.getConfiguration();
+
+ return DataSourceBuilder.create().username(datasourceUsername).password(datasourcePassword)
+ .url(config.getURL(databaseName)).driverClassName(datasourceDriver).build();
+ }
+}
diff --git a/so-optimization-clients/src/test/java/org/onap/so/IntegrationTestSuite.java b/so-optimization-clients/src/test/java/org/onap/so/IntegrationTestSuite.java
new file mode 100644
index 0000000000..50bbc1845f
--- /dev/null
+++ b/so-optimization-clients/src/test/java/org/onap/so/IntegrationTestSuite.java
@@ -0,0 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.onap.so;
+
+import org.junit.runner.RunWith;
+import com.googlecode.junittoolbox.SuiteClasses;
+import com.googlecode.junittoolbox.WildcardPatternSuite;
+
+@RunWith(WildcardPatternSuite.class)
+@SuiteClasses({"**/*IT.class"})
+public class IntegrationTestSuite {
+
+}
diff --git a/so-optimization-clients/src/test/java/org/onap/so/TestApplication.java b/so-optimization-clients/src/test/java/org/onap/so/TestApplication.java
new file mode 100644
index 0000000000..fe965b4444
--- /dev/null
+++ b/so-optimization-clients/src/test/java/org/onap/so/TestApplication.java
@@ -0,0 +1,43 @@
+package org.onap.so;
+/*-
+ * ============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=========================================================
+ */
+
+
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.ComponentScan.Filter;
+import org.springframework.context.annotation.FilterType;
+import org.springframework.context.annotation.Profile;
+
+@SpringBootApplication
+@Profile("test")
+@ComponentScan(basePackages = {"org.onap.so"},
+ excludeFilters = {@Filter(type = FilterType.ANNOTATION, classes = SpringBootApplication.class)})
+public class TestApplication {
+ public static void main(String... args) {
+ SpringApplication.run(TestApplication.class, args);
+ System.getProperties().setProperty("mso.db", "MARIADB");
+ System.getProperties().setProperty("server.name", "Springboot");
+
+
+ }
+}
diff --git a/so-optimization-clients/src/test/java/org/onap/so/client/oof/OofClientTestIT.java b/so-optimization-clients/src/test/java/org/onap/so/client/oof/OofClientTestIT.java
new file mode 100644
index 0000000000..a54d34a944
--- /dev/null
+++ b/so-optimization-clients/src/test/java/org/onap/so/client/oof/OofClientTestIT.java
@@ -0,0 +1,218 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Intel Corp. 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.onap.so.client.oof;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import java.util.ArrayList;
+import java.util.List;
+import org.junit.Test;
+import org.onap.so.BaseIntegrationTest;
+import org.onap.so.client.exception.BadResponseException;
+import org.onap.so.client.oof.beans.LicenseInfo;
+import org.onap.so.client.oof.beans.ModelInfo;
+import org.onap.so.client.oof.beans.OofRequest;
+import org.onap.so.client.oof.beans.OofRequestParameters;
+import org.onap.so.client.oof.beans.PlacementDemand;
+import org.onap.so.client.oof.beans.PlacementInfo;
+import org.onap.so.client.oof.beans.RequestInfo;
+import org.onap.so.client.oof.beans.ResourceModelInfo;
+import org.onap.so.client.oof.beans.ServiceInfo;
+import org.onap.so.client.oof.beans.SubscriberInfo;
+import org.skyscreamer.jsonassert.JSONAssert;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.fasterxml.jackson.core.JsonProcessingException;
+
+
+public class OofClientTestIT extends BaseIntegrationTest {
+
+ @Autowired
+ private OofClient client;
+
+ @Test
+ public void testPostDemands_success() throws BadResponseException, JsonProcessingException {
+ String mockResponse =
+ "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"status\", \"requestStatus\": \"accepted\"}";
+
+ ModelInfo modelInfo = new ModelInfo();
+ modelInfo.setModelCustomizationName("modelCustomizationName-Service");
+ modelInfo.setModelInvariantId("modelInvariantId-Service");
+ modelInfo.setModelName("modelName-Service");
+ modelInfo.setModelType("modelType-Service");
+ modelInfo.setModelVersion("modelVersion-Service");
+ modelInfo.setModelVersionId("modelVersionId-Service");
+
+ ServiceInfo serviceInfo = new ServiceInfo();
+ serviceInfo.setModelInfo(modelInfo);
+ serviceInfo.setServiceInstanceId("serviceInstanceId");
+ serviceInfo.setServiceName("serviceName");
+
+ SubscriberInfo subscriberInfo = new SubscriberInfo();
+ subscriberInfo.setGlobalSubscriberId("globalSubscriberId");
+ subscriberInfo.setSubscriberCommonSiteId("subscriberCommonSiteId");
+ subscriberInfo.setSubscriberName("subscriberName");
+
+ ResourceModelInfo resourceModelInfo = new ResourceModelInfo();
+ resourceModelInfo.setModelType("modelType");
+ resourceModelInfo.setModelCustomizationName("modelCustomizationName");
+ resourceModelInfo.setModelInvariantId("invarianteId");
+ resourceModelInfo.setModelName("modelName");
+ resourceModelInfo.setModelVersion("version");
+ resourceModelInfo.setModelVersionId("versionId");
+
+ PlacementDemand placementDemand = new PlacementDemand();
+ placementDemand.setResourceModelInfo(resourceModelInfo);
+ placementDemand.setResourceModuleName("resourceModuleName");
+ placementDemand.setServiceResourceId("serviceResourceId");
+ placementDemand.setTenantId("tenantId");
+
+ OofRequestParameters oofRequestParameters = new OofRequestParameters();
+ oofRequestParameters.setCustomerLatitude("customerLatitude");
+ oofRequestParameters.setCustomerLongitude("customerLongitude");
+ oofRequestParameters.setCustomerName("customerName");
+
+ ArrayList<PlacementDemand> placementDemands = new ArrayList<>();
+ placementDemands.add(placementDemand);
+
+ PlacementInfo placementInfo = new PlacementInfo();
+ placementInfo.setPlacementDemands(placementDemands);
+ placementInfo.setRequestParameters(oofRequestParameters);
+ placementInfo.setSubscriberInfo(subscriberInfo);
+
+ RequestInfo requestInfo = new RequestInfo();
+ requestInfo.setTransactionId("transactionId");
+ List<String> optimizer = new ArrayList<>();
+ optimizer.add("optimizer1");
+ optimizer.add("optimizer2");
+ requestInfo.setOptimizers(optimizer);
+ requestInfo.setCallbackUrl("callBackUrl");
+ requestInfo.setNumSolutions(1);
+ requestInfo.setRequestId("requestId");
+ requestInfo.setSourceId("sourceId");
+ requestInfo.setTimeout(30L);
+ requestInfo.setRequestType("requestType");
+
+ OofRequest oofRequest = new OofRequest();
+ oofRequest.setRequestInformation(requestInfo);
+ oofRequest.setPlacementInformation(placementInfo);
+ oofRequest.setServiceInformation(serviceInfo);
+ oofRequest.setLicenseInformation(new LicenseInfo());
+
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+ client.postDemands(oofRequest);
+
+ String oofRequestOutput = oofRequest.toJsonString();
+ JSONAssert.assertEquals("{\n" + " \"requestInfo\" : {\n" + " \"transactionId\" : \"transactionId\",\n"
+ + " \"requestId\" : \"requestId\",\n" + " \"callbackUrl\" : \"callBackUrl\",\n"
+ + " \"sourceId\" : \"sourceId\",\n" + " \"requestType\" : \"requestType\",\n"
+ + " \"numSolutions\" : 1,\n" + " \"optimizers\" : [ \"optimizer1\", \"optimizer2\" ],\n"
+ + " \"timeout\" : 30\n" + " },\n" + " \"serviceInfo\" : {\n"
+ + " \"serviceInstanceId\" : \"serviceInstanceId\",\n" + " \"serviceName\" : \"serviceName\",\n"
+ + " \"modelInfo\" : {\n" + " \"modelType\" : \"modelType-Service\",\n"
+ + " \"modelInvariantId\" : \"modelInvariantId-Service\",\n"
+ + " \"modelVersionId\" : \"modelVersionId-Service\",\n"
+ + " \"modelName\" : \"modelName-Service\",\n"
+ + " \"modelVersion\" : \"modelVersion-Service\",\n"
+ + " \"modelCustomizationName\" : \"modelCustomizationName-Service\"\n" + " }\n" + " },\n"
+ + " \"placementInfo\" : {\n" + " \"requestParameters\" : {\n"
+ + " \"customerLatitude\" : \"customerLatitude\",\n"
+ + " \"customerLongitude\" : \"customerLongitude\",\n"
+ + " \"customerName\" : \"customerName\"\n" + " },\n" + " \"subscriberInfo\" : {\n"
+ + " \"globalSubscriberId\" : \"globalSubscriberId\",\n"
+ + " \"subscriberName\" : \"subscriberName\",\n"
+ + " \"subscriberCommonSiteId\" : \"subscriberCommonSiteId\"\n" + " },\n"
+ + " \"placementDemands\" : [ {\n" + " \"resourceModuleName\" : \"resourceModuleName\",\n"
+ + " \"serviceResourceId\" : \"serviceResourceId\",\n" + " \"tenantId\" : \"tenantId\",\n"
+ + " \"resourceModelInfo\" : {\n" + " \"modelType\" : \"modelType\",\n"
+ + " \"modelInvariantId\" : \"invarianteId\",\n" + " \"modelVersionId\" : \"versionId\",\n"
+ + " \"modelName\" : \"modelName\",\n" + " \"modelVersion\" : \"version\",\n"
+ + " \"modelCustomizationName\" : \"modelCustomizationName\"\n" + " }\n" + " } ]\n"
+ + " },\n" + " \"licenseInfo\" : { \n" + " \"licenseDemands\" : [ ]\n" + "}\n" + "}",
+ oofRequestOutput.replace("\r\n", "\n"), false);
+ }
+
+ @Test
+ public void testAsyncResponse_success() throws BadResponseException, JsonProcessingException {
+ String mockResponse =
+ "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"status\", \"requestStatus\": \"accepted\"}";
+
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+ client.postDemands(new OofRequest());
+ }
+
+ @Test(expected = BadResponseException.class)
+ public void testPostDemands_error_failed() throws JsonProcessingException, BadResponseException {
+ String mockResponse =
+ "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"missing data\", \"requestStatus\": \"failed\"}";
+
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+
+ client.postDemands(new OofRequest());
+
+ // TODO assertEquals("missing data", );
+
+ }
+
+ @Test(expected = BadResponseException.class)
+ public void testPostDemands_error_noMessage() throws JsonProcessingException, BadResponseException {
+ String mockResponse =
+ "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"\", \"requestStatus\": \"failed\"}";
+
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+
+ client.postDemands(new OofRequest());
+
+ }
+
+ @Test(expected = BadResponseException.class)
+ public void testPostDemands_error_noStatus() throws JsonProcessingException, BadResponseException {
+ String mockResponse =
+ "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"missing data\", \"requestStatus\": null}";
+
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+
+ client.postDemands(new OofRequest());
+
+ }
+
+ @Test(expected = BadResponseException.class)
+ public void testPostDemands_error_empty() throws JsonProcessingException, BadResponseException {
+ String mockResponse = "{ }";
+
+ wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+
+ client.postDemands(new OofRequest());
+ }
+
+}
diff --git a/so-optimization-clients/src/test/java/org/onap/so/client/sniro/SniroClientTestIT.java b/so-optimization-clients/src/test/java/org/onap/so/client/sniro/SniroClientTestIT.java
new file mode 100644
index 0000000000..56c52388f8
--- /dev/null
+++ b/so-optimization-clients/src/test/java/org/onap/so/client/sniro/SniroClientTestIT.java
@@ -0,0 +1,158 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 - 2018 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.onap.so.client.sniro;
+
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.post;
+import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
+import org.junit.Test;
+import org.onap.so.BaseIntegrationTest;
+import org.onap.so.client.exception.BadResponseException;
+import org.onap.so.client.sniro.beans.SniroConductorRequest;
+import org.onap.so.client.sniro.beans.SniroManagerRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import com.fasterxml.jackson.core.JsonProcessingException;
+
+
+public class SniroClientTestIT extends BaseIntegrationTest {
+
+ @Autowired
+ private SniroClient client;
+
+
+ @Test(expected = Test.None.class)
+ public void testPostDemands_success() throws BadResponseException, JsonProcessingException {
+ String mockResponse =
+ "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"corys cool\", \"requestStatus\": \"accepted\"}";
+
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+ client.postDemands(new SniroManagerRequest());
+
+ }
+
+ @Test(expected = BadResponseException.class)
+ public void testPostDemands_error_failed() throws JsonProcessingException, BadResponseException {
+ String mockResponse =
+ "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"missing data\", \"requestStatus\": \"failed\"}";
+
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+
+ client.postDemands(new SniroManagerRequest());
+
+ // TODO assertEquals("missing data", );
+
+ }
+
+ @Test(expected = BadResponseException.class)
+ public void testPostDemands_error_noMessage() throws JsonProcessingException, BadResponseException {
+ String mockResponse =
+ "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"\", \"requestStatus\": \"failed\"}";
+
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+
+ client.postDemands(new SniroManagerRequest());
+
+ }
+
+ @Test(expected = BadResponseException.class)
+ public void testPostDemands_error_noStatus() throws JsonProcessingException, BadResponseException {
+ String mockResponse =
+ "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"missing data\", \"requestStatus\": null}";
+
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+
+ client.postDemands(new SniroManagerRequest());
+
+ }
+
+ @Test(expected = BadResponseException.class)
+ public void testPostDemands_error_empty() throws JsonProcessingException, BadResponseException {
+ String mockResponse = "{ }";
+
+ wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+
+ client.postDemands(new SniroManagerRequest());
+ }
+
+ @Test(expected = Test.None.class)
+ public void testPostRelease_success() throws BadResponseException, JsonProcessingException {
+ String mockResponse = "{\"status\": \"success\", \"message\": \"corys cool\"}";
+
+ wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+ client.postRelease(new SniroConductorRequest());
+ }
+
+ @Test(expected = BadResponseException.class)
+ public void testPostRelease_error_failed() throws BadResponseException, JsonProcessingException {
+ String mockResponse = "{\"status\": \"failure\", \"message\": \"corys cool\"}";
+
+ wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+ client.postRelease(new SniroConductorRequest());
+ }
+
+ @Test(expected = BadResponseException.class)
+ public void testPostRelease_error_noStatus() throws BadResponseException, JsonProcessingException {
+ String mockResponse = "{\"status\": \"\", \"message\": \"corys cool\"}";
+
+ wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+ client.postRelease(new SniroConductorRequest());
+
+ }
+
+ @Test(expected = BadResponseException.class)
+ public void testPostRelease_error_noMessage() throws BadResponseException, JsonProcessingException {
+ String mockResponse = "{\"status\": \"failure\", \"message\": null}";
+
+ wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+ client.postRelease(new SniroConductorRequest());
+
+ }
+
+ @Test(expected = BadResponseException.class)
+ public void testPostRelease_error_empty() throws BadResponseException, JsonProcessingException {
+ String mockResponse = "{ }";
+
+ wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
+ aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
+
+ client.postRelease(new SniroConductorRequest());
+
+ }
+
+}
diff --git a/so-optimization-clients/src/test/resources/application-test.yaml b/so-optimization-clients/src/test/resources/application-test.yaml
new file mode 100644
index 0000000000..75bd982d9b
--- /dev/null
+++ b/so-optimization-clients/src/test/resources/application-test.yaml
@@ -0,0 +1,231 @@
+aai:
+ auth: 5A1272FE739BECA4D4374A86B25C021DFE6745E3BB7BE6836BF64A6059B8220E586C21FD7567AF41DB42571EB7
+ endpoint: http://localhost:${wiremock.server.port}
+ pnfEntryNotificationTimeout: P14D
+appc:
+ client:
+ key: iaEMAfjsVsZnraBP
+ response:
+ timeout: '120000'
+ secret: wcivUjsjXzmGFBfxMmyJu9dz
+ poolMembers: localhost:3904
+ service: ueb
+ topic:
+ read:
+ name: APPC-TEST-AMDOCS2
+ timeout: '120000'
+ write: APPC-TEST-AMDOCS1-DEV3
+ sdnc:
+ read: SDNC-LCM-READ
+ write: SDNC-LCM-WRITE
+log:
+ debug:
+ CompleteMsoProcess: 'true'
+ CreateNetworkInstanceInfra: 'true'
+ CreateServiceInstanceInfra: 'true'
+ DeleteNetworkInstanceInfra: 'true'
+ FalloutHandler: 'true'
+ UpdateNetworkInstanceInfra: 'true'
+ VnfAdapterRestV1: 'true'
+ sdncAdapter: 'true'
+ vnfAdapterCreateV1: 'true'
+ vnfAdapterRestV1: 'true'
+pnf:
+ dmaap:
+ host: hostTest
+ port: 1234
+ protocol: http
+ uriPathPrefix: events
+ topicName: pnfReady
+ consumerGroup: consumerGroup
+ consumerId: consumerId
+ topicListenerDelayInSeconds: 5
+mso:
+ naming:
+ endpoint: http://localhost:${wiremock.server.port}/web/service/v1/genNetworkElementName
+ auth: Basic YnBlbDptc28tZGItMTUwNyE=
+ adapters:
+ requestDb:
+ auth: Basic YnBlbDptc28tZGItMTUwNyE=
+ endpoint: http://localhost:8081
+ completemsoprocess:
+ endpoint: http://localhost:${wiremock.server.port}/CompleteMsoProcess
+ db:
+ auth: 5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C
+ endpoint: http://localhost:${wiremock.server.port}/dbadapters/RequestsDbAdapter
+ spring:
+ endpoint: http://localhost:${wiremock.server.port}
+ network:
+ endpoint: http://localhost:${wiremock.server.port}/networks/NetworkAdapter
+ rest:
+ endpoint: http://localhost:${wiremock.server.port}/networks/rest/v1/networks
+ openecomp:
+ db:
+ endpoint: http://localhost:${wiremock.server.port}/dbadapters/RequestsDbAdapter
+ po:
+ auth: 5E12ACACBD552A415E081E29F2C4772F9835792A51C766CCFDD7433DB5220B59969CB2798C
+ password: 3141634BF7E070AA289CF2892C986C0B
+ sdnc:
+ endpoint: http://localhost:${wiremock.server.port}/SDNCAdapter
+ rest:
+ endpoint: http://localhost:${wiremock.server.port}/SDNCAdapter/v1/sdnc
+ timeout: PT60S
+ tenant:
+ endpoint: http://localhost:${wiremock.server.port}/tenantAdapterMock
+ vnf:
+ endpoint: http://localhost:${wiremock.server.port}/vnfs/VnfAdapter
+ rest:
+ endpoint: http://localhost:${wiremock.server.port}/services/rest/v1/vnfs
+ volume-groups:
+ rest:
+ endpoint: http://localhost:${wiremock.server.port}/services/rest/v1/volume-groups
+ vnf-async:
+ endpoint: http://localhost:${wiremock.server.port}/vnfs/VnfAdapterAsync
+ workflow:
+ message:
+ endpoint: http://localhost:${wiremock.server.port}/workflows/messages/message
+
+ async:
+ core-pool-size: 50
+ max-pool-size: 50
+ queue-capacity: 500
+
+ bpmn:
+ optimisticlockingexception:
+ retrycount: '3'
+ cloudRegionIdsToSkipAddingVnfEdgesTo: test25Region1,test25Region2,test25Region99
+ callbackRetryAttempts: '5'
+ catalog:
+ db:
+ endpoint: http://localhost:${wiremock.server.port}/
+ spring:
+ endpoint: http://localhost:${wiremock.server.port}
+ correlation:
+ timeout: 60
+ db:
+ auth: Basic YnBlbDptc28tZGItMTUwNyE=
+ default:
+ adapter:
+ namespace: http://org.onap.so
+ healthcheck:
+ log:
+ debug: 'false'
+ infra:
+ customer:
+ id: testCustIdInfra
+ logPath: logs
+ msoKey: 07a7159d3bf51a0e53be7a8f89699be7
+ po:
+ timeout: PT60S
+ request:
+ db:
+ endpoint: http://localhost:${wiremock.server.port}/
+ rollback: 'true'
+ site-name: localDevEnv
+ workflow:
+ default:
+ aai:
+ cloud-region:
+ version: '9'
+ generic-vnf:
+ version: '9'
+ global:
+ default:
+ aai:
+ namespace: http://org.openecomp.aai.inventory/
+ version: '8'
+ message:
+ endpoint: http://localhost:${wiremock.server.port}/mso/WorkflowMesssage
+ notification:
+ name: GenericNotificationService
+ sdncadapter:
+ callback: http://localhost:${wiremock.server.port}/mso/SDNCAdapterCallbackService
+ vnfadapter:
+ create:
+ callback: http://localhost:${wiremock.server.port}/mso/vnfAdapterNotify
+ delete:
+ callback: http://localhost:${wiremock.server.port}/mso/vnfAdapterNotify
+ query:
+ callback: http://localhost:${wiremock.server.port}/mso/services/VNFAdapterQuerCallbackV1
+ rollback:
+ callback: http://localhost:${wiremock.server.port}/mso/vnfAdapterNotify
+ global:
+ dmaap:
+ username: dmaapUsername
+ password: dmaapPassword
+ host: http://localhost:28090
+ publisher:
+ topic: com.att.mso.asyncStatusUpdate
+policy:
+ auth: Basic dGVzdHBkcDphbHBoYTEyMw==
+ client:
+ auth: Basic bTAzNzQzOnBvbGljeVIwY2sk
+ endpoint: https://localhost:8081/pdp/api/
+ environment: TEST
+sdnc:
+ auth: Basic YWRtaW46YWRtaW4=
+ host: http://localhost:${wiremock.server.port}
+ path: /restconf/operations/GENERIC-RESOURCE-API
+sniro:
+ conductor:
+ enabled: true
+ host: http://localhost:${wiremock.server.port}
+ uri: /v1/release-orders
+ headers.auth: Basic dGVzdDp0ZXN0cHdk
+ manager:
+ timeout: PT30M
+ host: http://localhost:${wiremock.server.port}
+ uri.v1: /sniro/api/v2/placement
+ uri.v2: /sniro/api/placement/v2
+ headers.auth: Basic dGVzdDp0ZXN0cHdk
+ headers.patchVersion: 1
+ headers.minorVersion: 1
+ headers.latestVersion: 2
+oof:
+ timeout: PT30M
+ host: http://localhost:${wiremock.server.port}
+ uri: /api/oof/v1/placement
+ headers.auth: Basic dGVzdDp0ZXN0cHdk
+org:
+ onap:
+ so:
+ cloud-owner: CloudOwner
+spring:
+ datasource:
+ jdbc-url: jdbc:mariadb://localhost:3307/camundabpmn
+ username: root
+ password: password
+ driver-class-name: org.mariadb.jdbc.Driver
+ initialization-mode: always
+ jpa:
+ generate-ddl: false
+ show-sql: false
+ hibernate:
+ ddl-auto: none
+ naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
+ enable-lazy-load-no-trans: true
+ database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+sdno:
+ health-check:
+ dmaap:
+ password: password
+ publisher:
+ topic: sdno.test-health-diagnostic-v02
+ subscriber:
+ topic: sdno.test-health-diagnostic-v02
+ username: username
+mariaDB4j:
+ dataDir:
+ port: 3307
+ databaseName: camundabpmn
+camunda:
+ bpm:
+ metrics:
+ enabled: false
+ db-reporter-activate: false
+# CDSProcessingClient
+cds:
+ endpoint: localhost
+ port: 11012
+ auth: Basic Y2NzZGthcHBzOmNjc2RrYXBwcw==
+ timeout: 60
diff --git a/so-optimization-clients/src/test/resources/schema.sql b/so-optimization-clients/src/test/resources/schema.sql
new file mode 100644
index 0000000000..5ae6a2d972
--- /dev/null
+++ b/so-optimization-clients/src/test/resources/schema.sql
@@ -0,0 +1,1195 @@
+
+USE `camundabpmn`;
+
+
+create table ACT_GE_PROPERTY (
+ NAME_ varchar(64),
+ VALUE_ varchar(300),
+ REV_ integer,
+ primary key (NAME_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+
+create table ACT_GE_BYTEARRAY (
+ ID_ varchar(64),
+ REV_ integer,
+ NAME_ varchar(255),
+ DEPLOYMENT_ID_ varchar(64),
+ BYTES_ LONGBLOB,
+ GENERATED_ TINYINT,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RE_DEPLOYMENT (
+ ID_ varchar(64),
+ NAME_ varchar(255),
+ DEPLOY_TIME_ timestamp(3),
+ SOURCE_ varchar(255),
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RU_EXECUTION (
+ ID_ varchar(64),
+ REV_ integer,
+ PROC_INST_ID_ varchar(64),
+ BUSINESS_KEY_ varchar(255),
+ PARENT_ID_ varchar(64),
+ PROC_DEF_ID_ varchar(64),
+ SUPER_EXEC_ varchar(64),
+ SUPER_CASE_EXEC_ varchar(64),
+ CASE_INST_ID_ varchar(64),
+ ACT_ID_ varchar(255),
+ ACT_INST_ID_ varchar(64),
+ IS_ACTIVE_ TINYINT,
+ IS_CONCURRENT_ TINYINT,
+ IS_SCOPE_ TINYINT,
+ IS_EVENT_SCOPE_ TINYINT,
+ SUSPENSION_STATE_ integer,
+ CACHED_ENT_STATE_ integer,
+ SEQUENCE_COUNTER_ bigint,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RU_JOB (
+ ID_ varchar(64) NOT NULL,
+ REV_ integer,
+ TYPE_ varchar(255) NOT NULL,
+ LOCK_EXP_TIME_ timestamp(3) NULL,
+ LOCK_OWNER_ varchar(255),
+ EXCLUSIVE_ boolean,
+ EXECUTION_ID_ varchar(64),
+ PROCESS_INSTANCE_ID_ varchar(64),
+ PROCESS_DEF_ID_ varchar(64),
+ PROCESS_DEF_KEY_ varchar(255),
+ RETRIES_ integer,
+ EXCEPTION_STACK_ID_ varchar(64),
+ EXCEPTION_MSG_ varchar(4000),
+ DUEDATE_ timestamp(3) NULL,
+ REPEAT_ varchar(255),
+ HANDLER_TYPE_ varchar(255),
+ HANDLER_CFG_ varchar(4000),
+ DEPLOYMENT_ID_ varchar(64),
+ SUSPENSION_STATE_ integer NOT NULL DEFAULT 1,
+ JOB_DEF_ID_ varchar(64),
+ PRIORITY_ bigint NOT NULL DEFAULT 0,
+ SEQUENCE_COUNTER_ bigint,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RU_JOBDEF (
+ ID_ varchar(64) NOT NULL,
+ REV_ integer,
+ PROC_DEF_ID_ varchar(64),
+ PROC_DEF_KEY_ varchar(255),
+ ACT_ID_ varchar(255),
+ JOB_TYPE_ varchar(255) NOT NULL,
+ JOB_CONFIGURATION_ varchar(255),
+ SUSPENSION_STATE_ integer,
+ JOB_PRIORITY_ bigint,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RE_PROCDEF (
+ ID_ varchar(64) not null,
+ REV_ integer,
+ CATEGORY_ varchar(255),
+ NAME_ varchar(255),
+ KEY_ varchar(255) not null,
+ VERSION_ integer not null,
+ DEPLOYMENT_ID_ varchar(64),
+ RESOURCE_NAME_ varchar(4000),
+ DGRM_RESOURCE_NAME_ varchar(4000),
+ HAS_START_FORM_KEY_ TINYINT,
+ SUSPENSION_STATE_ integer,
+ TENANT_ID_ varchar(64),
+ VERSION_TAG_ varchar(64),
+ HISTORY_TTL_ integer,
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RU_TASK (
+ ID_ varchar(64),
+ REV_ integer,
+ EXECUTION_ID_ varchar(64),
+ PROC_INST_ID_ varchar(64),
+ PROC_DEF_ID_ varchar(64),
+ CASE_EXECUTION_ID_ varchar(64),
+ CASE_INST_ID_ varchar(64),
+ CASE_DEF_ID_ varchar(64),
+ NAME_ varchar(255),
+ PARENT_TASK_ID_ varchar(64),
+ DESCRIPTION_ varchar(4000),
+ TASK_DEF_KEY_ varchar(255),
+ OWNER_ varchar(255),
+ ASSIGNEE_ varchar(255),
+ DELEGATION_ varchar(64),
+ PRIORITY_ integer,
+ CREATE_TIME_ timestamp(3),
+ DUE_DATE_ datetime(3),
+ FOLLOW_UP_DATE_ datetime(3),
+ SUSPENSION_STATE_ integer,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RU_IDENTITYLINK (
+ ID_ varchar(64),
+ REV_ integer,
+ GROUP_ID_ varchar(255),
+ TYPE_ varchar(255),
+ USER_ID_ varchar(255),
+ TASK_ID_ varchar(64),
+ PROC_DEF_ID_ varchar(64),
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RU_VARIABLE (
+ ID_ varchar(64) not null,
+ REV_ integer,
+ TYPE_ varchar(255) not null,
+ NAME_ varchar(255) not null,
+ EXECUTION_ID_ varchar(64),
+ PROC_INST_ID_ varchar(64),
+ CASE_EXECUTION_ID_ varchar(64),
+ CASE_INST_ID_ varchar(64),
+ TASK_ID_ varchar(64),
+ BYTEARRAY_ID_ varchar(64),
+ DOUBLE_ double,
+ LONG_ bigint,
+ TEXT_ LONGBLOB,
+ TEXT2_ LONGBLOB,
+ VAR_SCOPE_ varchar(64) not null,
+ SEQUENCE_COUNTER_ bigint,
+ IS_CONCURRENT_LOCAL_ TINYINT,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RU_EVENT_SUBSCR (
+ ID_ varchar(64) not null,
+ REV_ integer,
+ EVENT_TYPE_ varchar(255) not null,
+ EVENT_NAME_ varchar(255),
+ EXECUTION_ID_ varchar(64),
+ PROC_INST_ID_ varchar(64),
+ ACTIVITY_ID_ varchar(255),
+ CONFIGURATION_ varchar(255),
+ CREATED_ timestamp(3) not null,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RU_INCIDENT (
+ ID_ varchar(64) not null,
+ REV_ integer not null,
+ INCIDENT_TIMESTAMP_ timestamp(3) not null,
+ INCIDENT_MSG_ varchar(4000),
+ INCIDENT_TYPE_ varchar(255) not null,
+ EXECUTION_ID_ varchar(64),
+ ACTIVITY_ID_ varchar(255),
+ PROC_INST_ID_ varchar(64),
+ PROC_DEF_ID_ varchar(64),
+ CAUSE_INCIDENT_ID_ varchar(64),
+ ROOT_CAUSE_INCIDENT_ID_ varchar(64),
+ CONFIGURATION_ varchar(255),
+ TENANT_ID_ varchar(64),
+ JOB_DEF_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RU_AUTHORIZATION (
+ ID_ varchar(64) not null,
+ REV_ integer not null,
+ TYPE_ integer not null,
+ GROUP_ID_ varchar(255),
+ USER_ID_ varchar(255),
+ RESOURCE_TYPE_ integer not null,
+ RESOURCE_ID_ varchar(255),
+ PERMS_ integer,
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RU_FILTER (
+ ID_ varchar(64) not null,
+ REV_ integer not null,
+ RESOURCE_TYPE_ varchar(255) not null,
+ NAME_ varchar(255) not null,
+ OWNER_ varchar(255),
+ QUERY_ LONGTEXT not null,
+ PROPERTIES_ LONGTEXT,
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RU_METER_LOG (
+ ID_ varchar(64) not null,
+ NAME_ varchar(64) not null,
+ REPORTER_ varchar(255),
+ VALUE_ bigint,
+ TIMESTAMP_ timestamp(3),
+ MILLISECONDS_ bigint DEFAULT 0,
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RU_EXT_TASK (
+ ID_ varchar(64) not null,
+ REV_ integer not null,
+ WORKER_ID_ varchar(255),
+ TOPIC_NAME_ varchar(255),
+ RETRIES_ integer,
+ ERROR_MSG_ varchar(4000),
+ ERROR_DETAILS_ID_ varchar(64),
+ LOCK_EXP_TIME_ timestamp(3) NULL,
+ SUSPENSION_STATE_ integer,
+ EXECUTION_ID_ varchar(64),
+ PROC_INST_ID_ varchar(64),
+ PROC_DEF_ID_ varchar(64),
+ PROC_DEF_KEY_ varchar(255),
+ ACT_ID_ varchar(255),
+ ACT_INST_ID_ varchar(64),
+ TENANT_ID_ varchar(64),
+ PRIORITY_ bigint NOT NULL DEFAULT 0,
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_RU_BATCH (
+ ID_ varchar(64) not null,
+ REV_ integer not null,
+ TYPE_ varchar(255),
+ TOTAL_JOBS_ integer,
+ JOBS_CREATED_ integer,
+ JOBS_PER_SEED_ integer,
+ INVOCATIONS_PER_JOB_ integer,
+ SEED_JOB_DEF_ID_ varchar(64),
+ BATCH_JOB_DEF_ID_ varchar(64),
+ MONITOR_JOB_DEF_ID_ varchar(64),
+ SUSPENSION_STATE_ integer,
+ CONFIGURATION_ varchar(255),
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create index ACT_IDX_EXEC_BUSKEY on ACT_RU_EXECUTION(BUSINESS_KEY_);
+create index ACT_IDX_EXEC_TENANT_ID on ACT_RU_EXECUTION(TENANT_ID_);
+create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_);
+create index ACT_IDX_TASK_ASSIGNEE on ACT_RU_TASK(ASSIGNEE_);
+create index ACT_IDX_TASK_TENANT_ID on ACT_RU_TASK(TENANT_ID_);
+create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_);
+create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_);
+create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_);
+create index ACT_IDX_EVENT_SUBSCR_TENANT_ID on ACT_RU_EVENT_SUBSCR(TENANT_ID_);
+create index ACT_IDX_VARIABLE_TASK_ID on ACT_RU_VARIABLE(TASK_ID_);
+create index ACT_IDX_VARIABLE_TENANT_ID on ACT_RU_VARIABLE(TENANT_ID_);
+create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_);
+create index ACT_IDX_INC_CONFIGURATION on ACT_RU_INCIDENT(CONFIGURATION_);
+create index ACT_IDX_INC_TENANT_ID on ACT_RU_INCIDENT(TENANT_ID_);
+-- CAM-5914
+create index ACT_IDX_JOB_EXECUTION_ID on ACT_RU_JOB(EXECUTION_ID_);
+-- this index needs to be limited in mariadb see CAM-6938
+create index ACT_IDX_JOB_HANDLER on ACT_RU_JOB(HANDLER_TYPE_(100),HANDLER_CFG_(155));
+create index ACT_IDX_JOB_PROCINST on ACT_RU_JOB(PROCESS_INSTANCE_ID_);
+create index ACT_IDX_JOB_TENANT_ID on ACT_RU_JOB(TENANT_ID_);
+create index ACT_IDX_JOBDEF_TENANT_ID on ACT_RU_JOBDEF(TENANT_ID_);
+
+-- new metric milliseconds column
+CREATE INDEX ACT_IDX_METER_LOG_MS ON ACT_RU_METER_LOG(MILLISECONDS_);
+CREATE INDEX ACT_IDX_METER_LOG_NAME_MS ON ACT_RU_METER_LOG(NAME_, MILLISECONDS_);
+CREATE INDEX ACT_IDX_METER_LOG_REPORT ON ACT_RU_METER_LOG(NAME_, REPORTER_, MILLISECONDS_);
+
+-- old metric timestamp column
+CREATE INDEX ACT_IDX_METER_LOG_TIME ON ACT_RU_METER_LOG(TIMESTAMP_);
+CREATE INDEX ACT_IDX_METER_LOG ON ACT_RU_METER_LOG(NAME_, TIMESTAMP_);
+
+create index ACT_IDX_EXT_TASK_TOPIC on ACT_RU_EXT_TASK(TOPIC_NAME_);
+create index ACT_IDX_EXT_TASK_TENANT_ID on ACT_RU_EXT_TASK(TENANT_ID_);
+create index ACT_IDX_EXT_TASK_PRIORITY ON ACT_RU_EXT_TASK(PRIORITY_);
+create index ACT_IDX_EXT_TASK_ERR_DETAILS ON ACT_RU_EXT_TASK(ERROR_DETAILS_ID_);
+create index ACT_IDX_AUTH_GROUP_ID ON ACT_RU_AUTHORIZATION(GROUP_ID_);
+create index ACT_IDX_JOB_JOB_DEF_ID on ACT_RU_JOB(JOB_DEF_ID_);
+
+alter table ACT_GE_BYTEARRAY
+ add constraint ACT_FK_BYTEARR_DEPL
+ foreign key (DEPLOYMENT_ID_)
+ references ACT_RE_DEPLOYMENT (ID_);
+
+alter table ACT_RU_EXECUTION
+ add constraint ACT_FK_EXE_PROCINST
+ foreign key (PROC_INST_ID_)
+ references ACT_RU_EXECUTION (ID_) on delete cascade on update cascade;
+
+alter table ACT_RU_EXECUTION
+ add constraint ACT_FK_EXE_PARENT
+ foreign key (PARENT_ID_)
+ references ACT_RU_EXECUTION (ID_);
+
+alter table ACT_RU_EXECUTION
+ add constraint ACT_FK_EXE_SUPER
+ foreign key (SUPER_EXEC_)
+ references ACT_RU_EXECUTION (ID_);
+
+alter table ACT_RU_EXECUTION
+ add constraint ACT_FK_EXE_PROCDEF
+ foreign key (PROC_DEF_ID_)
+ references ACT_RE_PROCDEF (ID_);
+
+alter table ACT_RU_IDENTITYLINK
+ add constraint ACT_FK_TSKASS_TASK
+ foreign key (TASK_ID_)
+ references ACT_RU_TASK (ID_);
+
+alter table ACT_RU_IDENTITYLINK
+ add constraint ACT_FK_ATHRZ_PROCEDEF
+ foreign key (PROC_DEF_ID_)
+ references ACT_RE_PROCDEF(ID_);
+
+alter table ACT_RU_TASK
+ add constraint ACT_FK_TASK_EXE
+ foreign key (EXECUTION_ID_)
+ references ACT_RU_EXECUTION (ID_);
+
+alter table ACT_RU_TASK
+ add constraint ACT_FK_TASK_PROCINST
+ foreign key (PROC_INST_ID_)
+ references ACT_RU_EXECUTION (ID_);
+
+alter table ACT_RU_TASK
+ add constraint ACT_FK_TASK_PROCDEF
+ foreign key (PROC_DEF_ID_)
+ references ACT_RE_PROCDEF (ID_);
+
+alter table ACT_RU_VARIABLE
+ add constraint ACT_FK_VAR_EXE
+ foreign key (EXECUTION_ID_)
+ references ACT_RU_EXECUTION (ID_);
+
+alter table ACT_RU_VARIABLE
+ add constraint ACT_FK_VAR_PROCINST
+ foreign key (PROC_INST_ID_)
+ references ACT_RU_EXECUTION(ID_);
+
+alter table ACT_RU_VARIABLE
+ add constraint ACT_FK_VAR_BYTEARRAY
+ foreign key (BYTEARRAY_ID_)
+ references ACT_GE_BYTEARRAY (ID_);
+
+alter table ACT_RU_JOB
+ add constraint ACT_FK_JOB_EXCEPTION
+ foreign key (EXCEPTION_STACK_ID_)
+ references ACT_GE_BYTEARRAY (ID_);
+
+alter table ACT_RU_EVENT_SUBSCR
+ add constraint ACT_FK_EVENT_EXEC
+ foreign key (EXECUTION_ID_)
+ references ACT_RU_EXECUTION(ID_);
+
+alter table ACT_RU_INCIDENT
+ add constraint ACT_FK_INC_EXE
+ foreign key (EXECUTION_ID_)
+ references ACT_RU_EXECUTION (ID_);
+
+alter table ACT_RU_INCIDENT
+ add constraint ACT_FK_INC_PROCINST
+ foreign key (PROC_INST_ID_)
+ references ACT_RU_EXECUTION (ID_);
+
+alter table ACT_RU_INCIDENT
+ add constraint ACT_FK_INC_PROCDEF
+ foreign key (PROC_DEF_ID_)
+ references ACT_RE_PROCDEF (ID_);
+
+alter table ACT_RU_INCIDENT
+ add constraint ACT_FK_INC_CAUSE
+ foreign key (CAUSE_INCIDENT_ID_)
+ references ACT_RU_INCIDENT (ID_) on delete cascade on update cascade;
+
+alter table ACT_RU_INCIDENT
+ add constraint ACT_FK_INC_RCAUSE
+ foreign key (ROOT_CAUSE_INCIDENT_ID_)
+ references ACT_RU_INCIDENT (ID_) on delete cascade on update cascade;
+
+alter table ACT_RU_EXT_TASK
+ add constraint ACT_FK_EXT_TASK_ERROR_DETAILS
+ foreign key (ERROR_DETAILS_ID_)
+ references ACT_GE_BYTEARRAY (ID_);
+
+create index ACT_IDX_INC_JOB_DEF on ACT_RU_INCIDENT(JOB_DEF_ID_);
+alter table ACT_RU_INCIDENT
+ add constraint ACT_FK_INC_JOB_DEF
+ foreign key (JOB_DEF_ID_)
+ references ACT_RU_JOBDEF (ID_);
+
+alter table ACT_RU_AUTHORIZATION
+ add constraint ACT_UNIQ_AUTH_USER
+ unique (USER_ID_,TYPE_,RESOURCE_TYPE_,RESOURCE_ID_);
+
+alter table ACT_RU_AUTHORIZATION
+ add constraint ACT_UNIQ_AUTH_GROUP
+ unique (GROUP_ID_,TYPE_,RESOURCE_TYPE_,RESOURCE_ID_);
+
+alter table ACT_RU_VARIABLE
+ add constraint ACT_UNIQ_VARIABLE
+ unique (VAR_SCOPE_, NAME_);
+
+alter table ACT_RU_EXT_TASK
+ add constraint ACT_FK_EXT_TASK_EXE
+ foreign key (EXECUTION_ID_)
+ references ACT_RU_EXECUTION (ID_);
+
+create index ACT_IDX_BATCH_SEED_JOB_DEF ON ACT_RU_BATCH(SEED_JOB_DEF_ID_);
+alter table ACT_RU_BATCH
+ add constraint ACT_FK_BATCH_SEED_JOB_DEF
+ foreign key (SEED_JOB_DEF_ID_)
+ references ACT_RU_JOBDEF (ID_);
+
+create index ACT_IDX_BATCH_MONITOR_JOB_DEF ON ACT_RU_BATCH(MONITOR_JOB_DEF_ID_);
+alter table ACT_RU_BATCH
+ add constraint ACT_FK_BATCH_MONITOR_JOB_DEF
+ foreign key (MONITOR_JOB_DEF_ID_)
+ references ACT_RU_JOBDEF (ID_);
+
+create index ACT_IDX_BATCH_JOB_DEF ON ACT_RU_BATCH(BATCH_JOB_DEF_ID_);
+alter table ACT_RU_BATCH
+ add constraint ACT_FK_BATCH_JOB_DEF
+ foreign key (BATCH_JOB_DEF_ID_)
+ references ACT_RU_JOBDEF (ID_);
+
+-- indexes for deadlock problems - https://app.camunda.com/jira/browse/CAM-2567 --
+create index ACT_IDX_INC_CAUSEINCID on ACT_RU_INCIDENT(CAUSE_INCIDENT_ID_);
+create index ACT_IDX_INC_EXID on ACT_RU_INCIDENT(EXECUTION_ID_);
+create index ACT_IDX_INC_PROCDEFID on ACT_RU_INCIDENT(PROC_DEF_ID_);
+create index ACT_IDX_INC_PROCINSTID on ACT_RU_INCIDENT(PROC_INST_ID_);
+create index ACT_IDX_INC_ROOTCAUSEINCID on ACT_RU_INCIDENT(ROOT_CAUSE_INCIDENT_ID_);
+-- index for deadlock problem - https://app.camunda.com/jira/browse/CAM-4440 --
+create index ACT_IDX_AUTH_RESOURCE_ID on ACT_RU_AUTHORIZATION(RESOURCE_ID_);
+-- index to prevent deadlock on fk constraint - https://app.camunda.com/jira/browse/CAM-5440 --
+create index ACT_IDX_EXT_TASK_EXEC on ACT_RU_EXT_TASK(EXECUTION_ID_);
+
+-- indexes to improve deployment
+create index ACT_IDX_BYTEARRAY_NAME on ACT_GE_BYTEARRAY(NAME_);
+create index ACT_IDX_DEPLOYMENT_NAME on ACT_RE_DEPLOYMENT(NAME_);
+create index ACT_IDX_DEPLOYMENT_TENANT_ID on ACT_RE_DEPLOYMENT(TENANT_ID_);
+create index ACT_IDX_JOBDEF_PROC_DEF_ID ON ACT_RU_JOBDEF(PROC_DEF_ID_);
+create index ACT_IDX_JOB_HANDLER_TYPE ON ACT_RU_JOB(HANDLER_TYPE_);
+create index ACT_IDX_EVENT_SUBSCR_EVT_NAME ON ACT_RU_EVENT_SUBSCR(EVENT_NAME_);
+create index ACT_IDX_PROCDEF_DEPLOYMENT_ID ON ACT_RE_PROCDEF(DEPLOYMENT_ID_);
+create index ACT_IDX_PROCDEF_TENANT_ID ON ACT_RE_PROCDEF(TENANT_ID_);
+create index ACT_IDX_PROCDEF_VER_TAG ON ACT_RE_PROCDEF(VERSION_TAG_);
+-- create case definition table --
+create table ACT_RE_CASE_DEF (
+ ID_ varchar(64) not null,
+ REV_ integer,
+ CATEGORY_ varchar(255),
+ NAME_ varchar(255),
+ KEY_ varchar(255) not null,
+ VERSION_ integer not null,
+ DEPLOYMENT_ID_ varchar(64),
+ RESOURCE_NAME_ varchar(4000),
+ DGRM_RESOURCE_NAME_ varchar(4000),
+ TENANT_ID_ varchar(64),
+ HISTORY_TTL_ integer,
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+-- create case execution table --
+create table ACT_RU_CASE_EXECUTION (
+ ID_ varchar(64) NOT NULL,
+ REV_ integer,
+ CASE_INST_ID_ varchar(64),
+ SUPER_CASE_EXEC_ varchar(64),
+ SUPER_EXEC_ varchar(64),
+ BUSINESS_KEY_ varchar(255),
+ PARENT_ID_ varchar(64),
+ CASE_DEF_ID_ varchar(64),
+ ACT_ID_ varchar(255),
+ PREV_STATE_ integer,
+ CURRENT_STATE_ integer,
+ REQUIRED_ boolean,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+-- create case sentry part table --
+
+create table ACT_RU_CASE_SENTRY_PART (
+ ID_ varchar(64) NOT NULL,
+ REV_ integer,
+ CASE_INST_ID_ varchar(64),
+ CASE_EXEC_ID_ varchar(64),
+ SENTRY_ID_ varchar(255),
+ TYPE_ varchar(255),
+ SOURCE_CASE_EXEC_ID_ varchar(64),
+ STANDARD_EVENT_ varchar(255),
+ SOURCE_ varchar(255),
+ VARIABLE_EVENT_ varchar(255),
+ VARIABLE_NAME_ varchar(255),
+ SATISFIED_ boolean,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+-- create index on business key --
+create index ACT_IDX_CASE_EXEC_BUSKEY on ACT_RU_CASE_EXECUTION(BUSINESS_KEY_);
+
+-- create foreign key constraints on ACT_RU_CASE_EXECUTION --
+alter table ACT_RU_CASE_EXECUTION
+ add constraint ACT_FK_CASE_EXE_CASE_INST
+ foreign key (CASE_INST_ID_)
+ references ACT_RU_CASE_EXECUTION(ID_) on delete cascade on update cascade;
+
+alter table ACT_RU_CASE_EXECUTION
+ add constraint ACT_FK_CASE_EXE_PARENT
+ foreign key (PARENT_ID_)
+ references ACT_RU_CASE_EXECUTION(ID_);
+
+alter table ACT_RU_CASE_EXECUTION
+ add constraint ACT_FK_CASE_EXE_CASE_DEF
+ foreign key (CASE_DEF_ID_)
+ references ACT_RE_CASE_DEF(ID_);
+
+-- create foreign key constraints on ACT_RU_VARIABLE --
+alter table ACT_RU_VARIABLE
+ add constraint ACT_FK_VAR_CASE_EXE
+ foreign key (CASE_EXECUTION_ID_)
+ references ACT_RU_CASE_EXECUTION(ID_);
+
+alter table ACT_RU_VARIABLE
+ add constraint ACT_FK_VAR_CASE_INST
+ foreign key (CASE_INST_ID_)
+ references ACT_RU_CASE_EXECUTION(ID_);
+
+-- create foreign key constraints on ACT_RU_TASK --
+alter table ACT_RU_TASK
+ add constraint ACT_FK_TASK_CASE_EXE
+ foreign key (CASE_EXECUTION_ID_)
+ references ACT_RU_CASE_EXECUTION(ID_);
+
+alter table ACT_RU_TASK
+ add constraint ACT_FK_TASK_CASE_DEF
+ foreign key (CASE_DEF_ID_)
+ references ACT_RE_CASE_DEF(ID_);
+
+-- create foreign key constraints on ACT_RU_CASE_SENTRY_PART --
+alter table ACT_RU_CASE_SENTRY_PART
+ add constraint ACT_FK_CASE_SENTRY_CASE_INST
+ foreign key (CASE_INST_ID_)
+ references ACT_RU_CASE_EXECUTION(ID_);
+
+alter table ACT_RU_CASE_SENTRY_PART
+ add constraint ACT_FK_CASE_SENTRY_CASE_EXEC
+ foreign key (CASE_EXEC_ID_)
+ references ACT_RU_CASE_EXECUTION(ID_);
+
+create index ACT_IDX_CASE_DEF_TENANT_ID on ACT_RE_CASE_DEF(TENANT_ID_);
+create index ACT_IDX_CASE_EXEC_TENANT_ID on ACT_RU_CASE_EXECUTION(TENANT_ID_);
+-- create decision definition table --
+create table ACT_RE_DECISION_DEF (
+ ID_ varchar(64) not null,
+ REV_ integer,
+ CATEGORY_ varchar(255),
+ NAME_ varchar(255),
+ KEY_ varchar(255) not null,
+ VERSION_ integer not null,
+ DEPLOYMENT_ID_ varchar(64),
+ RESOURCE_NAME_ varchar(4000),
+ DGRM_RESOURCE_NAME_ varchar(4000),
+ DEC_REQ_ID_ varchar(64),
+ DEC_REQ_KEY_ varchar(255),
+ TENANT_ID_ varchar(64),
+ HISTORY_TTL_ integer,
+ VERSION_TAG_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+-- create decision requirements definition table --
+create table ACT_RE_DECISION_REQ_DEF (
+ ID_ varchar(64) NOT NULL,
+ REV_ integer,
+ CATEGORY_ varchar(255),
+ NAME_ varchar(255),
+ KEY_ varchar(255) NOT NULL,
+ VERSION_ integer NOT NULL,
+ DEPLOYMENT_ID_ varchar(64),
+ RESOURCE_NAME_ varchar(4000),
+ DGRM_RESOURCE_NAME_ varchar(4000),
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+alter table ACT_RE_DECISION_DEF
+ add constraint ACT_FK_DEC_REQ
+ foreign key (DEC_REQ_ID_)
+ references ACT_RE_DECISION_REQ_DEF(ID_);
+
+create index ACT_IDX_DEC_DEF_TENANT_ID on ACT_RE_DECISION_DEF(TENANT_ID_);
+create index ACT_IDX_DEC_DEF_REQ_ID on ACT_RE_DECISION_DEF(DEC_REQ_ID_);
+create index ACT_IDX_DEC_REQ_DEF_TENANT_ID on ACT_RE_DECISION_REQ_DEF(TENANT_ID_);
+create table ACT_HI_PROCINST (
+ ID_ varchar(64) not null,
+ PROC_INST_ID_ varchar(64) not null,
+ BUSINESS_KEY_ varchar(255),
+ PROC_DEF_KEY_ varchar(255),
+ PROC_DEF_ID_ varchar(64) not null,
+ START_TIME_ datetime(3) not null,
+ END_TIME_ datetime(3),
+ DURATION_ bigint,
+ START_USER_ID_ varchar(255),
+ START_ACT_ID_ varchar(255),
+ END_ACT_ID_ varchar(255),
+ SUPER_PROCESS_INSTANCE_ID_ varchar(64),
+ SUPER_CASE_INSTANCE_ID_ varchar(64),
+ CASE_INST_ID_ varchar(64),
+ DELETE_REASON_ varchar(4000),
+ TENANT_ID_ varchar(64),
+ STATE_ varchar(255),
+ primary key (ID_),
+ unique (PROC_INST_ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_HI_ACTINST (
+ ID_ varchar(64) not null,
+ PARENT_ACT_INST_ID_ varchar(64),
+ PROC_DEF_KEY_ varchar(255),
+ PROC_DEF_ID_ varchar(64) not null,
+ PROC_INST_ID_ varchar(64) not null,
+ EXECUTION_ID_ varchar(64) not null,
+ ACT_ID_ varchar(255) not null,
+ TASK_ID_ varchar(64),
+ CALL_PROC_INST_ID_ varchar(64),
+ CALL_CASE_INST_ID_ varchar(64),
+ ACT_NAME_ varchar(255),
+ ACT_TYPE_ varchar(255) not null,
+ ASSIGNEE_ varchar(64),
+ START_TIME_ datetime(3) not null,
+ END_TIME_ datetime(3),
+ DURATION_ bigint,
+ ACT_INST_STATE_ integer,
+ SEQUENCE_COUNTER_ bigint,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_HI_TASKINST (
+ ID_ varchar(64) not null,
+ TASK_DEF_KEY_ varchar(255),
+ PROC_DEF_KEY_ varchar(255),
+ PROC_DEF_ID_ varchar(64),
+ PROC_INST_ID_ varchar(64),
+ EXECUTION_ID_ varchar(64),
+ CASE_DEF_KEY_ varchar(255),
+ CASE_DEF_ID_ varchar(64),
+ CASE_INST_ID_ varchar(64),
+ CASE_EXECUTION_ID_ varchar(64),
+ ACT_INST_ID_ varchar(64),
+ NAME_ varchar(255),
+ PARENT_TASK_ID_ varchar(64),
+ DESCRIPTION_ varchar(4000),
+ OWNER_ varchar(255),
+ ASSIGNEE_ varchar(255),
+ START_TIME_ datetime(3) not null,
+ END_TIME_ datetime(3),
+ DURATION_ bigint,
+ DELETE_REASON_ varchar(4000),
+ PRIORITY_ integer,
+ DUE_DATE_ datetime(3),
+ FOLLOW_UP_DATE_ datetime(3),
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_HI_VARINST (
+ ID_ varchar(64) not null,
+ PROC_DEF_KEY_ varchar(255),
+ PROC_DEF_ID_ varchar(64),
+ PROC_INST_ID_ varchar(64),
+ EXECUTION_ID_ varchar(64),
+ ACT_INST_ID_ varchar(64),
+ CASE_DEF_KEY_ varchar(255),
+ CASE_DEF_ID_ varchar(64),
+ CASE_INST_ID_ varchar(64),
+ CASE_EXECUTION_ID_ varchar(64),
+ TASK_ID_ varchar(64),
+ NAME_ varchar(255) not null,
+ VAR_TYPE_ varchar(100),
+ REV_ integer,
+ BYTEARRAY_ID_ varchar(64),
+ DOUBLE_ double,
+ LONG_ bigint,
+ TEXT_ LONGBLOB,
+ TEXT2_ LONGBLOB,
+ TENANT_ID_ varchar(64),
+ STATE_ varchar(20),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_HI_DETAIL (
+ ID_ varchar(64) not null,
+ TYPE_ varchar(255) not null,
+ PROC_DEF_KEY_ varchar(255),
+ PROC_DEF_ID_ varchar(64),
+ PROC_INST_ID_ varchar(64),
+ EXECUTION_ID_ varchar(64),
+ CASE_DEF_KEY_ varchar(255),
+ CASE_DEF_ID_ varchar(64),
+ CASE_INST_ID_ varchar(64),
+ CASE_EXECUTION_ID_ varchar(64),
+ TASK_ID_ varchar(64),
+ ACT_INST_ID_ varchar(64),
+ VAR_INST_ID_ varchar(64),
+ NAME_ varchar(255) not null,
+ VAR_TYPE_ varchar(255),
+ REV_ integer,
+ TIME_ datetime(3) not null,
+ BYTEARRAY_ID_ varchar(64),
+ DOUBLE_ double,
+ LONG_ bigint,
+ TEXT_ LONGBLOB,
+ TEXT2_ LONGBLOB,
+ SEQUENCE_COUNTER_ bigint,
+ TENANT_ID_ varchar(64),
+ OPERATION_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_HI_IDENTITYLINK (
+ ID_ varchar(64) not null,
+ TIMESTAMP_ timestamp(3) not null,
+ TYPE_ varchar(255),
+ USER_ID_ varchar(255),
+ GROUP_ID_ varchar(255),
+ TASK_ID_ varchar(64),
+ PROC_DEF_ID_ varchar(64),
+ OPERATION_TYPE_ varchar(64),
+ ASSIGNER_ID_ varchar(64),
+ PROC_DEF_KEY_ varchar(255),
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_HI_COMMENT (
+ ID_ varchar(64) not null,
+ TYPE_ varchar(255),
+ TIME_ datetime(3) not null,
+ USER_ID_ varchar(255),
+ TASK_ID_ varchar(64),
+ PROC_INST_ID_ varchar(64),
+ ACTION_ varchar(255),
+ MESSAGE_ varchar(4000),
+ FULL_MSG_ LONGBLOB,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_HI_ATTACHMENT (
+ ID_ varchar(64) not null,
+ REV_ integer,
+ USER_ID_ varchar(255),
+ NAME_ varchar(255),
+ DESCRIPTION_ varchar(4000),
+ TYPE_ varchar(255),
+ TASK_ID_ varchar(64),
+ PROC_INST_ID_ varchar(64),
+ URL_ varchar(4000),
+ CONTENT_ID_ varchar(64),
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_HI_OP_LOG (
+ ID_ varchar(64) not null,
+ DEPLOYMENT_ID_ varchar(64),
+ PROC_DEF_ID_ varchar(64),
+ PROC_DEF_KEY_ varchar(255),
+ PROC_INST_ID_ varchar(64),
+ EXECUTION_ID_ varchar(64),
+ CASE_DEF_ID_ varchar(64),
+ CASE_INST_ID_ varchar(64),
+ CASE_EXECUTION_ID_ varchar(64),
+ TASK_ID_ varchar(64),
+ JOB_ID_ varchar(64),
+ JOB_DEF_ID_ varchar(64),
+ BATCH_ID_ varchar(64),
+ USER_ID_ varchar(255),
+ TIMESTAMP_ timestamp(3) not null,
+ OPERATION_TYPE_ varchar(64),
+ OPERATION_ID_ varchar(64),
+ ENTITY_TYPE_ varchar(30),
+ PROPERTY_ varchar(64),
+ ORG_VALUE_ varchar(4000),
+ NEW_VALUE_ varchar(4000),
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_HI_INCIDENT (
+ ID_ varchar(64) not null,
+ PROC_DEF_KEY_ varchar(255),
+ PROC_DEF_ID_ varchar(64),
+ PROC_INST_ID_ varchar(64),
+ EXECUTION_ID_ varchar(64),
+ CREATE_TIME_ timestamp(3) not null,
+ END_TIME_ timestamp(3) null,
+ INCIDENT_MSG_ varchar(4000),
+ INCIDENT_TYPE_ varchar(255) not null,
+ ACTIVITY_ID_ varchar(255),
+ CAUSE_INCIDENT_ID_ varchar(64),
+ ROOT_CAUSE_INCIDENT_ID_ varchar(64),
+ CONFIGURATION_ varchar(255),
+ INCIDENT_STATE_ integer,
+ TENANT_ID_ varchar(64),
+ JOB_DEF_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_HI_JOB_LOG (
+ ID_ varchar(64) not null,
+ TIMESTAMP_ timestamp(3) not null,
+ JOB_ID_ varchar(64) not null,
+ JOB_DUEDATE_ timestamp(3) NULL,
+ JOB_RETRIES_ integer,
+ JOB_PRIORITY_ bigint NOT NULL DEFAULT 0,
+ JOB_EXCEPTION_MSG_ varchar(4000),
+ JOB_EXCEPTION_STACK_ID_ varchar(64),
+ JOB_STATE_ integer,
+ JOB_DEF_ID_ varchar(64),
+ JOB_DEF_TYPE_ varchar(255),
+ JOB_DEF_CONFIGURATION_ varchar(255),
+ ACT_ID_ varchar(255),
+ EXECUTION_ID_ varchar(64),
+ PROCESS_INSTANCE_ID_ varchar(64),
+ PROCESS_DEF_ID_ varchar(64),
+ PROCESS_DEF_KEY_ varchar(255),
+ DEPLOYMENT_ID_ varchar(64),
+ SEQUENCE_COUNTER_ bigint,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_HI_BATCH (
+ ID_ varchar(64) not null,
+ TYPE_ varchar(255),
+ TOTAL_JOBS_ integer,
+ JOBS_PER_SEED_ integer,
+ INVOCATIONS_PER_JOB_ integer,
+ SEED_JOB_DEF_ID_ varchar(64),
+ MONITOR_JOB_DEF_ID_ varchar(64),
+ BATCH_JOB_DEF_ID_ varchar(64),
+ TENANT_ID_ varchar(64),
+ START_TIME_ datetime(3) not null,
+ END_TIME_ datetime(3),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_HI_EXT_TASK_LOG (
+ ID_ varchar(64) not null,
+ TIMESTAMP_ timestamp(3) not null,
+ EXT_TASK_ID_ varchar(64) not null,
+ RETRIES_ integer,
+ TOPIC_NAME_ varchar(255),
+ WORKER_ID_ varchar(255),
+ PRIORITY_ bigint NOT NULL DEFAULT 0,
+ ERROR_MSG_ varchar(4000),
+ ERROR_DETAILS_ID_ varchar(64),
+ ACT_ID_ varchar(255),
+ ACT_INST_ID_ varchar(64),
+ EXECUTION_ID_ varchar(64),
+ PROC_INST_ID_ varchar(64),
+ PROC_DEF_ID_ varchar(64),
+ PROC_DEF_KEY_ varchar(255),
+ TENANT_ID_ varchar(64),
+ STATE_ integer,
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create index ACT_IDX_HI_PRO_INST_END on ACT_HI_PROCINST(END_TIME_);
+create index ACT_IDX_HI_PRO_I_BUSKEY on ACT_HI_PROCINST(BUSINESS_KEY_);
+create index ACT_IDX_HI_PRO_INST_TENANT_ID on ACT_HI_PROCINST(TENANT_ID_);
+create index ACT_IDX_HI_PRO_INST_PROC_DEF_KEY on ACT_HI_PROCINST(PROC_DEF_KEY_);
+
+create index ACT_IDX_HI_ACT_INST_START on ACT_HI_ACTINST(START_TIME_);
+create index ACT_IDX_HI_ACT_INST_END on ACT_HI_ACTINST(END_TIME_);
+create index ACT_IDX_HI_ACT_INST_PROCINST on ACT_HI_ACTINST(PROC_INST_ID_, ACT_ID_);
+create index ACT_IDX_HI_ACT_INST_COMP on ACT_HI_ACTINST(EXECUTION_ID_, ACT_ID_, END_TIME_, ID_);
+create index ACT_IDX_HI_ACT_INST_STATS on ACT_HI_ACTINST(PROC_DEF_ID_, ACT_ID_, END_TIME_, ACT_INST_STATE_);
+create index ACT_IDX_HI_ACT_INST_TENANT_ID on ACT_HI_ACTINST(TENANT_ID_);
+create index ACT_IDX_HI_ACT_INST_PROC_DEF_KEY on ACT_HI_ACTINST(PROC_DEF_KEY_);
+
+create index ACT_IDX_HI_TASK_INST_TENANT_ID on ACT_HI_TASKINST(TENANT_ID_);
+create index ACT_IDX_HI_TASK_INST_PROC_DEF_KEY on ACT_HI_TASKINST(PROC_DEF_KEY_);
+create index ACT_IDX_HI_TASKINST_PROCINST on ACT_HI_TASKINST(PROC_INST_ID_);
+create index ACT_IDX_HI_TASKINSTID_PROCINST on ACT_HI_TASKINST(ID_,PROC_INST_ID_);
+
+create index ACT_IDX_HI_DETAIL_PROC_INST on ACT_HI_DETAIL(PROC_INST_ID_);
+create index ACT_IDX_HI_DETAIL_ACT_INST on ACT_HI_DETAIL(ACT_INST_ID_);
+create index ACT_IDX_HI_DETAIL_CASE_INST on ACT_HI_DETAIL(CASE_INST_ID_);
+create index ACT_IDX_HI_DETAIL_CASE_EXEC on ACT_HI_DETAIL(CASE_EXECUTION_ID_);
+create index ACT_IDX_HI_DETAIL_TIME on ACT_HI_DETAIL(TIME_);
+create index ACT_IDX_HI_DETAIL_NAME on ACT_HI_DETAIL(NAME_);
+create index ACT_IDX_HI_DETAIL_TASK_ID on ACT_HI_DETAIL(TASK_ID_);
+create index ACT_IDX_HI_DETAIL_TENANT_ID on ACT_HI_DETAIL(TENANT_ID_);
+create index ACT_IDX_HI_DETAIL_PROC_DEF_KEY on ACT_HI_DETAIL(PROC_DEF_KEY_);
+create index ACT_IDX_HI_DETAIL_BYTEAR on ACT_HI_DETAIL(BYTEARRAY_ID_);
+
+create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_);
+create index ACT_IDX_HI_IDENT_LNK_GROUP on ACT_HI_IDENTITYLINK(GROUP_ID_);
+create index ACT_IDX_HI_IDENT_LNK_TENANT_ID on ACT_HI_IDENTITYLINK(TENANT_ID_);
+create index ACT_IDX_HI_IDENT_LNK_PROC_DEF_KEY on ACT_HI_IDENTITYLINK(PROC_DEF_KEY_);
+create index ACT_IDX_HI_IDENT_LINK_TASK on ACT_HI_IDENTITYLINK(TASK_ID_);
+
+create index ACT_IDX_HI_PROCVAR_PROC_INST on ACT_HI_VARINST(PROC_INST_ID_);
+create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_);
+create index ACT_IDX_HI_CASEVAR_CASE_INST on ACT_HI_VARINST(CASE_INST_ID_);
+create index ACT_IDX_HI_VAR_INST_TENANT_ID on ACT_HI_VARINST(TENANT_ID_);
+create index ACT_IDX_HI_VAR_INST_PROC_DEF_KEY on ACT_HI_VARINST(PROC_DEF_KEY_);
+create index ACT_IDX_HI_VARINST_BYTEAR on ACT_HI_VARINST(BYTEARRAY_ID_);
+
+create index ACT_IDX_HI_INCIDENT_TENANT_ID on ACT_HI_INCIDENT(TENANT_ID_);
+create index ACT_IDX_HI_INCIDENT_PROC_DEF_KEY on ACT_HI_INCIDENT(PROC_DEF_KEY_);
+create index ACT_IDX_HI_INCIDENT_PROCINST on ACT_HI_INCIDENT(PROC_INST_ID_);
+
+create index ACT_IDX_HI_JOB_LOG_PROCINST on ACT_HI_JOB_LOG(PROCESS_INSTANCE_ID_);
+create index ACT_IDX_HI_JOB_LOG_PROCDEF on ACT_HI_JOB_LOG(PROCESS_DEF_ID_);
+create index ACT_IDX_HI_JOB_LOG_TENANT_ID on ACT_HI_JOB_LOG(TENANT_ID_);
+create index ACT_IDX_HI_JOB_LOG_JOB_DEF_ID on ACT_HI_JOB_LOG(JOB_DEF_ID_);
+create index ACT_IDX_HI_JOB_LOG_PROC_DEF_KEY on ACT_HI_JOB_LOG(PROCESS_DEF_KEY_);
+create index ACT_IDX_HI_JOB_LOG_EX_STACK on ACT_HI_JOB_LOG(JOB_EXCEPTION_STACK_ID_);
+
+create index ACT_HI_EXT_TASK_LOG_PROCINST on ACT_HI_EXT_TASK_LOG(PROC_INST_ID_);
+create index ACT_HI_EXT_TASK_LOG_PROCDEF on ACT_HI_EXT_TASK_LOG(PROC_DEF_ID_);
+create index ACT_HI_EXT_TASK_LOG_PROC_DEF_KEY on ACT_HI_EXT_TASK_LOG(PROC_DEF_KEY_);
+create index ACT_HI_EXT_TASK_LOG_TENANT_ID on ACT_HI_EXT_TASK_LOG(TENANT_ID_);
+create index ACT_IDX_HI_EXTTASKLOG_ERRORDET on ACT_HI_EXT_TASK_LOG(ERROR_DETAILS_ID_);
+
+create index ACT_IDX_HI_OP_LOG_PROCINST on ACT_HI_OP_LOG(PROC_INST_ID_);
+create index ACT_IDX_HI_OP_LOG_PROCDEF on ACT_HI_OP_LOG(PROC_DEF_ID_);
+
+create index ACT_IDX_HI_COMMENT_TASK on ACT_HI_COMMENT(TASK_ID_);
+create index ACT_IDX_HI_COMMENT_PROCINST on ACT_HI_COMMENT(PROC_INST_ID_);
+
+create index ACT_IDX_HI_ATTACHMENT_CONTENT on ACT_HI_ATTACHMENT(CONTENT_ID_);
+create index ACT_IDX_HI_ATTACHMENT_PROCINST on ACT_HI_ATTACHMENT(PROC_INST_ID_);
+create index ACT_IDX_HI_ATTACHMENT_TASK on ACT_HI_ATTACHMENT(TASK_ID_);
+create table ACT_HI_CASEINST (
+ ID_ varchar(64) not null,
+ CASE_INST_ID_ varchar(64) not null,
+ BUSINESS_KEY_ varchar(255),
+ CASE_DEF_ID_ varchar(64) not null,
+ CREATE_TIME_ datetime(3) not null,
+ CLOSE_TIME_ datetime(3),
+ DURATION_ bigint,
+ STATE_ integer,
+ CREATE_USER_ID_ varchar(255),
+ SUPER_CASE_INSTANCE_ID_ varchar(64),
+ SUPER_PROCESS_INSTANCE_ID_ varchar(64),
+ TENANT_ID_ varchar(64),
+ primary key (ID_),
+ unique (CASE_INST_ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_HI_CASEACTINST (
+ ID_ varchar(64) not null,
+ PARENT_ACT_INST_ID_ varchar(64),
+ CASE_DEF_ID_ varchar(64) not null,
+ CASE_INST_ID_ varchar(64) not null,
+ CASE_ACT_ID_ varchar(255) not null,
+ TASK_ID_ varchar(64),
+ CALL_PROC_INST_ID_ varchar(64),
+ CALL_CASE_INST_ID_ varchar(64),
+ CASE_ACT_NAME_ varchar(255),
+ CASE_ACT_TYPE_ varchar(255),
+ CREATE_TIME_ datetime(3) not null,
+ END_TIME_ datetime(3),
+ DURATION_ bigint,
+ STATE_ integer,
+ REQUIRED_ boolean,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create index ACT_IDX_HI_CAS_I_CLOSE on ACT_HI_CASEINST(CLOSE_TIME_);
+create index ACT_IDX_HI_CAS_I_BUSKEY on ACT_HI_CASEINST(BUSINESS_KEY_);
+create index ACT_IDX_HI_CAS_I_TENANT_ID on ACT_HI_CASEINST(TENANT_ID_);
+create index ACT_IDX_HI_CAS_A_I_CREATE on ACT_HI_CASEACTINST(CREATE_TIME_);
+create index ACT_IDX_HI_CAS_A_I_END on ACT_HI_CASEACTINST(END_TIME_);
+create index ACT_IDX_HI_CAS_A_I_COMP on ACT_HI_CASEACTINST(CASE_ACT_ID_, END_TIME_, ID_);
+create index ACT_IDX_HI_CAS_A_I_CASEINST on ACT_HI_CASEACTINST(CASE_INST_ID_, CASE_ACT_ID_);
+create index ACT_IDX_HI_CAS_A_I_TENANT_ID on ACT_HI_CASEACTINST(TENANT_ID_);
+-- create history decision instance table --
+create table ACT_HI_DECINST (
+ ID_ varchar(64) NOT NULL,
+ DEC_DEF_ID_ varchar(64) NOT NULL,
+ DEC_DEF_KEY_ varchar(255) NOT NULL,
+ DEC_DEF_NAME_ varchar(255),
+ PROC_DEF_KEY_ varchar(255),
+ PROC_DEF_ID_ varchar(64),
+ PROC_INST_ID_ varchar(64),
+ CASE_DEF_KEY_ varchar(255),
+ CASE_DEF_ID_ varchar(64),
+ CASE_INST_ID_ varchar(64),
+ ACT_INST_ID_ varchar(64),
+ ACT_ID_ varchar(255),
+ EVAL_TIME_ datetime(3) not null,
+ COLLECT_VALUE_ double,
+ USER_ID_ varchar(255),
+ ROOT_DEC_INST_ID_ varchar(64),
+ DEC_REQ_ID_ varchar(64),
+ DEC_REQ_KEY_ varchar(255),
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+-- create history decision input table --
+create table ACT_HI_DEC_IN (
+ ID_ varchar(64) NOT NULL,
+ DEC_INST_ID_ varchar(64) NOT NULL,
+ CLAUSE_ID_ varchar(64),
+ CLAUSE_NAME_ varchar(255),
+ VAR_TYPE_ varchar(100),
+ BYTEARRAY_ID_ varchar(64),
+ DOUBLE_ double,
+ LONG_ bigint,
+ TEXT_ LONGBLOB,
+ TEXT2_ LONGBLOB,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+-- create history decision output table --
+create table ACT_HI_DEC_OUT (
+ ID_ varchar(64) NOT NULL,
+ DEC_INST_ID_ varchar(64) NOT NULL,
+ CLAUSE_ID_ varchar(64),
+ CLAUSE_NAME_ varchar(255),
+ RULE_ID_ varchar(64),
+ RULE_ORDER_ integer,
+ VAR_NAME_ varchar(255),
+ VAR_TYPE_ varchar(100),
+ BYTEARRAY_ID_ varchar(64),
+ DOUBLE_ double,
+ LONG_ bigint,
+ TEXT_ LONGBLOB,
+ TEXT2_ LONGBLOB,
+ TENANT_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+
+create index ACT_IDX_HI_DEC_INST_ID on ACT_HI_DECINST(DEC_DEF_ID_);
+create index ACT_IDX_HI_DEC_INST_KEY on ACT_HI_DECINST(DEC_DEF_KEY_);
+create index ACT_IDX_HI_DEC_INST_PI on ACT_HI_DECINST(PROC_INST_ID_);
+create index ACT_IDX_HI_DEC_INST_CI on ACT_HI_DECINST(CASE_INST_ID_);
+create index ACT_IDX_HI_DEC_INST_ACT on ACT_HI_DECINST(ACT_ID_);
+create index ACT_IDX_HI_DEC_INST_ACT_INST on ACT_HI_DECINST(ACT_INST_ID_);
+create index ACT_IDX_HI_DEC_INST_TIME on ACT_HI_DECINST(EVAL_TIME_);
+create index ACT_IDX_HI_DEC_INST_TENANT_ID on ACT_HI_DECINST(TENANT_ID_);
+create index ACT_IDX_HI_DEC_INST_ROOT_ID on ACT_HI_DECINST(ROOT_DEC_INST_ID_);
+create index ACT_IDX_HI_DEC_INST_REQ_ID on ACT_HI_DECINST(DEC_REQ_ID_);
+create index ACT_IDX_HI_DEC_INST_REQ_KEY on ACT_HI_DECINST(DEC_REQ_KEY_);
+
+
+create index ACT_IDX_HI_DEC_IN_INST on ACT_HI_DEC_IN(DEC_INST_ID_);
+create index ACT_IDX_HI_DEC_IN_CLAUSE on ACT_HI_DEC_IN(DEC_INST_ID_, CLAUSE_ID_);
+
+create index ACT_IDX_HI_DEC_OUT_INST on ACT_HI_DEC_OUT(DEC_INST_ID_);
+create index ACT_IDX_HI_DEC_OUT_RULE on ACT_HI_DEC_OUT(RULE_ORDER_, CLAUSE_ID_);
+
+-- mariadb_identity_7.8.0-ee
+
+create table ACT_ID_GROUP (
+ ID_ varchar(64),
+ REV_ integer,
+ NAME_ varchar(255),
+ TYPE_ varchar(255),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_ID_MEMBERSHIP (
+ USER_ID_ varchar(64),
+ GROUP_ID_ varchar(64),
+ primary key (USER_ID_, GROUP_ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_ID_USER (
+ ID_ varchar(64),
+ REV_ integer,
+ FIRST_ varchar(255),
+ LAST_ varchar(255),
+ EMAIL_ varchar(255),
+ PWD_ varchar(255),
+ SALT_ varchar(255),
+ PICTURE_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_ID_INFO (
+ ID_ varchar(64),
+ REV_ integer,
+ USER_ID_ varchar(64),
+ TYPE_ varchar(64),
+ KEY_ varchar(255),
+ VALUE_ varchar(255),
+ PASSWORD_ LONGBLOB,
+ PARENT_ID_ varchar(255),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_ID_TENANT (
+ ID_ varchar(64),
+ REV_ integer,
+ NAME_ varchar(255),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+create table ACT_ID_TENANT_MEMBER (
+ ID_ varchar(64) not null,
+ TENANT_ID_ varchar(64) not null,
+ USER_ID_ varchar(64),
+ GROUP_ID_ varchar(64),
+ primary key (ID_)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin;
+
+alter table ACT_ID_MEMBERSHIP
+ add constraint ACT_FK_MEMB_GROUP
+ foreign key (GROUP_ID_)
+ references ACT_ID_GROUP (ID_);
+
+alter table ACT_ID_MEMBERSHIP
+ add constraint ACT_FK_MEMB_USER
+ foreign key (USER_ID_)
+ references ACT_ID_USER (ID_);
+
+alter table ACT_ID_TENANT_MEMBER
+ add constraint ACT_UNIQ_TENANT_MEMB_USER
+ unique (TENANT_ID_, USER_ID_);
+
+alter table ACT_ID_TENANT_MEMBER
+ add constraint ACT_UNIQ_TENANT_MEMB_GROUP
+ unique (TENANT_ID_, GROUP_ID_);
+
+alter table ACT_ID_TENANT_MEMBER
+ add constraint ACT_FK_TENANT_MEMB
+ foreign key (TENANT_ID_)
+ references ACT_ID_TENANT (ID_);
+
+alter table ACT_ID_TENANT_MEMBER
+ add constraint ACT_FK_TENANT_MEMB_USER
+ foreign key (USER_ID_)
+ references ACT_ID_USER (ID_);
+
+alter table ACT_ID_TENANT_MEMBER
+ add constraint ACT_FK_TENANT_MEMB_GROUP
+ foreign key (GROUP_ID_)
+ references ACT_ID_GROUP (ID_);
+
+ALTER TABLE ACT_GE_BYTEARRAY
+ ADD TYPE_ integer;
+
+ALTER TABLE ACT_GE_BYTEARRAY
+ ADD CREATE_TIME_ datetime(3);
+
+ALTER TABLE ACT_RE_PROCDEF
+ ADD STARTABLE_ BOOLEAN NOT NULL DEFAULT TRUE; \ No newline at end of file