2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.mso.apihandlerinfra.tenantisolation.process;
23 import org.openecomp.mso.apihandlerinfra.tenantisolation.CloudOrchestrationRequest;
24 import org.openecomp.mso.apihandlerinfra.tenantisolation.helpers.AAIClientHelper;
25 import org.openecomp.mso.apihandlerinfra.tenantisolation.helpers.AAIClientObjectBuilder;
26 import org.openecomp.mso.requestsdb.RequestsDBHelper;
28 public abstract class OperationalEnvironmentProcess {
30 protected String requestId;
31 protected CloudOrchestrationRequest request;
32 protected AAIClientObjectBuilder aaiClientObjectBuilder;
33 protected AAIClientHelper aaiHelper;
34 protected RequestsDBHelper requestDb;
36 public OperationalEnvironmentProcess(CloudOrchestrationRequest request, String requestId) {
37 this.requestId = requestId;
38 this.request = request;
39 this.aaiClientObjectBuilder = new AAIClientObjectBuilder(getRequest());
42 protected String getRequestId() {
43 return this.requestId;
46 protected CloudOrchestrationRequest getRequest() {
50 protected AAIClientHelper getAaiHelper() {
51 if(this.aaiHelper == null) {
52 this.aaiHelper = new AAIClientHelper(getServiceName(), getRequestId());
54 return this.aaiHelper;
57 protected void setAaiHelper(AAIClientHelper helper) {
58 this.aaiHelper = helper;
61 protected AAIClientObjectBuilder getAaiClientObjectBuilder() {
62 return this.aaiClientObjectBuilder;
65 protected RequestsDBHelper getRequestDb() {
66 if(requestDb == null) {
67 requestDb = new RequestsDBHelper();
72 protected void setRequestsDBHelper(RequestsDBHelper helper) {
73 this.requestDb = helper;
76 protected abstract String getServiceName();
77 public abstract void execute();