Rework of the DCAE client 77/6977/2
authorDeterme, Sebastien (sd378r) <sd378r@intl.att.com>
Tue, 8 Aug 2017 10:16:59 +0000 (03:16 -0700)
committerSébastien Determe <sd378r@intl.att.com>
Tue, 8 Aug 2017 12:36:31 +0000 (12:36 +0000)
Rework of the DCAE client and javascripts/html pages of the designer
(part5)

Change-Id: I3e7b889e2112dc2745632a328a02c6c603ecc195
Issue-Id: CLAMP-1
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
18 files changed:
src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java [new file with mode: 0644]
src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java [new file with mode: 0644]
src/main/java/org/onap/clamp/clds/model/CldsHealthCheck.java [new file with mode: 0644]
src/main/java/org/onap/clamp/clds/model/CldsInfo.java [new file with mode: 0644]
src/main/java/org/onap/clamp/clds/model/CldsVfKPIData.java [new file with mode: 0644]
src/main/java/org/onap/clamp/clds/model/prop/PolicyChain.java [new file with mode: 0644]
src/main/java/org/onap/clamp/clds/model/prop/ResourceGroup.java [new file with mode: 0644]
src/main/java/org/onap/clamp/clds/util/LoggingUtils.java [new file with mode: 0644]
src/main/resources/META-INF/resources/designer/images/Collectors.png [new file with mode: 0644]
src/main/resources/META-INF/resources/designer/invalid_login.html [new file with mode: 0644]
src/main/resources/META-INF/resources/designer/lib/angular-md5.js [new file with mode: 0644]
src/main/resources/META-INF/resources/designer/logout.html [new file with mode: 0644]
src/main/resources/META-INF/resources/designer/menu_simplified.html [new file with mode: 0644]
src/main/resources/META-INF/resources/designer/partials/portfolios/extra_user_info.html [new file with mode: 0644]
src/main/resources/META-INF/resources/designer/please_wait.html [new file with mode: 0644]
src/main/resources/META-INF/resources/designer/scripts/ExtraUserInfoCtrl.js [new file with mode: 0644]
src/main/resources/META-INF/resources/designer/scripts/ExtraUserInfoService.js [new file with mode: 0644]
src/main/resources/policyLogger.properties [new file with mode: 0644]

