summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/clamp/clds/model/CldsDictionary.java43
-rw-r--r--src/main/java/org/onap/clamp/clds/model/CldsDictionaryItem.java63
-rw-r--r--src/main/java/org/onap/clamp/clds/model/CldsInfo.java29
-rw-r--r--src/main/java/org/onap/clamp/clds/model/CldsModel.java43
-rw-r--r--src/main/java/org/onap/clamp/clds/model/CldsServiceData.java6
-rw-r--r--src/main/java/org/onap/clamp/clds/model/CldsTemplate.java69
-rw-r--r--src/main/java/org/onap/clamp/clds/model/CldsToscaModel.java22
-rw-r--r--src/main/java/org/onap/clamp/clds/model/CldsVfcData.java24
-rw-r--r--src/main/java/org/onap/clamp/clds/model/DcaeEvent.java31
-rw-r--r--src/main/java/org/onap/clamp/clds/model/ValueItem.java26
-rw-r--r--src/main/java/org/onap/clamp/loop/LoopController.java5
11 files changed, 233 insertions, 128 deletions
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsDictionary.java b/src/main/java/org/onap/clamp/clds/model/CldsDictionary.java
index 40e547a9c..27a430c7c 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsDictionary.java
+++ b/src/main/java/org/onap/clamp/clds/model/CldsDictionary.java
@@ -28,25 +28,34 @@ import java.util.List;
import org.onap.clamp.clds.dao.CldsDao;
+import com.google.gson.annotations.Expose;
+
/**
* Represents a CLDS Dictionary.
*/
public class CldsDictionary {
+ @Expose
private String dictionaryId;
+ @Expose
private String dictionaryName;
+
+ @Expose
private String createdBy;
+ @Expose
private String updatedBy;
+ @Expose
private String lastUpdatedDate;
+ @Expose
private List<CldsDictionaryItem> cldsDictionaryItems = new ArrayList<>();
/**
* Creates or updates dictionary item for a dictionary in DB.
*
* @param dictionaryName The dictionary name
- * @param cldsDao The CldsDao
- * @param userId The user ID
+ * @param cldsDao The CldsDao
+ * @param userId The user ID
*/
public void save(String dictionaryName, CldsDao cldsDao, String userId) {
List<CldsDictionary> list = cldsDao.getDictionary(this.getDictionaryId(), dictionaryName);
@@ -70,6 +79,7 @@ public class CldsDictionary {
/**
* Get the dictionary ID.
+ *
* @return the dictionaryId
*/
public String getDictionaryId() {
@@ -78,8 +88,8 @@ public class CldsDictionary {
/**
* Set the dictionary Id.
- * @param dictionaryId
- * the dictionaryId to set
+ *
+ * @param dictionaryId the dictionaryId to set
*/
public void setDictionaryId(String dictionaryId) {
this.dictionaryId = dictionaryId;
@@ -87,6 +97,7 @@ public class CldsDictionary {
/**
* Get the dictionary name.
+ *
* @return the dictionaryName
*/
public String getDictionaryName() {
@@ -95,8 +106,8 @@ public class CldsDictionary {
/**
* Set the dictionary name.
- * @param dictionaryName
- * the dictionaryName to set
+ *
+ * @param dictionaryName the dictionaryName to set
*/
public void setDictionaryName(String dictionaryName) {
this.dictionaryName = dictionaryName;
@@ -104,6 +115,7 @@ public class CldsDictionary {
/**
* Get the createdBy info.
+ *
* @return the createdBy
*/
public String getCreatedBy() {
@@ -112,8 +124,8 @@ public class CldsDictionary {
/**
* Set the createdBy info.
- * @param createdBy
- * the createdBy to set
+ *
+ * @param createdBy the createdBy to set
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
@@ -121,6 +133,7 @@ public class CldsDictionary {
/**
* Get the updatedBy info.
+ *
* @return the updatedBy
*/
public String getUpdatedBy() {
@@ -129,8 +142,8 @@ public class CldsDictionary {
/**
* Set the updatedBy info.
- * @param updatedby
- * the updatedBy to set
+ *
+ * @param updatedby the updatedBy to set
*/
public void setUpdatedBy(String updatedby) {
updatedBy = updatedby;
@@ -138,6 +151,7 @@ public class CldsDictionary {
/**
* Get the last updated date.
+ *
* @return the lastUpdatedDate
*/
public String getLastUpdatedDate() {
@@ -146,8 +160,8 @@ public class CldsDictionary {
/**
* Set the last updated date.
- * @param lastUpdatedDate
- * the lastUpdatedDate to set
+ *
+ * @param lastUpdatedDate the lastUpdatedDate to set
*/
public void setLastUpdatedDate(String lastUpdatedDate) {
this.lastUpdatedDate = lastUpdatedDate;
@@ -155,6 +169,7 @@ public class CldsDictionary {
/**
* Get all the dictionary items.
+ *
* @return the cldsDictionaryItems
*/
public List<CldsDictionaryItem> getCldsDictionaryItems() {
@@ -163,8 +178,8 @@ public class CldsDictionary {
/**
* Set the whole dictionary items.
- * @param cldsDictionaryItems
- * the cldsDictionaryItems to set
+ *
+ * @param cldsDictionaryItems the cldsDictionaryItems to set
*/
public void setCldsDictionaryItems(List<CldsDictionaryItem> cldsDictionaryItems) {
this.cldsDictionaryItems = cldsDictionaryItems;
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsDictionaryItem.java b/src/main/java/org/onap/clamp/clds/model/CldsDictionaryItem.java
index 871fe9037..14a68502e 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsDictionaryItem.java
+++ b/src/main/java/org/onap/clamp/clds/model/CldsDictionaryItem.java
@@ -23,6 +23,8 @@
package org.onap.clamp.clds.model;
+import com.google.gson.annotations.Expose;
+
import java.util.List;
import org.onap.clamp.clds.dao.CldsDao;
@@ -32,21 +34,31 @@ import org.onap.clamp.clds.dao.CldsDao;
*/
public class CldsDictionaryItem {
+ @Expose
private String dictElementId;
+ @Expose
private String dictionaryId;
+ @Expose
private String dictElementName;
+ @Expose
private String dictElementShortName;
+ @Expose
private String dictElementDesc;
+ @Expose
private String dictElementType;
+ @Expose
private String createdBy;
+ @Expose
private String updatedBy;
+ @Expose
private String lastUpdatedDate;
/**
* Save the dictionary item.
+ *
* @param dictionaryName The name of the dictionary
- * @param cldsDao The cldsDao
- * @param userId The user id
+ * @param cldsDao The cldsDao
+ * @param userId The user id
*/
public void save(String dictionaryName, CldsDao cldsDao, String userId) {
// Check if dictionary exists.
@@ -55,7 +67,7 @@ public class CldsDictionaryItem {
// Dictionary found. We can add or update the dictionary element
CldsDictionary cldsDictionary = list.stream().findFirst().get();
List<CldsDictionaryItem> dictionaryItems = cldsDao.getDictionaryElements(dictionaryName,
- cldsDictionary.getDictionaryId(), this.getDictElementShortName());
+ cldsDictionary.getDictionaryId(), this.getDictElementShortName());
if (dictionaryItems != null && !dictionaryItems.isEmpty()) {
CldsDictionaryItem item = dictionaryItems.stream().findFirst().get();
cldsDao.updateDictionaryElements(item.getDictElementId(), this, userId);
@@ -71,6 +83,7 @@ public class CldsDictionaryItem {
/**
* Get the dictionary element id.
+ *
* @return the dictElementId
*/
public String getDictElementId() {
@@ -79,8 +92,8 @@ public class CldsDictionaryItem {
/**
* Set the dictionary element id.
- * @param dictElementId
- * the dictElementId to set
+ *
+ * @param dictElementId the dictElementId to set
*/
public void setDictElementId(String dictElementId) {
this.dictElementId = dictElementId;
@@ -88,6 +101,7 @@ public class CldsDictionaryItem {
/**
* Get the dictionary id.
+ *
* @return the dictionaryId
*/
public String getDictionaryId() {
@@ -96,8 +110,8 @@ public class CldsDictionaryItem {
/**
* Set the dictionary id.
- * @param dictionaryId
- * the dictionaryId to set
+ *
+ * @param dictionaryId the dictionaryId to set
*/
public void setDictionaryId(String dictionaryId) {
this.dictionaryId = dictionaryId;
@@ -105,6 +119,7 @@ public class CldsDictionaryItem {
/**
* Get the dictionary name.
+ *
* @return the dictElementName
*/
public String getDictElementName() {
@@ -113,8 +128,8 @@ public class CldsDictionaryItem {
/**
* Set the dictionary name.
- * @param dictElementName
- * the dictElementName to set
+ *
+ * @param dictElementName the dictElementName to set
*/
public void setDictElementName(String dictElementName) {
this.dictElementName = dictElementName;
@@ -122,6 +137,7 @@ public class CldsDictionaryItem {
/**
* Get the dictionary element short name.
+ *
* @return the dictElementShortName
*/
public String getDictElementShortName() {
@@ -130,8 +146,8 @@ public class CldsDictionaryItem {
/**
* Set the dictionary element short name.
- * @param dictElementShortName
- * the dictElementShortName to set
+ *
+ * @param dictElementShortName the dictElementShortName to set
*/
public void setDictElementShortName(String dictElementShortName) {
this.dictElementShortName = dictElementShortName;
@@ -139,6 +155,7 @@ public class CldsDictionaryItem {
/**
* Get the dictionary element description.
+ *
* @return the dictElementDesc
*/
public String getDictElementDesc() {
@@ -147,8 +164,8 @@ public class CldsDictionaryItem {
/**
* Set the dictionary element description.
- * @param dictElementDesc
- * the dictElementDesc to set
+ *
+ * @param dictElementDesc the dictElementDesc to set
*/
public void setDictElementDesc(String dictElementDesc) {
this.dictElementDesc = dictElementDesc;
@@ -156,6 +173,7 @@ public class CldsDictionaryItem {
/**
* Get the dictionary element type.
+ *
* @return the dictElementType
*/
public String getDictElementType() {
@@ -164,8 +182,8 @@ public class CldsDictionaryItem {
/**
* Set the dictionary element type.
- * @param dictElementType
- * the dictElementType to set
+ *
+ * @param dictElementType the dictElementType to set
*/
public void setDictElementType(String dictElementType) {
this.dictElementType = dictElementType;
@@ -173,6 +191,7 @@ public class CldsDictionaryItem {
/**
* Get the createdBy info.
+ *
* @return the createdBy
*/
public String getCreatedBy() {
@@ -181,8 +200,8 @@ public class CldsDictionaryItem {
/**
* Set the createdBy info.
- * @param createdBy
- * the createdBy to set
+ *
+ * @param createdBy the createdBy to set
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
@@ -190,6 +209,7 @@ public class CldsDictionaryItem {
/**
* Get the updatedBy info.
+ *
* @return the updatedBy
*/
public String getUpdatedBy() {
@@ -198,8 +218,8 @@ public class CldsDictionaryItem {
/**
* Set the updatedBy info.
- * @param updatedby
- * the updatedBy to set
+ *
+ * @param updatedby the updatedBy to set
*/
public void setUpdatedBy(String updatedby) {
updatedBy = updatedby;
@@ -207,6 +227,7 @@ public class CldsDictionaryItem {
/**
* Get the last updated date.
+ *
* @return the lastUpdatedDate
*/
public String getLastUpdatedDate() {
@@ -215,8 +236,8 @@ public class CldsDictionaryItem {
/**
* Set the last updated date.
- * @param lastUpdatedDate
- * the lastUpdatedDate to set
+ *
+ * @param lastUpdatedDate the lastUpdatedDate to set
*/
public void setLastUpdatedDate(String lastUpdatedDate) {
this.lastUpdatedDate = lastUpdatedDate;
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsInfo.java b/src/main/java/org/onap/clamp/clds/model/CldsInfo.java
index a24885f73..f3cf6ed19 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsInfo.java
+++ b/src/main/java/org/onap/clamp/clds/model/CldsInfo.java
@@ -5,33 +5,42 @@
* 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.
+ * 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
+ *
+ * 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.clamp.clds.model;
-public class CldsInfo {
+import com.google.gson.annotations.Expose;
+public class CldsInfo {
+ @Expose
private String userName;
+ @Expose
private String cldsVersion;
+ @Expose
private boolean permissionReadCl;
+ @Expose
private boolean permissionUpdateCl;
+ @Expose
private boolean permissionReadTemplate;
+ @Expose
private boolean permissionUpdateTemplate;
+ @Expose
private boolean permissionReadTosca;
+ @Expose
private boolean permissionUpdateTosca;
public String getUserName() {
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsModel.java b/src/main/java/org/onap/clamp/clds/model/CldsModel.java
index 223d38929..4d2ca89a4 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsModel.java
+++ b/src/main/java/org/onap/clamp/clds/model/CldsModel.java
@@ -23,8 +23,7 @@
package org.onap.clamp.clds.model;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
+import com.google.gson.annotations.Expose;
import java.util.ArrayList;
import java.util.List;
@@ -43,7 +42,6 @@ import org.onap.clamp.clds.model.status.StatusHandlerImpl;
*/
public class CldsModel {
- private static final EELFLogger logger = EELFManager.getInstance().getLogger(CldsModel.class);
private static final int UUID_LENGTH = 36;
/**
* The constant STATUS_DESIGN.
@@ -73,29 +71,50 @@ public class CldsModel {
* The constant STATUS_UNKNOWN.
*/
public static final String STATUS_UNKNOWN = "UNKNOWN";
+
+ @Expose
private String id;
+ @Expose
private String templateId;
+ @Expose
private String templateName;
+ @Expose
private String name;
+ @Expose
private String controlNamePrefix;
+ @Expose
private String controlNameUuid;
+ @Expose
private String bpmnText;
+ @Expose
private String propText;
+ @Expose
private String imageText;
+ @Expose
private String docText;
+ @Expose
private String blueprintText;
+ @Expose
private CldsEvent event;
+ @Expose
private String status;
+ @Expose
private List<String> permittedActionCd;
+ @Expose
private List<CldsModelInstance> cldsModelInstanceList;
// This is a transient value used to return the failure message to UI
+ @Expose
private String errorMessageForUi;
/**
* The service type Id received from DCAE by querying it.
*/
+ @Expose
private String typeId;
+ @Expose
private String typeName;
+ @Expose
private String deploymentId;
+ @Expose
private String deploymentStatusUrl;
// Set default handlers but this can be changed if needed.
@@ -155,7 +174,7 @@ public class CldsModel {
boolean canCall = false;
/* Below checks the clds event is submit/resubmit/distribute */
if (event.isActionCd(CldsEvent.ACTION_SUBMIT) || event.isActionCd(CldsEvent.ACTION_RESUBMIT)
- || event.isActionCd(CldsEvent.ACTION_DISTRIBUTE) || event.isActionCd(CldsEvent.ACTION_SUBMITDCAE)) {
+ || event.isActionCd(CldsEvent.ACTION_DISTRIBUTE) || event.isActionCd(CldsEvent.ACTION_SUBMITDCAE)) {
canCall = true;
}
return canCall;
@@ -202,9 +221,9 @@ public class CldsModel {
public void validateAction(String requestedActionCd) {
determinePermittedActionCd();
if (!permittedActionCd.contains(requestedActionCd)) {
- throw new IllegalArgumentException(
- "Invalid requestedActionCd: " + requestedActionCd + ". Given current actionCd: "
- + actionsHandler.getCurrentActionCd(event) + ", the permittedActionCd: " + permittedActionCd);
+ throw new IllegalArgumentException("Invalid requestedActionCd: " + requestedActionCd
+ + ". Given current actionCd: " + actionsHandler.getCurrentActionCd(event)
+ + ", the permittedActionCd: " + permittedActionCd);
}
}
@@ -220,8 +239,8 @@ public class CldsModel {
public static CldsModel createUsingControlName(String fullControlName) {
if (fullControlName == null || fullControlName.length() < UUID_LENGTH) {
throw new BadRequestException(
- "closed loop id / control name length, " + (fullControlName != null ? fullControlName.length() : 0)
- + ", less than the minimum of: " + UUID_LENGTH);
+ "closed loop id / control name length, " + (fullControlName != null ? fullControlName.length() : 0)
+ + ", less than the minimum of: " + UUID_LENGTH);
}
CldsModel model = new CldsModel();
model.setControlNamePrefix(fullControlName.substring(0, fullControlName.length() - UUID_LENGTH));
@@ -251,11 +270,11 @@ public class CldsModel {
CldsModel cldsModel = createUsingControlName(controlName);
cldsModel = cldsDao.getModelByUuid(cldsModel.getControlNameUuid());
cldsModel.determineStatus();
- if (dcaeEvent.getCldsActionCd().equals(CldsEvent.ACTION_UNDEPLOY)
- || (dcaeEvent.getCldsActionCd().equals(CldsEvent.ACTION_DEPLOY)
+ if (dcaeEvent.getCldsActionCd().equals(CldsEvent.ACTION_UNDEPLOY) || (dcaeEvent.getCldsActionCd()
+ .equals(CldsEvent.ACTION_DEPLOY)
&& (cldsModel.getStatus().equals(STATUS_DISTRIBUTED) || cldsModel.getStatus().equals(STATUS_DESIGN)))) {
CldsEvent.insEvent(cldsDao, dcaeEvent.getControlName(), userid, dcaeEvent.getCldsActionCd(),
- CldsEvent.ACTION_STATE_RECEIVED, null);
+ CldsEvent.ACTION_STATE_RECEIVED, null);
}
cldsDao.insModelInstance(cldsModel, dcaeEvent.getInstances());
return cldsModel;
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsServiceData.java b/src/main/java/org/onap/clamp/clds/model/CldsServiceData.java
index 45194deca..8777ab5c9 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsServiceData.java
+++ b/src/main/java/org/onap/clamp/clds/model/CldsServiceData.java
@@ -18,7 +18,7 @@
* limitations under the License.
* ============LICENSE_END============================================
* ===================================================================
- *
+ *
*/
package org.onap.clamp.clds.model;
@@ -77,8 +77,8 @@ public class CldsServiceData implements Serializable {
}
/**
- * Filter out any VFs that the user is not authorized for. Use the
- * CldsService to determine if the user is authorized for a VF.
+ * Filter out any VFs that the user is not authorized for. Use the CldsService
+ * to determine if the user is authorized for a VF.
*
* @param svc The clds service
*/
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsTemplate.java b/src/main/java/org/onap/clamp/clds/model/CldsTemplate.java
index 8f3408375..b1247801b 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsTemplate.java
+++ b/src/main/java/org/onap/clamp/clds/model/CldsTemplate.java
@@ -18,11 +18,13 @@
* limitations under the License.
* ============LICENSE_END============================================
* ===================================================================
- *
+ *
*/
package org.onap.clamp.clds.model;
+import com.google.gson.annotations.Expose;
+
import javax.ws.rs.NotFoundException;
import org.onap.clamp.clds.dao.CldsDao;
@@ -32,35 +34,48 @@ import org.onap.clamp.clds.dao.CldsDao;
*/
public class CldsTemplate {
- public static final String STATUS_DESIGN = "DESIGN";
- public static final String STATUS_ACTIVE = "ACTIVE";
- public static final String STATUS_STOPPED = "STOPPED";
+ public static final String STATUS_DESIGN = "DESIGN";
+ public static final String STATUS_ACTIVE = "ACTIVE";
+ public static final String STATUS_STOPPED = "STOPPED";
public static final String STATUS_DELETING = "DELETING";
// manual intervention required
- public static final String STATUS_ERROR = "ERROR";
- public static final String STATUS_UNKNOWN = "UNKNOWN";
-
- private String id;
- private String name;
- private String controlNamePrefix;
- private String controlNameUuid;
- private String bpmnId;
- private String bpmnUserid;
- private String bpmnText;
- private String imageId;
- private String imageUserid;
- private String imageText;
- private String propId;
- private String propUserid;
- private String propText;
-
- private boolean userAuthorizedToUpdate;
+ public static final String STATUS_ERROR = "ERROR";
+ public static final String STATUS_UNKNOWN = "UNKNOWN";
+
+ @Expose
+ private String id;
+ @Expose
+ private String name;
+ @Expose
+ private String controlNamePrefix;
+ @Expose
+ private String controlNameUuid;
+ @Expose
+ private String bpmnId;
+ @Expose
+ private String bpmnUserid;
+ @Expose
+ private String bpmnText;
+ @Expose
+ private String imageId;
+ @Expose
+ private String imageUserid;
+ @Expose
+ private String imageText;
+ @Expose
+ private String propId;
+ @Expose
+ private String propUserid;
+ @Expose
+ private String propText;
+ @Expose
+ private boolean userAuthorizedToUpdate;
/**
* Save template to DB.
*
* @param cldsDao The cldsDao
- * @param userid The user Id
+ * @param userid The user Id
*/
public void save(CldsDao cldsDao, String userid) {
cldsDao.setTemplate(this, userid);
@@ -69,10 +84,10 @@ public class CldsTemplate {
/**
* Retrieve from DB.
*
- * @param cldsDao The cldsDao
- * @param name The template name to retrieve
- * @param okIfNotFound
- * The flag indicating whether exception will be returned in case nothing is found
+ * @param cldsDao The cldsDao
+ * @param name The template name to retrieve
+ * @param okIfNotFound The flag indicating whether exception will be returned in
+ * case nothing is found
* @return Clds template from DB
*/
public static CldsTemplate retrieve(CldsDao cldsDao, String name, boolean okIfNotFound) {
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsToscaModel.java b/src/main/java/org/onap/clamp/clds/model/CldsToscaModel.java
index 961e1e328..5ae13d20a 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsToscaModel.java
+++ b/src/main/java/org/onap/clamp/clds/model/CldsToscaModel.java
@@ -23,6 +23,8 @@
package org.onap.clamp.clds.model;
+import com.google.gson.annotations.Expose;
+
import java.util.List;
import org.apache.commons.lang3.StringUtils;
@@ -33,8 +35,11 @@ import org.onap.clamp.clds.tosca.ToscaYamlToJsonConvertor;
public class CldsToscaModel extends CldsToscaModelRevision {
+ @Expose
private String id;
+ @Expose
private String policyType;
+ @Expose
private String toscaModelName;
/**
@@ -47,7 +52,7 @@ public class CldsToscaModel extends CldsToscaModelRevision {
* Creates or updates Tosca Model to DB.
*
* @param cldsDao The cldsDao
- * @param userId The user Id
+ * @param userId The user Id
*/
public CldsToscaModel save(CldsDao cldsDao, ClampProperties refProp, PolicyClient policyClient, String userId) {
CldsToscaModel cldsToscaModel = null;
@@ -85,6 +90,7 @@ public class CldsToscaModel extends CldsToscaModelRevision {
/**
* Get the Id.
+ *
* @return the id
*/
public String getId() {
@@ -93,8 +99,8 @@ public class CldsToscaModel extends CldsToscaModelRevision {
/**
* Set the id.
- * @param id
- * the id to set
+ *
+ * @param id the id to set
*/
public void setId(String id) {
this.id = id;
@@ -102,6 +108,7 @@ public class CldsToscaModel extends CldsToscaModelRevision {
/**
* Get the policy type.
+ *
* @return the policyType
*/
public String getPolicyType() {
@@ -110,8 +117,8 @@ public class CldsToscaModel extends CldsToscaModelRevision {
/**
* Set the policy type.
- * @param policyType
- * the policyType to set
+ *
+ * @param policyType the policyType to set
*/
public void setPolicyType(String policyType) {
this.policyType = policyType;
@@ -119,6 +126,7 @@ public class CldsToscaModel extends CldsToscaModelRevision {
/**
* Get the tosca model name.
+ *
* @return the toscaModelName
*/
public String getToscaModelName() {
@@ -127,8 +135,8 @@ public class CldsToscaModel extends CldsToscaModelRevision {
/**
* Set the tosca model name.
- * @param toscaModelName
- * the toscaModelName to set
+ *
+ * @param toscaModelName the toscaModelName to set
*/
public void setToscaModelName(String toscaModelName) {
this.toscaModelName = toscaModelName;
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsVfcData.java b/src/main/java/org/onap/clamp/clds/model/CldsVfcData.java
index 9448cefcd..034fc28ce 100644
--- a/src/main/java/org/onap/clamp/clds/model/CldsVfcData.java
+++ b/src/main/java/org/onap/clamp/clds/model/CldsVfcData.java
@@ -5,20 +5,20 @@
* 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.
+ * 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
+ *
+ * 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.clamp.clds.model;
@@ -28,9 +28,9 @@ import java.util.List;
public class CldsVfcData implements Serializable {
- private static final long serialVersionUID = 406993878174183557L;
- private String vfcName;
- private String vfcInvariantResourceUuid;
+ private static final long serialVersionUID = 406993878174183557L;
+ private String vfcName;
+ private String vfcInvariantResourceUuid;
private List<CldsAlarmCondition> cldsAlarmConditions;
public String getVfcName() {
diff --git a/src/main/java/org/onap/clamp/clds/model/DcaeEvent.java b/src/main/java/org/onap/clamp/clds/model/DcaeEvent.java
index a6ad10b72..9126f9abf 100644
--- a/src/main/java/org/onap/clamp/clds/model/DcaeEvent.java
+++ b/src/main/java/org/onap/clamp/clds/model/DcaeEvent.java
@@ -23,6 +23,8 @@
package org.onap.clamp.clds.model;
+import com.google.gson.annotations.Expose;
+
import java.util.List;
import javax.ws.rs.BadRequestException;
@@ -38,10 +40,15 @@ public class DcaeEvent {
public static final String EVENT_UNDEPLOYMENT = "undeployment";
public static final String ARTIFACT_NAME_SUFFIX = ".yml";
+ @Expose
private String event;
+ @Expose
private String serviceUuid;
+ @Expose
private String resourceUuid;
+ @Expose
private String artifactName; // controlName.yml
+ @Expose
private List<CldsModelInstance> instances;
/**
@@ -83,12 +90,13 @@ public class DcaeEvent {
return artifactName.substring(0, artifactName.length() - ARTIFACT_NAME_SUFFIX.length());
} else {
throw new BadRequestException("artifactName value not valid (expecting it to end with "
- + ARTIFACT_NAME_SUFFIX + "): " + artifactName);
+ + ARTIFACT_NAME_SUFFIX + "): " + artifactName);
}
}
/**
* Get the event.
+ *
* @return the event
*/
public String getEvent() {
@@ -97,8 +105,8 @@ public class DcaeEvent {
/**
* Set the event.
- * @param event
- * the event to set
+ *
+ * @param event the event to set
*/
public void setEvent(String event) {
this.event = event;
@@ -106,6 +114,7 @@ public class DcaeEvent {
/**
* Get the serviceUUID.
+ *
* @return the serviceUUID
*/
public String getServiceUUID() {
@@ -114,8 +123,8 @@ public class DcaeEvent {
/**
* Set the serviceUUID.
- * @param serviceUUID
- * the serviceUUID to set
+ *
+ * @param serviceUUID the serviceUUID to set
*/
public void setServiceUUID(String serviceUuid) {
this.serviceUuid = serviceUuid;
@@ -123,6 +132,7 @@ public class DcaeEvent {
/**
* Get the resourceUUID.
+ *
* @return the resourceUUID
*/
public String getResourceUUID() {
@@ -131,8 +141,8 @@ public class DcaeEvent {
/**
* Set the resourceUUID.
- * @param resourceUUID
- * the resourceUUID to set
+ *
+ * @param resourceUUID the resourceUUID to set
*/
public void setResourceUUID(String resourceUuid) {
this.resourceUuid = resourceUuid;
@@ -140,6 +150,7 @@ public class DcaeEvent {
/**
* Get the artifact name.
+ *
* @return the artifactName
*/
public String getArtifactName() {
@@ -148,8 +159,8 @@ public class DcaeEvent {
/**
* Set the artifact name.
- * @param artifactName
- * the artifactName to set
+ *
+ * @param artifactName the artifactName to set
*/
public void setArtifactName(String artifactName) {
this.artifactName = artifactName;
@@ -157,6 +168,7 @@ public class DcaeEvent {
/**
* Get the list of instances.
+ *
* @return The list of model instances
*/
public List<CldsModelInstance> getInstances() {
@@ -165,6 +177,7 @@ public class DcaeEvent {
/**
* Set the list of model instances.
+ *
* @param instances The list of model instances to set
*/
public void setInstances(List<CldsModelInstance> instances) {
diff --git a/src/main/java/org/onap/clamp/clds/model/ValueItem.java b/src/main/java/org/onap/clamp/clds/model/ValueItem.java
index 74b369f79..42323908c 100644
--- a/src/main/java/org/onap/clamp/clds/model/ValueItem.java
+++ b/src/main/java/org/onap/clamp/clds/model/ValueItem.java
@@ -5,28 +5,31 @@
* 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.
+ * 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
+ *
+ * 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.clamp.clds.model;
+import com.google.gson.annotations.Expose;
+
/**
* ValueItem used for value lists.
*/
public class ValueItem {
+ @Expose
private String value;
/**
@@ -43,6 +46,7 @@ public class ValueItem {
/**
* Get the value.
+ *
* @return the value
*/
public String getValue() {
@@ -51,8 +55,8 @@ public class ValueItem {
/**
* Set the value.
- * @param value
- * the value to set
+ *
+ * @param value the value to set
*/
public void setValue(String value) {
this.value = value;
diff --git a/src/main/java/org/onap/clamp/loop/LoopController.java b/src/main/java/org/onap/clamp/loop/LoopController.java
index b862780de..7d41e489a 100644
--- a/src/main/java/org/onap/clamp/loop/LoopController.java
+++ b/src/main/java/org/onap/clamp/loop/LoopController.java
@@ -116,12 +116,13 @@ public class LoopController {
/**
* Get the SVG representation of the loop
- *
+ *
* @param loopName
* The loop name
* @return The SVG representation
*/
public String getSVGRepresentation(String loopName) {
- return loopService.getLoop(loopName).getSvgRepresentation();
+ Loop loop = loopService.getLoop(loopName);
+ return loop != null ? loop.getSvgRepresentation() : null;
}
}