diff --git a/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java b/src/main/java/org/onap/clamp/clds/client/DcaeDispatcherServices.java
new file mode 100644 (file)
index 0000000..343391e
--- /dev/null
@@ -0,0 +1,321 @@
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP CLAMP\r
+ * ================================================================================\r
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights\r
+ *                             reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END============================================\r
+ * ===================================================================\r
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
+ */\r
+\r
+package org.onap.clamp.clds.client;\r
+\r
+import java.io.BufferedReader;\r
+import java.io.DataOutputStream;\r
+import java.io.InputStream;\r
+import java.io.InputStreamReader;\r
+import java.net.URL;\r
+import java.util.stream.Collectors;\r
+\r
+import javax.net.ssl.HttpsURLConnection;\r
+\r
+import org.json.simple.JSONObject;\r
+import org.json.simple.parser.JSONParser;\r
+import org.onap.clamp.clds.model.refprop.RefProp;\r
+import org.springframework.beans.factory.annotation.Autowired;\r
+\r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
+\r
+/**\r
+ *\r
+ *\r
+ */\r
+public class DcaeDispatcherServices {\r
+    protected static final EELFLogger logger        = EELFManager.getInstance().getLogger(DcaeDispatcherServices.class);\r
+    protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();\r
+\r
+    @Autowired\r
+    private RefProp                 refProp;\r
+\r
+    /**\r
+     *\r
+     * @param deploymentId\r
+     * @return\r
+     * @throws Exception\r
+     */\r
+    public String deleteDeployment(String deploymentId) throws Exception {\r
+\r
+        String statusUrl = null;\r
+        InputStream in = null;\r
+        try {\r
+            String url = refProp.getStringValue("DCAE_DISPATCHER_URL") + "/dcae-deployments/" + deploymentId;\r
+            logger.info("Dcae Dispatcher url - " + url);\r
+            URL obj = new URL(url);\r
+            HttpsURLConnection conn = (HttpsURLConnection) obj.openConnection();\r
+            conn.setRequestMethod("DELETE");\r
+            int responseCode = conn.getResponseCode();\r
+\r
+            boolean requestFailed = true;\r
+            logger.info("responseCode=" + responseCode);\r
+            if (responseCode == 200 || responseCode == 202) {\r
+                requestFailed = false;\r
+            }\r
+\r
+            InputStream inStream = conn.getErrorStream();\r
+            if (inStream == null) {\r
+                inStream = conn.getInputStream();\r
+            }\r
+\r
+            String responseStr = null;\r
+            if (inStream != null) {\r
+                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inStream));\r
+                String inputLine = null;\r
+                StringBuffer response = new StringBuffer();\r
+                while ((inputLine = bufferedReader.readLine()) != null) {\r
+                    response.append(inputLine);\r
+                }\r
+                responseStr = response.toString();\r
+            }\r
+\r
+            if (responseStr != null) {\r
+                if (requestFailed) {\r
+                    logger.error("requestFailed - responseStr=" + responseStr);\r
+                    throw new Exception(responseStr);\r
+                }\r
+            }\r
+\r
+            logger.debug("response code " + responseCode);\r
+            in = conn.getInputStream();\r
+            logger.debug("res:" + responseStr);\r
+            JSONParser parser = new JSONParser();\r
+            Object obj0 = parser.parse(responseStr);\r
+            JSONObject jsonObj = (JSONObject) obj0;\r
+            JSONObject linksObj = (JSONObject) jsonObj.get("links");\r
+            statusUrl = (String) linksObj.get("status");\r
+            logger.debug("Status URL: " + statusUrl);\r
+\r
+        } catch (Exception e) {\r
+            logger.error(e.getClass().getName() + " " + e.getMessage());\r
+            throw e;\r
+        } finally {\r
+            if (in != null) {\r
+                in.close();\r
+            }\r
+        }\r
+\r
+        return statusUrl;\r
+\r
+    }\r
+\r
+    /**\r
+     *\r
+     * @param statusUrl\r
+     * @return\r
+     * @throws Exception\r
+     */\r
+    public String getOperationStatus(String statusUrl) throws Exception {\r
+\r
+        String opStatus = null;\r
+        InputStream in = null;\r
+        try {\r
+            URL obj = new URL(statusUrl);\r
+            HttpsURLConnection conn = (HttpsURLConnection) obj.openConnection();\r
+            conn.setRequestMethod("GET");\r
+            int responseCode = conn.getResponseCode();\r
+            logger.debug("response code " + responseCode);\r
+            in = conn.getInputStream();\r
+            String res = new BufferedReader(new InputStreamReader(in)).lines().collect(Collectors.joining("\n"));\r
+            JSONParser parser = new JSONParser();\r
+            Object obj0 = parser.parse(res);\r
+            JSONObject jsonObj = (JSONObject) obj0;\r
+            String operationType = (String) jsonObj.get("operationType");\r
+            String status = (String) jsonObj.get("status");\r
+            logger.debug("Operation Type " + operationType);\r
+            logger.debug("Status " + status);\r
+            opStatus = status;\r
+\r
+        } catch (Exception e) {\r
+            logger.debug(e.getClass().getName() + " " + e.getMessage());\r
+            logger.debug(e.getMessage()\r
+                    + " : got exception while retrieving status, trying again until we get 200 response code");\r
+        } finally {\r
+            if (in != null) {\r
+                in.close();\r
+            }\r
+        }\r
+\r
+        return opStatus;\r
+    }\r
+\r
+    /**\r
+     *\r
+     * @throws Exception\r
+     */\r
+    public void getDeployments() throws Exception {\r
+        InputStream in = null;\r
+        try {\r
+            String url = refProp.getStringValue("DCAE_DISPATCHER_URL") + "/dcae-deployments";\r
+            logger.info("Dcae Dispatcher deployments url - " + url);\r
+            URL obj = new URL(url);\r
+            HttpsURLConnection conn = (HttpsURLConnection) obj.openConnection();\r
+            conn.setRequestMethod("GET");\r
+            int responseCode = conn.getResponseCode();\r
+            logger.debug("response code " + responseCode);\r
+            in = conn.getInputStream();\r
+            String res = new BufferedReader(new InputStreamReader(in)).lines().collect(Collectors.joining("\n"));\r
+            logger.debug("res:" + res);\r
+        } catch (Exception e) {\r
+            logger.error("Exception occurred during DCAE communication", e);\r
+            throw e;\r
+        } finally {\r
+            if (in != null) {\r
+                in.close();\r
+            }\r
+        }\r
+    }\r
+\r
+    /**\r
+     * Returns status URL for deployment operation\r
+     *\r
+     * @param deploymentId\r
+     * @param serviceTypeId\r
+     * @return\r
+     * @throws Exception\r
+     */\r
+    public String createNewDeployment(String deploymentId, String serviceTypeId) throws Exception {\r
+\r
+        String statusUrl = null;\r
+        InputStream inStream = null;\r
+        BufferedReader in = null;\r
+        try {\r
+            String apiBodyString = "{\"serviceTypeId\": \"" + serviceTypeId + "\"}";\r
+            logger.info("Dcae api Body String - " + apiBodyString);\r
+            String url = refProp.getStringValue("DCAE_DISPATCHER_URL") + "/dcae-deployments/" + deploymentId;\r
+            logger.info("Dcae Dispatcher Service url - " + url);\r
+            URL obj = new URL(url);\r
+            HttpsURLConnection conn = (HttpsURLConnection) obj.openConnection();\r
+            conn.setRequestMethod("PUT");\r
+            conn.setRequestProperty("Content-Type", "application/json");\r
+            conn.setDoOutput(true);\r
+            try (DataOutputStream wr = new DataOutputStream(conn.getOutputStream())) {\r
+                wr.writeBytes(apiBodyString);\r
+                wr.flush();\r
+            }\r
+\r
+            boolean requestFailed = true;\r
+            int responseCode = conn.getResponseCode();\r
+            logger.info("responseCode=" + responseCode);\r
+            if (responseCode == 200 || responseCode == 202) {\r
+                requestFailed = false;\r
+            }\r
+\r
+            inStream = conn.getErrorStream();\r
+            if (inStream == null) {\r
+                inStream = conn.getInputStream();\r
+            }\r
+\r
+            String responseStr = null;\r
+            if (inStream != null) {\r
+                in = new BufferedReader(new InputStreamReader(inStream));\r
+\r
+                String inputLine = null;\r
+\r
+                StringBuffer response = new StringBuffer();\r
+\r
+                while ((inputLine = in.readLine()) != null) {\r
+                    response.append(inputLine);\r
+                }\r
+\r
+                responseStr = response.toString();\r
+            }\r
+\r
+            if (responseStr != null) {\r
+                if (requestFailed) {\r
+                    logger.error("requestFailed - responseStr=" + responseStr);\r
+                    throw new Exception(responseStr);\r
+                }\r
+            }\r
+\r
+            logger.debug("response code " + responseCode);\r
+            JSONParser parser = new JSONParser();\r
+            Object obj0 = parser.parse(responseStr);\r
+            JSONObject jsonObj = (JSONObject) obj0;\r
+            JSONObject linksObj = (JSONObject) jsonObj.get("links");\r
+            statusUrl = (String) linksObj.get("status");\r
+            logger.debug("Status URL: " + statusUrl);\r
+        } catch (Exception e) {\r
+            logger.error("Exception occurred during the DCAE communication", e);\r
+            throw e;\r
+        } finally {\r
+            if (inStream != null) {\r
+                inStream.close();\r
+            }\r
+            if (in != null) {\r
+                in.close();\r
+            }\r
+        }\r
+        return statusUrl;\r
+    }\r
+\r
+    /**\r
+     *\r
+     * @param deploymentId\r
+     * @param serviceTypeId\r
+     * @return\r
+     * @throws Exception\r
+     */\r
+    public String deleteExistingDeployment(String deploymentId, String serviceTypeId) throws Exception {\r
+\r
+        String statusUrl = null;\r
+        InputStream in = null;\r
+        try {\r
+            String apiBodyString = "{\"serviceTypeId\": \"" + serviceTypeId + "\"}";\r
+            logger.debug(apiBodyString);\r
+            String url = refProp.getStringValue("DCAE_DISPATCHER_URL") + "/dcae-deployments/" + deploymentId;\r
+            logger.info("Dcae Dispatcher deployments url - " + url);\r
+            URL obj = new URL(url);\r
+            HttpsURLConnection conn = (HttpsURLConnection) obj.openConnection();\r
+            conn.setRequestMethod("DELETE");\r
+            conn.setRequestProperty("Content-Type", "application/json");\r
+            conn.setDoOutput(true);\r
+            DataOutputStream wr = new DataOutputStream(conn.getOutputStream());\r
+            wr.writeBytes(apiBodyString);\r
+            wr.flush();\r
+\r
+            int responseCode = conn.getResponseCode();\r
+            logger.debug("response code " + responseCode);\r
+            in = conn.getInputStream();\r
+            String res = new BufferedReader(new InputStreamReader(in)).lines().collect(Collectors.joining("\n"));\r
+            logger.debug("res:" + res);\r
+            JSONParser parser = new JSONParser();\r
+            Object obj0 = parser.parse(res);\r
+            JSONObject jsonObj = (JSONObject) obj0;\r
+            JSONObject linksObj = (JSONObject) jsonObj.get("links");\r
+            statusUrl = (String) linksObj.get("status");\r
+            logger.debug("Status URL: " + statusUrl);\r
+        } catch (Exception e) {\r
+            logger.error("Exception occurred during DCAE communication", e);\r
+            throw e;\r
+        } finally {\r
+            if (in != null) {\r
+                in.close();\r
+            }\r
+        }\r
+        return statusUrl;\r
+    }\r
+\r
+}
\ No newline at end of file
diff --git a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java b/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java
new file mode 100644 (file)
index 0000000..3dfe9fe
--- /dev/null
@@ -0,0 +1,181 @@
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP CLAMP\r
+ * ================================================================================\r
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights\r
+ *                             reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END============================================\r
+ * ===================================================================\r
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
+ */\r
+\r
+package org.onap.clamp.clds.client;\r
+\r
+import java.io.BufferedReader;\r
+import java.io.IOException;\r
+import java.io.InputStreamReader;\r
+import java.net.HttpURLConnection;\r
+import java.net.URL;\r
+import java.util.List;\r
+\r
+import javax.ws.rs.BadRequestException;\r
+\r
+import org.json.simple.JSONArray;\r
+import org.json.simple.JSONObject;\r
+import org.json.simple.parser.JSONParser;\r
+import org.json.simple.parser.ParseException;\r
+import org.onap.clamp.clds.dao.CldsDao;\r
+import org.onap.clamp.clds.model.CldsEvent;\r
+import org.onap.clamp.clds.model.CldsModel;\r
+import org.onap.clamp.clds.model.DcaeEvent;\r
+import org.onap.clamp.clds.model.prop.Global;\r
+import org.onap.clamp.clds.model.prop.ModelProperties;\r
+import org.onap.clamp.clds.model.refprop.RefProp;\r
+import org.springframework.beans.factory.annotation.Autowired;\r
+\r
+import com.att.eelf.configuration.EELFLogger;\r
+import com.att.eelf.configuration.EELFManager;\r
+import com.fasterxml.jackson.core.JsonProcessingException;\r
+\r
+public class DcaeInventoryServices {\r
+    protected static final EELFLogger       logger      = EELFManager.getInstance().getLogger(DcaeInventoryServices.class);\r
+    protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();\r
+\r
+    @Autowired\r
+    private RefProp                 refProp;\r
+\r
+    @Autowired\r
+    private CldsDao                 cldsDao;\r
+\r
+    @Autowired\r
+    private SdcCatalogServices      sdcCatalogServices;\r
+\r
+    public void setEventInventory(CldsModel cldsModel, String userId) throws Exception {\r
+        String artifactName = cldsModel.getControlName();\r
+        DcaeEvent dcaeEvent = new DcaeEvent();\r
+        String isDcaeInfoAvailable = null;\r
+        if (artifactName != null) {\r
+            artifactName = artifactName + ".yml";\r
+        }\r
+        try {\r
+            /*\r
+             * Below are the properties required for calling the dcae inventory\r
+             * url call\r
+             */\r
+            ModelProperties prop = new ModelProperties(cldsModel.getName(), cldsModel.getControlName(), null, false, "{}",\r
+                    cldsModel.getPropText());\r
+            Global global = prop.getGlobal();\r
+            String invariantServiceUuid = global.getService();\r
+            List<String> resourceUuidList = global.getResourceVf();\r
+            String serviceUuid = sdcCatalogServices.getServiceUuidFromServiceInvariantId(invariantServiceUuid);\r
+            String resourceUuid = "";\r
+            if (resourceUuidList != null && resourceUuidList.size() > 0) {\r
+                resourceUuid = resourceUuidList.get(0).toString();\r
+            }\r
+            /* Invemtory service url is called in this method */\r
+            isDcaeInfoAvailable = getDcaeInformation(artifactName, serviceUuid, resourceUuid);\r
+\r
+            /* set dcae events */\r
+            dcaeEvent.setArtifactName(artifactName);\r
+            dcaeEvent.setEvent(DcaeEvent.EVENT_DISTRIBUTION);\r
+\r
+        } catch (JsonProcessingException e) {\r
+            // exception\r
+            logger.error("JsonProcessingException" + e);\r
+        } catch (IOException e) {\r
+\r
+            // exception\r
+            logger.error("IOException :" + e);\r
+        }\r
+        /* Null whether the DCAE has items lenght or not */\r
+        if (isDcaeInfoAvailable != null) {\r
+            /* Inserting Event in to DB */\r
+            logger.info(isDcaeInfoAvailable);\r
+            JSONParser parser = new JSONParser();\r
+            Object obj0 = parser.parse(isDcaeInfoAvailable);\r
+            JSONObject jsonObj = (JSONObject) obj0;\r
+            String oldTypeId = cldsModel.getTypeId();\r
+                   String newTypeId = "";\r
+            if (jsonObj.get("typeId") != null) {\r
+               newTypeId = jsonObj.get("typeId").toString();\r
+                cldsModel.setTypeId(jsonObj.get("typeId").toString());\r
+            }\r
+            // cldsModel.setTypeName(cldsModel.getControlName().toString()+".yml");\r
+            if (jsonObj.get("typeName") != null) {\r
+                cldsModel.setTypeName(jsonObj.get("typeName").toString());\r
+            }\r
+            if(oldTypeId == null || !oldTypeId.equalsIgnoreCase(newTypeId)){\r
+               CldsEvent.insEvent(cldsDao, dcaeEvent.getControlName(), userId, dcaeEvent.getCldsActionCd(),\r
+                    CldsEvent.ACTION_STATE_RECEIVED, null);\r
+            }\r
+            cldsModel.save(cldsDao, userId);\r
+        } else {\r
+            logger.info(cldsModel.getName() + " Model is not present in Dcae Inventory Service.");\r
+        }\r
+    }\r
+\r
+    public String getDcaeInformation(String artifactName, String serviceUUID, String resourceUUID)\r
+            throws IOException, ParseException {\r
+        String queryString = "?sdcResourceId=" + resourceUUID + "&sdcServiceId=" + serviceUUID + "&typeName="\r
+                + artifactName;\r
+        String fullUrl = refProp.getStringValue("DCAE_INVENTORY_URL") + "/dcae-service-types" + queryString;\r
+        logger.info("Dcae Inventory Service full url - " + fullUrl);\r
+        String daceInventoryResponse = null;\r
+        URL inventoryUrl = new URL(fullUrl);\r
+\r
+        HttpURLConnection conn = (HttpURLConnection) inventoryUrl.openConnection();\r
+        conn.setRequestMethod("GET");\r
+        boolean requestFailed = true;\r
+        int responseCode = conn.getResponseCode();\r
+        if (responseCode == 200) {\r
+            requestFailed = false;\r
+        }\r
+\r
+        BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));\r
+        String inputLine = null;\r
+        StringBuffer response = new StringBuffer();\r
+        String responseStr = null;\r
+        while ((inputLine = in.readLine()) != null) {\r
+            response.append(inputLine);\r
+        }\r
+        in.close();\r
+        responseStr = response.toString();\r
+        if (responseStr != null) {\r
+            if (requestFailed) {\r
+                logger.error("requestFailed - responseStr=" + response);\r
+                throw new BadRequestException(responseStr);\r
+            }\r
+        }\r
+        String jsonResponseString = response.toString();\r
+        JSONParser parser = new JSONParser();\r
+        Object obj0 = parser.parse(jsonResponseString);\r
+\r
+        JSONObject jsonObj = (JSONObject) obj0;\r
+\r
+        Long totalCount = (Long) jsonObj.get("totalCount");\r
+\r
+        int numServices = totalCount.intValue();\r
+        if (numServices == 0) {\r
+            daceInventoryResponse = null;\r
+        } else if (numServices > 0) {\r
+            JSONArray itemsArray = (JSONArray) jsonObj.get("items");\r
+            JSONObject dcaeServiceType0 = (JSONObject) itemsArray.get(0);\r
+            daceInventoryResponse = dcaeServiceType0.toString();\r
+            logger.info(daceInventoryResponse.toString());\r
+        }\r
+        return daceInventoryResponse;\r
+    }\r
+\r
+}\r
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsHealthCheck.java b/src/main/java/org/onap/clamp/clds/model/CldsHealthCheck.java
new file mode 100644 (file)
index 0000000..9a5e5a5
--- /dev/null
@@ -0,0 +1,57 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * 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============================================
+ * ===================================================================
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.clamp.clds.model;
+
+public class CldsHealthCheck {
+
+    private String healthCheckComponent;
+
+    public String getHealthCheckComponent() {
+        return healthCheckComponent;
+    }
+
+    public void setHealthCheckComponent(String healthCheckComponent) {
+        this.healthCheckComponent = healthCheckComponent;
+    }
+
+    private String healthCheckStatus;
+    private String description;
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getHealthCheckStatus() {
+        return healthCheckStatus;
+    }
+
+    public void setHealthCheckStatus(String healthCheckStatus) {
+        this.healthCheckStatus = healthCheckStatus;
+    }
+
+}
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsInfo.java b/src/main/java/org/onap/clamp/clds/model/CldsInfo.java
new file mode 100644 (file)
index 0000000..9dc0f87
--- /dev/null
@@ -0,0 +1,83 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * 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============================================
+ * ===================================================================
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.clamp.clds.model;
+
+public class CldsInfo {
+
+    private String  userName;
+    private String  cldsVersion;
+    private boolean permissionReadCl;
+    private boolean permissionUpdateCl;
+    private boolean permissionReadTemplate;
+    private boolean permissionUpdateTemplate;
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public String getCldsVersion() {
+        return cldsVersion;
+    }
+
+    public void setCldsVersion(String cldsVersion) {
+        this.cldsVersion = cldsVersion;
+    }
+
+    public boolean isPermissionReadCl() {
+        return permissionReadCl;
+    }
+
+    public void setPermissionReadCl(boolean permissionReadCl) {
+        this.permissionReadCl = permissionReadCl;
+    }
+
+    public boolean isPermissionUpdateCl() {
+        return permissionUpdateCl;
+    }
+
+    public void setPermissionUpdateCl(boolean permissionUpdateCl) {
+        this.permissionUpdateCl = permissionUpdateCl;
+    }
+
+    public boolean isPermissionReadTemplate() {
+        return permissionReadTemplate;
+    }
+
+    public void setPermissionReadTemplate(boolean permissionReadTemplate) {
+        this.permissionReadTemplate = permissionReadTemplate;
+    }
+
+    public boolean isPermissionUpdateTemplate() {
+        return permissionUpdateTemplate;
+    }
+
+    public void setPermissionUpdateTemplate(boolean permissionUpdateTemplate) {
+        this.permissionUpdateTemplate = permissionUpdateTemplate;
+    }
+
+}
diff --git a/src/main/java/org/onap/clamp/clds/model/CldsVfKPIData.java b/src/main/java/org/onap/clamp/clds/model/CldsVfKPIData.java
new file mode 100644 (file)
index 0000000..62e676f
--- /dev/null
@@ -0,0 +1,89 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * 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============================================
+ * ===================================================================
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.clamp.clds.model;
+
+import java.io.Serializable;
+
+public class CldsVfKPIData implements Serializable {
+
+    private static final long serialVersionUID = 9067755871527776380L;
+
+    private String            nfNamingCode;
+    private String            nfNamingValue;
+
+    private String            fieldPath;
+    private String            fieldPathValue;
+
+    private String            thresholdName;
+    private String            thresholdValue;
+
+    public String getNfNamingCode() {
+        return nfNamingCode;
+    }
+
+    public void setNfNamingCode(String nfNamingCode) {
+        this.nfNamingCode = nfNamingCode;
+    }
+
+    public String getNfNamingValue() {
+        return nfNamingValue;
+    }
+
+    public void setNfNamingValue(String nfNamingValue) {
+        this.nfNamingValue = nfNamingValue;
+    }
+
+    public String getFieldPath() {
+        return fieldPath;
+    }
+
+    public void setFieldPath(String fieldPath) {
+        this.fieldPath = fieldPath;
+    }
+
+    public String getFieldPathValue() {
+        return fieldPathValue;
+    }
+
+    public void setFieldPathValue(String fieldPathValue) {
+        this.fieldPathValue = fieldPathValue;
+    }
+
+    public String getThresholdName() {
+        return thresholdName;
+    }
+
+    public void setThresholdName(String thresholdName) {
+        this.thresholdName = thresholdName;
+    }
+
+    public String getThresholdValue() {
+        return thresholdValue;
+    }
+
+    public void setThresholdValue(String thresholdValue) {
+        this.thresholdValue = thresholdValue;
+    }
+
+}
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/PolicyChain.java b/src/main/java/org/onap/clamp/clds/model/prop/PolicyChain.java
new file mode 100644 (file)
index 0000000..6142e9e
--- /dev/null
@@ -0,0 +1,99 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * 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============================================
+ * ===================================================================
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.clamp.clds.model.prop;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.fasterxml.jackson.databind.JsonNode;
+
+/**
+ * Parse Policy json properties.
+ *
+ * Example json:
+ * {"Policy_1e33tn8":{"PolicyTest1":[{"name":"pname","value":"PolicyTest1"},{
+ * "name":"pid","value":"1"},{"name":"timeout","value":"345"},{
+ * "policyConfigurations":[[{"name":"recipe","value":["restart"]},{"name":
+ * "maxRetries","value":["3"]},{"name":"retryTimeLimit","value":["180"]},{"name"
+ * :"_id","value":["q2JmHD5"]},{"name":"parentPolicy","value":[""]}],[{"name":
+ * "recipe","value":["rebuild"]},{"name":"maxRetries","value":["3"]},{"name":
+ * "retryTimeLimit","value":["180"]},{"name":"_id","value":["0ZqHdrR"]},{"name":
+ * "parentPolicy","value":[""]}]]}],"PolicyTest2":[{"name":"pname","value":
+ * "PolicyTest2"},{"name":"pid","value":"2"},{"name":"timeout","value":"345"},{
+ * "policyConfigurations":[[{"name":"recipe","value":["restart"]},{"name":
+ * "maxRetries","value":["3"]},{"name":"retryTimeLimit","value":["180"]},{"name"
+ * :"_id","value":["q2JmHD5"]},{"name":"parentPolicy","value":[""]}],[{"name":
+ * "recipe","value":["rebuild"]},{"name":"maxRetries","value":["3"]},{"name":
+ * "retryTimeLimit","value":["180"]},{"name":"_id","value":["0ZqHdrR"]},{"name":
+ * "parentPolicy","value":[""]}]]}]}} f
+ *
+ */
+public class PolicyChain {
+
+    protected static final EELFLogger       logger      = EELFManager.getInstance().getLogger(PolicyChain.class);
+    protected static final EELFLogger auditLogger = EELFManager.getInstance().getAuditLogger();
+
+    private String                  policyId;
+    private Integer                 timeout;
+    private List<PolicyItem>        policyItems;
+
+    public PolicyChain(JsonNode node) {
+
+        policyId = ModelElement.getValueByName(node, "pid");
+        timeout = ModelElement.getIntValueByName(node, "timeout");
+
+        // process policy configurations
+        JsonNode policyNode = node.get(node.size() - 1).get("policyConfigurations");
+        Iterator<JsonNode> itr = policyNode.elements();
+        policyItems = new ArrayList<PolicyItem>();
+        while (itr.hasNext()) {
+            policyItems.add(new PolicyItem(itr.next()));
+        }
+    }
+
+    /**
+     * @return the policyId
+     */
+    public String getPolicyId() {
+        return policyId;
+    }
+
+    /**
+     * @return the timeout
+     */
+    public Integer getTimeout() {
+        return timeout;
+    }
+
+    /**
+     * @return the policyItems
+     */
+    public List<PolicyItem> getPolicyItems() {
+        return policyItems;
+    }
+
+}
diff --git a/src/main/java/org/onap/clamp/clds/model/prop/ResourceGroup.java b/src/main/java/org/onap/clamp/clds/model/prop/ResourceGroup.java
new file mode 100644 (file)
index 0000000..de98333
--- /dev/null
@@ -0,0 +1,114 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * 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============================================
+ * ===================================================================
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+package org.onap.clamp.clds.model.prop;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
+import com.fasterxml.jackson.databind.JsonNode;
+
+/**
+ * Parse Resource Group json properties.
+ *
+ * Example json:
+ * {"StringMatch_0aji7go":{"Group1":[{"name":"rgname","value":"1493749598520"},{
+ * "name":"rgfriendlyname","value":"Group1"},{"name":"policyName","value":
+ * "Policy1"},{"name":"policyId","value":"1"},{"serviceConfigurations":[[{"name"
+ * :"aaiMatchingFields","value":["complex.city","vserver.vserver-name"]},{"name"
+ * :"aaiSendFields","value":["complex.city","vserver.vserver-name"]},{"name":
+ * "eventSeverity","value":["OK"]},{"name":"eventSourceType","value":[""]},{
+ * "name":"timeWindow","value":["100"]},{"name":"ageLimit","value":["100"]},{
+ * "name":"createClosedLoopEventId","value":["Initial"]},{"name":
+ * "outputEventName","value":["ONSET"]}]]}],"Group2":[{"name":"rgname","value":
+ * "1493749665149"},{"name":"rgfriendlyname","value":"Group2"},{"name":
+ * "policyName","value":"Policy2"},{"name":"policyId","value":"2"},{
+ * "serviceConfigurations":[[{"name":"aaiMatchingFields","value":[
+ * "cloud-region.identity-url","vserver.vserver-name"]},{"name":"aaiSendFields",
+ * "value":["cloud-region.identity-url","vserver.vserver-name"]},{"name":
+ * "eventSeverity","value":["NORMAL"]},{"name":"eventSourceType","value":[""]},{
+ * "name":"timeWindow","value":["1000"]},{"name":"ageLimit","value":["1000"]},{
+ * "name":"createClosedLoopEventId","value":["Initial"]},{"name":
+ * "outputEventName","value":["ONSET"]}],[{"name":"aaiMatchingFields","value":[
+ * "generic-vnf.vnf-name","vserver.vserver-name"]},{"name":"aaiSendFields",
+ * "value":["generic-vnf.vnf-name","vserver.vserver-name"]},{"name":
+ * "eventSeverity","value":["CRITICAL"]},{"name":"eventSourceType","value":[""]}
+ * ,{"name":"timeWindow","value":["3000"]},{"name":"ageLimit","value":["3000"]},
+ * {"name":"createClosedLoopEventId","value":["Initial"]},{"name":
+ * "outputEventName","value":["ABATED"]}]]}]}}
+ *
+ */
+public class ResourceGroup {
+
+    protected static final EELFLogger          logger      = EELFManager.getInstance().getLogger(ResourceGroup.class);
+    protected static final EELFLogger    auditLogger = EELFManager.getInstance().getAuditLogger();
+
+    private String                     groupNumber;
+    private String                     policyId;
+    private List<ServiceConfiguration> serviceConfigurations;
+
+    /**
+     * Parse String Match Resource Group given json node.
+     *
+     * @param modelBpmn
+     * @param modelJson
+     */
+    public ResourceGroup(JsonNode node) {
+
+        groupNumber = ModelElement.getValueByName(node, "rgname");
+        policyId = ModelElement.getValueByName(node, "policyId");
+
+        // process Server_Configurations
+        JsonNode serviceConfigurationsNode = node.get(node.size() - 1).get("serviceConfigurations");
+        Iterator<JsonNode> itr = serviceConfigurationsNode.elements();
+        serviceConfigurations = new ArrayList<ServiceConfiguration>();
+        while (itr.hasNext()) {
+            serviceConfigurations.add(new ServiceConfiguration(itr.next()));
+        }
+    }
+
+    /**
+     * @return the groupNumber
+     */
+    public String getGroupNumber() {
+        return groupNumber;
+    }
+
+    /**
+     * @return the policyId
+     */
+    public String getPolicyId() {
+        return policyId;
+    }
+
+    /**
+     * @return the serviceConfigurations
+     */
+    public List<ServiceConfiguration> getServiceConfigurations() {
+        return serviceConfigurations;
+    }
+
+}
diff --git a/src/main/java/org/onap/clamp/clds/util/LoggingUtils.java b/src/main/java/org/onap/clamp/clds/util/LoggingUtils.java
new file mode 100644 (file)
index 0000000..c474006
--- /dev/null
@@ -0,0 +1,124 @@
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP CLAMP\r
+ * ================================================================================\r
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights\r
+ *                             reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END============================================\r
+ * ===================================================================\r
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
+ */\r
+\r
+package org.onap.clamp.clds.util;\r
+\r
+import java.text.DateFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.Date;\r
+import java.util.TimeZone;\r
+import java.util.UUID;\r
+\r
+import org.jboss.logging.MDC;\r
+\r
+public class LoggingUtils {\r
+\r
+    /**\r
+     * Set request related logging variables in thread local data via MDC\r
+     * \r
+     * @param service\r
+     *            Service Name of API (ex. "PUT template")\r
+     * @param partner\r
+     *            Partner name (client or user invoking API)\r
+     */\r
+    public static void setRequestContext(String service, String partner) {\r
+        MDC.put("RequestId", "clds-" + UUID.randomUUID().toString());\r
+        MDC.put("ServiceName", service);\r
+        MDC.put("PartnerName", partner);\r
+    }\r
+\r
+    /**\r
+     * Set time related logging variables in thread local data via MDC\r
+     * \r
+     * @param beginTimeStamp\r
+     *            Start time\r
+     * @param endTimeStamp\r
+     *            End time\r
+     */\r
+    public static void setTimeContext(Date beginTimeStamp, Date endTimeStamp) {\r
+        String beginTime = "";\r
+        String endTime = "";\r
+        String elapsedTime = "";\r
+\r
+        if (beginTimeStamp != null && endTimeStamp != null) {\r
+            elapsedTime = String.valueOf(endTimeStamp.getTime() - beginTimeStamp.getTime());\r
+            beginTime = generateTimestampStr(beginTimeStamp);\r
+            endTime = generateTimestampStr(endTimeStamp);\r
+        }\r
+\r
+        MDC.put("BeginTimestamp", beginTime);\r
+        MDC.put("EndTimestamp", endTime);\r
+        MDC.put("ElapsedTime", elapsedTime);\r
+    }\r
+\r
+    /**\r
+     * Set response related logging variables in thread local data via MDC\r
+     * \r
+     * @param code\r
+     *            Response code ("0" indicates success)\r
+     * @param description\r
+     *            Response description\r
+     * @param className\r
+     *            class name of invoking class\r
+     */\r
+    public static void setResponseContext(String code, String description, String className) {\r
+        MDC.put("ResponseCode", code);\r
+        MDC.put("StatusCode", code.equals("0") ? "COMPLETE" : "ERROR");\r
+        MDC.put("ResponseDescription", description != null ? description : "");\r
+        MDC.put("ClassName", className != null ? className : "");\r
+    }\r
+\r
+    /**\r
+     * Set target related logging variables in thread local data via MDC\r
+     * \r
+     * @param targetEntity\r
+     *            Target entity (an external/sub component, for ex. "sdc")\r
+     * @param targetServiceName\r
+     *            Target service name (name of API invoked on target)\r
+     */\r
+    public static void setTargetContext(String targetEntity, String targetServiceName) {\r
+        MDC.put("TargetEntity", targetEntity != null ? targetEntity : "");\r
+        MDC.put("TargetServiceName", targetServiceName != null ? targetServiceName : "");\r
+    }\r
+\r
+    /**\r
+     * Set error related logging variables in thread local data via MDC\r
+     * \r
+     * @param code\r
+     *            Error code\r
+     * @param description\r
+     *            Error description\r
+     */\r
+    public static void setErrorContext(String code, String description) {\r
+        MDC.put("ErrorCode", code);\r
+        MDC.put("ErrorDescription", description != null ? description : "");\r
+    }\r
+\r
+    private static String generateTimestampStr(Date timeStamp) {\r
+        DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX");\r
+        TimeZone tz = TimeZone.getTimeZone("UTC");\r
+        df.setTimeZone(tz);\r
+        return df.format(timeStamp);\r
+    }\r
+\r
+}\r
diff --git a/src/main/resources/META-INF/resources/designer/images/Collectors.png b/src/main/resources/META-INF/resources/designer/images/Collectors.png
new file mode 100644 (file)
index 0000000..8b3cc1e
Binary files /dev/null and b/src/main/resources/META-INF/resources/designer/images/Collectors.png differ
diff --git a/src/main/resources/META-INF/resources/designer/invalid_login.html b/src/main/resources/META-INF/resources/designer/invalid_login.html
new file mode 100644 (file)
index 0000000..067452e
--- /dev/null
@@ -0,0 +1,45 @@
+<!--
+  ============LICENSE_START=======================================================
+  ONAP CLAMP
+  ================================================================================
+  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============================================
+  ===================================================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
+<style>
+.divRow {
+       margin-left: 5px;
+       font-size: 13px;
+       font-weight: normal;
+       margin-top:10px;
+}
+</style>
+
+<head>
+       <title>CLDS</title>
+</head>
+<div>
+       <div class="divRow"><b>Login Failed!</b></div>
+       <div class="divRow"><b>Please make sure your login and password are correct. 
+               If you don't have the login credential, please contact CLAMP administrator.</b></div>
+
+       <div class="divRow">To login again, please click <a href="/designer/index.html"/>Login</a></div>
+</div>
+
+
+
+
diff --git a/src/main/resources/META-INF/resources/designer/lib/angular-md5.js b/src/main/resources/META-INF/resources/designer/lib/angular-md5.js
new file mode 100644 (file)
index 0000000..7896bb4
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+  angular-md5 - v0.1.8 
+  2015-11-17
+*/
+
+/* commonjs package manager support (eg componentjs) */
+if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports) {
+  module.exports = "angular-md5";
+}
+(function(angular) {
+  angular.module("angular-md5", [ "gdi2290.md5" ]);
+  angular.module("ngMd5", [ "gdi2290.md5" ]);
+  angular.module("gdi2290.md5", [ "gdi2290.gravatar-filter", "gdi2290.md5-service", "gdi2290.md5-filter" ]);
+  "use strict";
+  angular.module("gdi2290.gravatar-filter", []).filter("gravatar", [ "md5", function(md5) {
+    var cache = {};
+    return function(text, defaultText) {
+      if (!cache[text]) {
+        defaultText = defaultText ? md5.createHash(defaultText.toString().toLowerCase()) : "";
+        cache[text] = text ? md5.createHash(text.toString().toLowerCase()) : defaultText;
+      }
+      return cache[text];
+    };
+  } ]);
+  "use strict";
+  angular.module("gdi2290.md5-filter", []).filter("md5", [ "md5", function(md5) {
+    return function(text) {
+      return text ? md5.createHash(text.toString().toLowerCase()) : text;
+    };
+  } ]);
+  "use strict";
+  angular.module("gdi2290.md5-service", []).factory("md5", [ function() {
+    var md5 = {
+      createHash: function(str) {
+        if (null === str) {
+          return null;
+        }
+        var xl;
+        var rotateLeft = function(lValue, iShiftBits) {
+          return lValue << iShiftBits | lValue >>> 32 - iShiftBits;
+        };
+        var addUnsigned = function(lX, lY) {
+          var lX4, lY4, lX8, lY8, lResult;
+          lX8 = lX & 2147483648;
+          lY8 = lY & 2147483648;
+          lX4 = lX & 1073741824;
+          lY4 = lY & 1073741824;
+          lResult = (lX & 1073741823) + (lY & 1073741823);
+          if (lX4 & lY4) {
+            return lResult ^ 2147483648 ^ lX8 ^ lY8;
+          }
+          if (lX4 | lY4) {
+            if (lResult & 1073741824) {
+              return lResult ^ 3221225472 ^ lX8 ^ lY8;
+            } else {
+              return lResult ^ 1073741824 ^ lX8 ^ lY8;
+            }
+          } else {
+            return lResult ^ lX8 ^ lY8;
+          }
+        };
+        var _F = function(x, y, z) {
+          return x & y | ~x & z;
+        };
+        var _G = function(x, y, z) {
+          return x & z | y & ~z;
+        };
+        var _H = function(x, y, z) {
+          return x ^ y ^ z;
+        };
+        var _I = function(x, y, z) {
+          return y ^ (x | ~z);
+        };
+        var _FF = function(a, b, c, d, x, s, ac) {
+          a = addUnsigned(a, addUnsigned(addUnsigned(_F(b, c, d), x), ac));
+          return addUnsigned(rotateLeft(a, s), b);
+        };
+        var _GG = function(a, b, c, d, x, s, ac) {
+          a = addUnsigned(a, addUnsigned(addUnsigned(_G(b, c, d), x), ac));
+          return addUnsigned(rotateLeft(a, s), b);
+        };
+        var _HH = function(a, b, c, d, x, s, ac) {
+          a = addUnsigned(a, addUnsigned(addUnsigned(_H(b, c, d), x), ac));
+          return addUnsigned(rotateLeft(a, s), b);
+        };
+        var _II = function(a, b, c, d, x, s, ac) {
+          a = addUnsigned(a, addUnsigned(addUnsigned(_I(b, c, d), x), ac));
+          return addUnsigned(rotateLeft(a, s), b);
+        };
+        var convertToWordArray = function(str) {
+          var lWordCount;
+          var lMessageLength = str.length;
+          var lNumberOfWords_temp1 = lMessageLength + 8;
+          var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - lNumberOfWords_temp1 % 64) / 64;
+          var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
+          var lWordArray = new Array(lNumberOfWords - 1);
+          var lBytePosition = 0;
+          var lByteCount = 0;
+          while (lByteCount < lMessageLength) {
+            lWordCount = (lByteCount - lByteCount % 4) / 4;
+            lBytePosition = lByteCount % 4 * 8;
+            lWordArray[lWordCount] = lWordArray[lWordCount] | str.charCodeAt(lByteCount) << lBytePosition;
+            lByteCount++;
+          }
+          lWordCount = (lByteCount - lByteCount % 4) / 4;
+          lBytePosition = lByteCount % 4 * 8;
+          lWordArray[lWordCount] = lWordArray[lWordCount] | 128 << lBytePosition;
+          lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
+          lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
+          return lWordArray;
+        };
+        var wordToHex = function(lValue) {
+          var wordToHexValue = "", wordToHexValue_temp = "", lByte, lCount;
+          for (lCount = 0; lCount <= 3; lCount++) {
+            lByte = lValue >>> lCount * 8 & 255;
+            wordToHexValue_temp = "0" + lByte.toString(16);
+            wordToHexValue = wordToHexValue + wordToHexValue_temp.substr(wordToHexValue_temp.length - 2, 2);
+          }
+          return wordToHexValue;
+        };
+        var x = [], k, AA, BB, CC, DD, a, b, c, d, S11 = 7, S12 = 12, S13 = 17, S14 = 22, S21 = 5, S22 = 9, S23 = 14, S24 = 20, S31 = 4, S32 = 11, S33 = 16, S34 = 23, S41 = 6, S42 = 10, S43 = 15, S44 = 21;
+        x = convertToWordArray(str);
+        a = 1732584193;
+        b = 4023233417;
+        c = 2562383102;
+        d = 271733878;
+        xl = x.length;
+        for (k = 0; k < xl; k += 16) {
+          AA = a;
+          BB = b;
+          CC = c;
+          DD = d;
+          a = _FF(a, b, c, d, x[k + 0], S11, 3614090360);
+          d = _FF(d, a, b, c, x[k + 1], S12, 3905402710);
+          c = _FF(c, d, a, b, x[k + 2], S13, 606105819);
+          b = _FF(b, c, d, a, x[k + 3], S14, 3250441966);
+          a = _FF(a, b, c, d, x[k + 4], S11, 4118548399);
+          d = _FF(d, a, b, c, x[k + 5], S12, 1200080426);
+          c = _FF(c, d, a, b, x[k + 6], S13, 2821735955);
+          b = _FF(b, c, d, a, x[k + 7], S14, 4249261313);
+          a = _FF(a, b, c, d, x[k + 8], S11, 1770035416);
+          d = _FF(d, a, b, c, x[k + 9], S12, 2336552879);
+          c = _FF(c, d, a, b, x[k + 10], S13, 4294925233);
+          b = _FF(b, c, d, a, x[k + 11], S14, 2304563134);
+          a = _FF(a, b, c, d, x[k + 12], S11, 1804603682);
+          d = _FF(d, a, b, c, x[k + 13], S12, 4254626195);
+          c = _FF(c, d, a, b, x[k + 14], S13, 2792965006);
+          b = _FF(b, c, d, a, x[k + 15], S14, 1236535329);
+          a = _GG(a, b, c, d, x[k + 1], S21, 4129170786);
+          d = _GG(d, a, b, c, x[k + 6], S22, 3225465664);
+          c = _GG(c, d, a, b, x[k + 11], S23, 643717713);
+          b = _GG(b, c, d, a, x[k + 0], S24, 3921069994);
+          a = _GG(a, b, c, d, x[k + 5], S21, 3593408605);
+          d = _GG(d, a, b, c, x[k + 10], S22, 38016083);
+          c = _GG(c, d, a, b, x[k + 15], S23, 3634488961);
+          b = _GG(b, c, d, a, x[k + 4], S24, 3889429448);
+          a = _GG(a, b, c, d, x[k + 9], S21, 568446438);
+          d = _GG(d, a, b, c, x[k + 14], S22, 3275163606);
+          c = _GG(c, d, a, b, x[k + 3], S23, 4107603335);
+          b = _GG(b, c, d, a, x[k + 8], S24, 1163531501);
+          a = _GG(a, b, c, d, x[k + 13], S21, 2850285829);
+          d = _GG(d, a, b, c, x[k + 2], S22, 4243563512);
+          c = _GG(c, d, a, b, x[k + 7], S23, 1735328473);
+          b = _GG(b, c, d, a, x[k + 12], S24, 2368359562);
+          a = _HH(a, b, c, d, x[k + 5], S31, 4294588738);
+          d = _HH(d, a, b, c, x[k + 8], S32, 2272392833);
+          c = _HH(c, d, a, b, x[k + 11], S33, 1839030562);
+          b = _HH(b, c, d, a, x[k + 14], S34, 4259657740);
+          a = _HH(a, b, c, d, x[k + 1], S31, 2763975236);
+          d = _HH(d, a, b, c, x[k + 4], S32, 1272893353);
+          c = _HH(c, d, a, b, x[k + 7], S33, 4139469664);
+          b = _HH(b, c, d, a, x[k + 10], S34, 3200236656);
+          a = _HH(a, b, c, d, x[k + 13], S31, 681279174);
+          d = _HH(d, a, b, c, x[k + 0], S32, 3936430074);
+          c = _HH(c, d, a, b, x[k + 3], S33, 3572445317);
+          b = _HH(b, c, d, a, x[k + 6], S34, 76029189);
+          a = _HH(a, b, c, d, x[k + 9], S31, 3654602809);
+          d = _HH(d, a, b, c, x[k + 12], S32, 3873151461);
+          c = _HH(c, d, a, b, x[k + 15], S33, 530742520);
+          b = _HH(b, c, d, a, x[k + 2], S34, 3299628645);
+          a = _II(a, b, c, d, x[k + 0], S41, 4096336452);
+          d = _II(d, a, b, c, x[k + 7], S42, 1126891415);
+          c = _II(c, d, a, b, x[k + 14], S43, 2878612391);
+          b = _II(b, c, d, a, x[k + 5], S44, 4237533241);
+          a = _II(a, b, c, d, x[k + 12], S41, 1700485571);
+          d = _II(d, a, b, c, x[k + 3], S42, 2399980690);
+          c = _II(c, d, a, b, x[k + 10], S43, 4293915773);
+          b = _II(b, c, d, a, x[k + 1], S44, 2240044497);
+          a = _II(a, b, c, d, x[k + 8], S41, 1873313359);
+          d = _II(d, a, b, c, x[k + 15], S42, 4264355552);
+          c = _II(c, d, a, b, x[k + 6], S43, 2734768916);
+          b = _II(b, c, d, a, x[k + 13], S44, 1309151649);
+          a = _II(a, b, c, d, x[k + 4], S41, 4149444226);
+          d = _II(d, a, b, c, x[k + 11], S42, 3174756917);
+          c = _II(c, d, a, b, x[k + 2], S43, 718787259);
+          b = _II(b, c, d, a, x[k + 9], S44, 3951481745);
+          a = addUnsigned(a, AA);
+          b = addUnsigned(b, BB);
+          c = addUnsigned(c, CC);
+          d = addUnsigned(d, DD);
+        }
+        var temp = wordToHex(a) + wordToHex(b) + wordToHex(c) + wordToHex(d);
+        return temp.toLowerCase();
+      }
+    };
+    return md5;
+  } ]);
+})(angular);
\ No newline at end of file
diff --git a/src/main/resources/META-INF/resources/designer/logout.html b/src/main/resources/META-INF/resources/designer/logout.html
new file mode 100644 (file)
index 0000000..fa1df32
--- /dev/null
@@ -0,0 +1,40 @@
+<!--
+  ============LICENSE_START=======================================================
+  ONAP CLAMP
+  ================================================================================
+  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============================================
+  ===================================================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
+<style>
+.divRow {
+       margin-left: 5px;
+       font-size: 13px;
+       font-weight: normal;
+       margin-top:10px;
+}
+</style>
+
+<head>
+       <title>CLDS</title>
+</head>
+<div ng-controller="AuthenticateCtrl" ng-init="logout()"> 
+       <div id='main'>
+               <div class="divRow"><b>You have been Logged Out successfully!</b></div>
+               <div class="divRow">To login again, please click <a href="/designer/index.html"/>Login</a></div>
+       </div>
+</div>
diff --git a/src/main/resources/META-INF/resources/designer/menu_simplified.html b/src/main/resources/META-INF/resources/designer/menu_simplified.html
new file mode 100644 (file)
index 0000000..0bee160
--- /dev/null
@@ -0,0 +1,54 @@
+<!--
+  ============LICENSE_START=======================================================
+  ONAP CLAMP
+  ================================================================================
+  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============================================
+  ===================================================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
+
+<style>
+.navbar-custom {
+       background-color: #229922;
+       color: #ffffff;
+       border-radius: 0;
+}
+
+.logo {
+       font-family: 'Trebuchet MS', cursive;
+       font-size: 20px;
+       font-weight: 500;
+       text-align: center;
+}
+</style>
+
+<nav attribute-test="menu" class="navbar navbar-default navbar-fixed-top" role="navigation"
+       style="margin-left: 2px; margin-right: 2px;">
+
+       <div attribute-test="menuc" class="container-fluid">
+
+               <div class="col-md-4 col-lg-4">
+                       <img class="onap_logo" src="images/logo_onap_2017.png" height="50px"
+                               width="234px" style="display: inline-block; float: left">
+                       <div class="navbar-brand logo" ng-href=""
+                               style="display: inline-block; float: left">
+                               &nbsp;&nbsp;<b>Closed Loop Definition</b>
+                       </div>
+               </div>
+
+       </div>
+</nav>
diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/extra_user_info.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/extra_user_info.html
new file mode 100644 (file)
index 0000000..7fc0431
--- /dev/null
@@ -0,0 +1,49 @@
+<!--
+  ============LICENSE_START=======================================================
+  ONAP CLAMP
+  ================================================================================
+  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============================================
+  ===================================================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
+
+<div attribute-test="extrauserinfo" id="configure-widgets">
+    <div attribute-test="extrauserinfoh" class="modal-header">
+        <button type="button" class="close" ng-click="close(false)" aria-hidden="true" style="margin-top: -3px">&times;</button>
+        <h4>User Info</h4>
+    </div>
+    <div attribute-test="extrauserinfot" class="modal-body" style="text-align:center;">
+        <div>
+               <b style="font-size:14px;">Current User</b>: {{userInfo["userName"]}}
+        </div>
+        <div>
+               <b style="font-size:14px;">CLDS Version</b>: {{userInfo["cldsVersion"]}}
+        </div>
+        <br>
+        <div>
+               <b style="font-size:14px;">User Permissions:</b>
+               <div ng-if="userInfo['permissionReadTemplate']">Read Template</div>
+               <div ng-if="userInfo['permissionUpdateTemplate']">Edit Template</div>
+               <div ng-if="userInfo['permissionReadCl']">Read Model</div>
+               <div ng-if="userInfo['permissionUpdateCl']">Edit Model</div>
+        </div>
+    </div>
+    <div attribute-test="extrauserinfof" class="modal-footer">
+        <!-- <button ng-click="Ok()" class="btn btn-primary">Save Changes</button> -->
+        <button ng-click="close(true)" class="btn btn-primary">Close</button>
+    </div>
+</div>
\ No newline at end of file
diff --git a/src/main/resources/META-INF/resources/designer/please_wait.html b/src/main/resources/META-INF/resources/designer/please_wait.html
new file mode 100644 (file)
index 0000000..8068e4c
--- /dev/null
@@ -0,0 +1,28 @@
+<!--
+  ============LICENSE_START=======================================================
+  ONAP CLAMP
+  ================================================================================
+  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============================================
+  ===================================================================
+  ECOMP is a trademark and service mark of AT&T Intellectual Property.
+  -->
+
+
+<div attribute-test="pleasewait">
+       <h1>Please Wait.....{{urlparam}}</h1>
+
+</div>
diff --git a/src/main/resources/META-INF/resources/designer/scripts/ExtraUserInfoCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/ExtraUserInfoCtrl.js
new file mode 100644 (file)
index 0000000..f269b41
--- /dev/null
@@ -0,0 +1,37 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * 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============================================
+ * ===================================================================
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+
+app.controller('ExtraUserInfoCtrl', 
+               ['$scope', '$rootScope', '$modalInstance','extraUserInfoService', '$location', 'dialogs',
+                function($scope, $rootScope, $modalInstance, extraUserInfoService, $location, dialogs) {
+       //console.log("///////////ExtraUserInfoCtrl");
+       
+       extraUserInfoService.getUserInfo().then(function(pars){ 
+               $scope.userInfo = pars;
+       });
+       
+        $scope.close = function() {
+            $modalInstance.close("closed");
+        };
+    }
+]);
\ No newline at end of file
diff --git a/src/main/resources/META-INF/resources/designer/scripts/ExtraUserInfoService.js b/src/main/resources/META-INF/resources/designer/scripts/ExtraUserInfoService.js
new file mode 100644 (file)
index 0000000..25dc37b
--- /dev/null
@@ -0,0 +1,41 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP CLAMP
+ * ================================================================================
+ * 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============================================
+ * ===================================================================
+ * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ */
+app.service('extraUserInfoService', ['$http', '$q', function($http, $q){
+       //console.log("///////////extraUserInfoService");
+       
+       this.getUserInfo = function(){
+               var def = $q.defer();
+               
+               var svcUrl = "/restservices/clds/v1/clds/cldsInfo";
+               
+               $http.get(svcUrl)
+               .success(function(data){
+                       def.resolve(data);
+               })
+               .error(function(data){
+                       def.reject("Retrieving User Info unsuccessful");
+               });
+               
+               return def.promise;
+       };
+}]);
\ No newline at end of file
diff --git a/src/main/resources/policyLogger.properties b/src/main/resources/policyLogger.properties
new file mode 100644 (file)
index 0000000..2f1358b
--- /dev/null
@@ -0,0 +1,47 @@
+###
+# ============LICENSE_START=======================================================
+# ONAP CLAMP
+# ================================================================================
+# 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============================================
+# ===================================================================
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+###
+
+################################### Set concurrentHashMap and timer info  #######################
+#Timer initial delay and the delay between in milliseconds before task is to be execute.
+timer.delay.time=1000
+#Timer scheduleAtFixedRate period - time in milliseconds between successive task executions.
+check.interval= 30000
+#Longest time an event info can be stored in the concurrentHashMap for logging - in seconds. 
+event.expired.time=86400
+#Size of the concurrentHashMap which stores the event starting time, etc - when its size reaches this limit, the Timer gets executed 
+#to remove all expired records from this concurrentHashMap.
+concurrentHashMap.limit=5000
+#Size of the concurrentHashMap - when its size drops to this point, stop the Timer
+stop.check.point=2500
+################################### Set logging format #############################################
+# set EELF for EELF logging format, set LOG4J for using log4j, set SYSTEMOUT for using system.out.println
+logger.type=EELF
+#################################### Set level for EELF or SYSTEMOUT logging ##################################
+# Set level for debug file. Set DEBUG to enable .info, .warn and .debug; set INFO for enable .info and .warn; set OFF to disable all 
+debugLogger.level=INFO
+# Set level for metrics file. Set OFF to disable; set ON to enable
+metricsLogger.level=ON
+# Set level for error file. Set OFF to disable; set ON to enable
+error.level=ON
+# Set level for audit file. Set OFF to disable; set ON to enable
+audit.level=ON
\ No newline at end of file