Merge "fix sonar blocker try-with-resources"
[so.git] / asdc-controller / src / main / java / org / onap / so / asdc / util / ASDCNotificationLogging.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.asdc.util;
22
23
24 import java.util.List;
25 import java.util.Map;
26
27 import org.onap.sdc.api.notification.IArtifactInfo;
28 import org.onap.sdc.api.notification.INotificationData;
29 import org.onap.sdc.api.notification.IResourceInstance;
30 import org.onap.sdc.tosca.parser.api.ISdcCsarHelper;
31 import org.onap.sdc.tosca.parser.enums.SdcTypes;
32 import org.onap.sdc.tosca.parser.impl.SdcPropertyNames;
33 import org.onap.sdc.toscaparser.api.Group;
34 import org.onap.sdc.toscaparser.api.NodeTemplate;
35 import org.onap.sdc.toscaparser.api.elements.Metadata;
36 import org.onap.so.asdc.installer.IVfModuleData;
37 import org.onap.so.asdc.installer.ToscaResourceStructure;
38 import org.onap.so.db.catalog.beans.NetworkResourceCustomization;
39
40 public class ASDCNotificationLogging {
41
42         public static String dumpASDCNotification(INotificationData asdcNotification) {
43
44                 if (asdcNotification == null) {
45                         return "NULL";
46                 }
47         return "ASDC Notification:" + System.lineSeparator() +
48             "DistributionID:" + testNull(asdcNotification.getDistributionID()) + System.lineSeparator() +
49             "ServiceName:" + testNull(asdcNotification.getServiceName()) + System.lineSeparator() +
50             "ServiceVersion:" + testNull(asdcNotification.getServiceVersion()) + System.lineSeparator() +
51             "ServiceUUID:" + testNull(asdcNotification.getServiceUUID()) + System.lineSeparator() +
52             "ServiceInvariantUUID:" + testNull(asdcNotification.getServiceInvariantUUID()) + System.lineSeparator() +
53             "ServiceDescription:" + testNull(asdcNotification.getServiceDescription()) + System.lineSeparator() +
54             "Service Artifacts List:" + System.lineSeparator() + testNull(dumpArtifactInfoList(asdcNotification.getServiceArtifacts())) + System.lineSeparator() +
55             "Resource Instances List:" + System.lineSeparator() + testNull(dumpASDCResourcesList(asdcNotification)) + System.lineSeparator();
56         }
57
58         public static String dumpCSARNotification(INotificationData asdcNotification, ToscaResourceStructure toscaResourceStructure) {
59                 
60                 if (asdcNotification == null) {
61                         return "NULL";
62                 }
63                 
64
65                 StringBuilder buffer = new StringBuilder("CSAR Notification:");
66                 buffer.append(System.lineSeparator());
67                 buffer.append(System.lineSeparator());
68                 
69                 
70                 ISdcCsarHelper csarHelper = toscaResourceStructure.getSdcCsarHelper();
71
72         
73                 buffer.append("Service Level Properties:");
74                 buffer.append(System.lineSeparator());
75                 buffer.append("Name:");
76                 buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
77                 buffer.append(System.lineSeparator());
78                 buffer.append("Description:");
79                 buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
80                 buffer.append(System.lineSeparator());
81                 buffer.append("Model UUID:");
82                 buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
83                 buffer.append(System.lineSeparator());
84                 buffer.append("Model Version:");
85                 buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
86                 buffer.append(System.lineSeparator());
87                 buffer.append("Model InvariantUuid:");
88                 buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
89                 buffer.append(System.lineSeparator());
90                 buffer.append("Service Type:");
91                 buffer.append(csarHelper.getServiceMetadata().getValue("serviceType"));
92                 buffer.append(System.lineSeparator());
93                 buffer.append("Service Role:");
94                 buffer.append(csarHelper.getServiceMetadata().getValue("serviceRole"));
95                 buffer.append(System.lineSeparator());
96                 buffer.append("WorkLoad Context:");
97                 buffer.append(asdcNotification.getWorkloadContext());
98                 buffer.append(System.lineSeparator());
99                 buffer.append("Environment Context:");
100                 buffer.append(csarHelper.getServiceMetadata().getValue("environmentContext"));
101                 buffer.append(System.lineSeparator());
102                 
103                 
104                 List<NodeTemplate> serviceProxyResourceList = toscaResourceStructure.getSdcCsarHelper().getServiceNodeTemplateBySdcType(SdcTypes.SERVICE_PROXY);
105                 
106                 if(serviceProxyResourceList != null){
107                         
108                 for (NodeTemplate serviceProxyNodeTemplate :  serviceProxyResourceList) {
109                         
110                         buffer.append(System.lineSeparator());
111                         buffer.append(System.lineSeparator());
112                         buffer.append("Service Proxy Properties:");
113                         buffer.append(System.lineSeparator());
114                         buffer.append("Model Name:");
115                 buffer.append(serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
116                 buffer.append(System.lineSeparator());
117                 buffer.append("Model UUID:");
118                 buffer.append(serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));            
119                 buffer.append(System.lineSeparator());
120                 buffer.append("Description:");
121                 buffer.append(serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
122                 buffer.append(System.lineSeparator());
123                 buffer.append("Version:");
124                 buffer.append(serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
125                 buffer.append(System.lineSeparator());
126                 buffer.append("InvariantUuid:");
127                 buffer.append(serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
128                 buffer.append(System.lineSeparator());
129                 
130                 buffer.append(System.lineSeparator());
131                 buffer.append(System.lineSeparator());
132                 buffer.append("Service Proxy Customization Properties:");
133                 buffer.append(System.lineSeparator());
134                 
135                 buffer.append("Model Customization UUID:");
136                 buffer.append(serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
137                 buffer.append(System.lineSeparator());
138                 buffer.append("Model Instance Name:");
139                 buffer.append(serviceProxyNodeTemplate.getName());              
140                 buffer.append(System.lineSeparator());
141                 buffer.append("Tosca Node Type:");
142                 buffer.append(serviceProxyNodeTemplate.getType());
143                 buffer.append(System.lineSeparator());
144                 buffer.append("Version:");
145                 buffer.append(serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
146                 buffer.append(System.lineSeparator());
147                 buffer.append("InvariantUuid:");
148                 buffer.append(serviceProxyNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
149                 buffer.append(System.lineSeparator());
150                         
151                 }
152                 }
153                 
154                 List<NodeTemplate> configurationNodeTemplatesList = toscaResourceStructure.getSdcCsarHelper().getServiceNodeTemplateBySdcType(SdcTypes.CONFIGURATION);
155                 
156                 if(configurationNodeTemplatesList != null){
157                 for (NodeTemplate configNodeTemplate :  configurationNodeTemplatesList) {
158                         
159                         buffer.append(System.lineSeparator());
160                         buffer.append(System.lineSeparator());
161                         buffer.append("Configuration Properties:");
162                         buffer.append(System.lineSeparator());
163                         
164                         buffer.append("Model Name:");
165                 buffer.append(configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
166                 buffer.append(System.lineSeparator());
167                 buffer.append("Model UUID:");
168                 buffer.append(configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));          
169                 buffer.append(System.lineSeparator());
170                 buffer.append("Description:");
171                 buffer.append(configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
172                 buffer.append(System.lineSeparator());
173                 buffer.append("Version:");
174                 buffer.append(configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
175                 buffer.append(System.lineSeparator());
176                 buffer.append("InvariantUuid:");
177                 buffer.append(configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
178                 buffer.append(System.lineSeparator());
179                 buffer.append("Tosca Node Type:");
180                 buffer.append(configNodeTemplate.getType());
181                 
182                 buffer.append(System.lineSeparator());
183                 buffer.append(System.lineSeparator());
184                 buffer.append("Configuration Customization Properties:");
185                 buffer.append(System.lineSeparator());
186                 
187                 buffer.append("Model Customization UUID:");
188                 buffer.append(configNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
189                 buffer.append(System.lineSeparator());
190                 buffer.append("Model Instance Name:");
191                 buffer.append(configNodeTemplate.getName());            
192                 buffer.append(System.lineSeparator());
193                 buffer.append("NFFunction:");
194                 buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(configNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
195                 buffer.append(System.lineSeparator());
196                 buffer.append("NFRole:");
197                 buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(configNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE));
198                 buffer.append(System.lineSeparator());
199                 buffer.append("NFType:");
200                 buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(configNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
201                 buffer.append(System.lineSeparator());
202                         
203                 }
204                 }
205                 
206         List<NodeTemplate> vfNodeTemplatesList = toscaResourceStructure.getSdcCsarHelper().getServiceVfList();
207         for (NodeTemplate vfNodeTemplate :  vfNodeTemplatesList) {
208                   
209                 buffer.append(System.lineSeparator());
210                 buffer.append(System.lineSeparator());
211                 buffer.append("VNF Properties:");
212                 buffer.append(System.lineSeparator());          
213                 buffer.append("Model Name:");
214                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
215                 buffer.append(System.lineSeparator());
216                 buffer.append("Model UUID:");
217                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
218                 buffer.append(System.lineSeparator());
219                 buffer.append("Description:");
220                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
221                 buffer.append(System.lineSeparator());
222                 buffer.append("Version:");
223                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
224                 buffer.append(System.lineSeparator());
225                 buffer.append("Type:");
226                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)));
227                 buffer.append(System.lineSeparator());
228                 buffer.append("Category:");
229                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY)));
230                 buffer.append(System.lineSeparator());
231                 buffer.append("InvariantUuid:");
232                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
233                 buffer.append(System.lineSeparator());
234                 buffer.append("Max Instances:");
235                 buffer.append(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES));
236                 buffer.append(System.lineSeparator());
237                 buffer.append("Min Instances:");
238                 buffer.append(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES));
239                 buffer.append(System.lineSeparator());
240                 
241                 buffer.append(System.lineSeparator());
242                 buffer.append("VNF Customization Properties:");
243                 buffer.append(System.lineSeparator());
244                 
245                 buffer.append("Customization UUID:");
246                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
247                 buffer.append(System.lineSeparator());
248                 buffer.append("NFFunction:");
249                 buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vfNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
250                 buffer.append(System.lineSeparator());
251                 buffer.append("NFCode:");
252                 buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vfNodeTemplate, "nf_naming_code"));
253                 buffer.append(System.lineSeparator());
254                 buffer.append("NFRole:");
255                 buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vfNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE));
256                 buffer.append(System.lineSeparator());
257                 buffer.append("NFType:");
258                 buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vfNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
259                 buffer.append(System.lineSeparator());
260                 buffer.append("MultiStageDesign:");
261                 buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vfNodeTemplate, "multi_stage_design"));
262                 buffer.append(System.lineSeparator());
263                                 
264                 List<Group> groupList = toscaResourceStructure.getSdcCsarHelper().getGroupsOfOriginOfNodeTemplateByToscaGroupType(vfNodeTemplate, "org.openecomp.groups.VfcInstanceGroup");
265                 
266                 if(groupList != null){
267                         for (Group group : groupList) {         
268                                 Metadata instanceMetadata = group.getMetadata();
269                                 
270                                 buffer.append(System.lineSeparator());
271                         buffer.append(System.lineSeparator());
272                         buffer.append("VNFC Instance Group Properties:");
273                         buffer.append(System.lineSeparator());
274                                         
275                                 buffer.append("Model Name:");
276                         buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
277                         buffer.append(System.lineSeparator());
278                         buffer.append("Version:");
279                         buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
280                         buffer.append(System.lineSeparator());
281                         buffer.append("Type:");
282                         buffer.append(vfNodeTemplate.getType());
283                         buffer.append(System.lineSeparator());
284                         buffer.append("InvariantUuid:");
285                         buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
286                         buffer.append(System.lineSeparator());                          
287                         }
288                         
289                 }
290                 
291                 
292                 List<Group> vfGroups = toscaResourceStructure.getSdcCsarHelper().getVfModulesByVf(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
293                 
294                 for(Group group : vfGroups){
295                         
296                         Metadata vfMetadata = group.getMetadata();
297                         
298                         buffer.append(System.lineSeparator());
299                         buffer.append(System.lineSeparator());
300                         buffer.append("VF Module Properties:");
301                         buffer.append(System.lineSeparator());
302                         buffer.append("ModelInvariantUuid:");
303                         buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)));
304                         buffer.append(System.lineSeparator());
305                         buffer.append("ModelName:");
306                         buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELNAME)));
307                         buffer.append(System.lineSeparator()); 
308                         buffer.append("ModelUuid:");
309                         buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)));
310                         buffer.append(System.lineSeparator());
311                         buffer.append("ModelVersion:");
312                         buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)));
313                         buffer.append(System.lineSeparator()); 
314                         buffer.append("Description:");
315                         buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
316                         buffer.append(System.lineSeparator());
317                         
318                         List<NodeTemplate> groupMembers = toscaResourceStructure.getSdcCsarHelper().getMembersOfVfModule(vfNodeTemplate, group); 
319                         
320                         for(NodeTemplate node : groupMembers){  
321                         buffer.append("Member Name:");
322                         buffer.append(testNull(node.getName()));
323                         buffer.append(System.lineSeparator());
324                         }
325                         
326                         
327                 }
328                 
329                 List<NodeTemplate> cvfcList = toscaResourceStructure.getSdcCsarHelper().getNodeTemplateBySdcType(vfNodeTemplate, SdcTypes.CVFC);
330                 
331                 for(NodeTemplate cvfcTemplate : cvfcList) {
332                         
333                         buffer.append(System.lineSeparator());
334                         buffer.append(System.lineSeparator());
335                         buffer.append("CVNFC Properties:");
336                         buffer.append(System.lineSeparator());
337                         buffer.append("ModelCustomizationUuid:");
338                         buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
339                         buffer.append(System.lineSeparator());
340                         buffer.append("ModelInvariantUuid:");
341                         buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
342                         buffer.append(System.lineSeparator());
343                         buffer.append("ModelName:");
344                         buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
345                         buffer.append(System.lineSeparator()); 
346                         buffer.append("ModelUuid:");
347                         buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
348                         buffer.append(System.lineSeparator());
349                         buffer.append("ModelVersion:");
350                         buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
351                         buffer.append(System.lineSeparator()); 
352                         buffer.append("Description:");
353                         buffer.append(testNull(cvfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
354                         buffer.append(System.lineSeparator()); 
355                         buffer.append("Template Name:");
356                         buffer.append(testNull(cvfcTemplate.getName()));
357                         buffer.append(System.lineSeparator()); 
358                         
359                         
360                         List<NodeTemplate> vfcList = toscaResourceStructure.getSdcCsarHelper().getNodeTemplateBySdcType(cvfcTemplate, SdcTypes.VFC);
361                         
362                         for(NodeTemplate vfcTemplate : vfcList) {
363                                 buffer.append(System.lineSeparator());
364                         buffer.append(System.lineSeparator());
365                         buffer.append("VNFC Properties:");
366                         buffer.append(System.lineSeparator());
367                         buffer.append("ModelCustomizationUuid:");
368                         buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
369                         buffer.append(System.lineSeparator());
370                                 buffer.append("ModelInvariantUuid:");
371                         buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
372                         buffer.append(System.lineSeparator());
373                         buffer.append("ModelName:");
374                         buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
375                         buffer.append(System.lineSeparator()); 
376                         buffer.append("ModelUuid:");
377                         buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
378                         buffer.append(System.lineSeparator());
379                         buffer.append("ModelVersion:");
380                         buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
381                         buffer.append(System.lineSeparator()); 
382                         buffer.append("Description:");
383                         buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
384                         buffer.append(System.lineSeparator()); 
385                         buffer.append("Sub Category:");
386                         buffer.append(testNull(vfcTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY)));
387                         buffer.append(System.lineSeparator());
388                                 
389                         }               
390                         
391                 }
392                 
393         }               
394                         
395         
396                 
397                 List<NodeTemplate> nodeTemplatesVLList = toscaResourceStructure.getSdcCsarHelper().getServiceVlList();
398                                         
399         if(nodeTemplatesVLList != null){
400                                 
401                 for(NodeTemplate vlNode : nodeTemplatesVLList){
402                         
403                         buffer.append(System.lineSeparator());
404                         buffer.append(System.lineSeparator());
405                         buffer.append("NETWORK Level Properties:");
406                         buffer.append(System.lineSeparator());
407                         buffer.append("Model Name:");
408                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
409                         buffer.append(System.lineSeparator()); 
410                         buffer.append("Model InvariantUuid:");
411                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
412                         buffer.append(System.lineSeparator());   
413                         buffer.append("Model UUID:");
414                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
415                         buffer.append(System.lineSeparator()); 
416                         buffer.append("Model Version:");
417                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
418                         buffer.append(System.lineSeparator());   
419                         buffer.append("AIC Max Version:");
420                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)));
421                         buffer.append(System.lineSeparator()); 
422                         buffer.append("AIC Min Version:");
423                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES)));
424                         buffer.append(System.lineSeparator());  
425                         buffer.append("Tosca Node Type:");
426                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)));
427                         buffer.append(System.lineSeparator());  
428                         buffer.append("Description:");
429                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
430                         buffer.append(System.lineSeparator()); 
431  
432                         
433                         buffer.append(System.lineSeparator());
434                         buffer.append("NETWORK Customization Properties:");
435                         buffer.append(System.lineSeparator());
436                         buffer.append("CustomizationUUID:");
437                         buffer.append(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
438                         buffer.append(System.lineSeparator()); 
439                         buffer.append("Network Technology:");
440                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vlNode, SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY));
441                         buffer.append(System.lineSeparator()); 
442                         buffer.append("Network Type:");
443                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vlNode, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE));
444                         buffer.append(System.lineSeparator()); 
445                         buffer.append("Network Role:");
446                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vlNode, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE));
447                         buffer.append(System.lineSeparator()); 
448                         buffer.append("Network Scope:");
449                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(vlNode, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE));
450                         buffer.append(System.lineSeparator());                          
451                 
452                 }
453                         
454         }
455         
456                 
457         List<NodeTemplate> networkCollectionList = toscaResourceStructure.getSdcCsarHelper().getServiceNodeTemplateBySdcType(SdcTypes.CR);
458                 
459                 if (networkCollectionList != null) {
460                         for (NodeTemplate crNode : networkCollectionList) {     
461                                 buffer.append(System.lineSeparator());
462                                 buffer.append("Network Collection Properties:");
463                                 buffer.append(System.lineSeparator());
464                                 buffer.append("Model Name:");
465                         buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
466                         buffer.append(System.lineSeparator());
467                         buffer.append("Model UUID:");
468                         buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));              
469                         buffer.append(System.lineSeparator());
470                         buffer.append("InvariantUuid:");
471                         buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
472                         buffer.append(System.lineSeparator());
473                         buffer.append("Description:");
474                         buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
475                         buffer.append(System.lineSeparator());
476                         buffer.append("Version:");
477                         buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));   
478                         buffer.append(System.lineSeparator());
479                         buffer.append("Tosca Node Type:");
480                         buffer.append(crNode.getType());
481                         buffer.append(System.lineSeparator());
482                         buffer.append("CR Function:");
483                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(crNode, "cr_function"));       
484                         buffer.append(System.lineSeparator());
485                         buffer.append("CR Role:");
486                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(crNode, "cr_role"));   
487                         buffer.append(System.lineSeparator());
488                         buffer.append("CR Type:");
489                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(crNode, "cr_type"));   
490                         buffer.append(System.lineSeparator());
491                         
492                         List<NodeTemplate> vlNodeList = toscaResourceStructure.getSdcCsarHelper().getNodeTemplateBySdcType(crNode, SdcTypes.VL);
493                                                 
494                         for(NodeTemplate vlNodeTemplate : vlNodeList){
495                                 
496                                 Metadata vlMetadata = vlNodeTemplate.getMetaData();
497                                 
498                                 buffer.append(System.lineSeparator());
499                                 buffer.append(System.lineSeparator());
500                                 buffer.append("Network CR VL Properties:");
501                                 buffer.append(System.lineSeparator());
502                                 
503                                 buffer.append("Model Name:");
504                         buffer.append(vlMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
505                         buffer.append(System.lineSeparator());
506                         buffer.append("Model UUID:");
507                         buffer.append(vlMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));                
508                         buffer.append(System.lineSeparator());
509                         buffer.append("InvariantUuid:");
510                         buffer.append(vlMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
511                         buffer.append(System.lineSeparator());
512                         buffer.append("Version:");
513                         buffer.append(vlMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));     
514                         buffer.append(System.lineSeparator());
515                         buffer.append("AIC Max Version:");
516                         buffer.append(vlMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES));
517                         buffer.append(System.lineSeparator());
518                         buffer.append("Description:");
519                         buffer.append(vlMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); 
520                         buffer.append(System.lineSeparator());
521                         buffer.append("Tosca Node Type:");
522                         buffer.append(vlNodeTemplate.getType());            
523                         buffer.append(System.lineSeparator());  
524                                 
525                         }
526                         
527                         List<Group> groupList = toscaResourceStructure.getSdcCsarHelper().getGroupsOfOriginOfNodeTemplateByToscaGroupType(crNode, "org.openecomp.groups.NetworkCollection");    
528                         
529                         if(groupList != null){
530                                 for (Group group : groupList) { 
531                                         Metadata instanceMetadata = group.getMetadata();
532                                         buffer.append(System.lineSeparator());
533                                         buffer.append(System.lineSeparator());
534                                         buffer.append("Network Instance Group Properties:");
535                                         buffer.append(System.lineSeparator());
536                                         
537                                         buffer.append("Model Name:");
538                                 buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
539                                 buffer.append(System.lineSeparator());
540                                 buffer.append("Model UUID:");
541                                 buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));          
542                                 buffer.append(System.lineSeparator());
543                                 buffer.append("InvariantUuid:");
544                                 buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
545                                 buffer.append(System.lineSeparator());
546                                 buffer.append("Version:");
547                                 buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));       
548                                 buffer.append(System.lineSeparator());  
549                                 }
550                         
551                         }
552                         
553                                 buffer.append(System.lineSeparator());
554                                 buffer.append("Network Collection Customization Properties:");
555                                 buffer.append(System.lineSeparator());
556                                 
557                         buffer.append("Model Customization UUID:");
558                         buffer.append(crNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
559                         buffer.append(System.lineSeparator());
560                         buffer.append("Model Instance Name:");
561                         buffer.append(crNode.getName());                
562                         buffer.append(System.lineSeparator());
563                         buffer.append("Network Scope:");
564                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(crNode, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE));
565                         buffer.append(System.lineSeparator());
566                         buffer.append("Network Role:");
567                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(crNode, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE));
568                         buffer.append(System.lineSeparator());
569                         buffer.append("Network Type:");
570                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(crNode, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE));
571                         buffer.append(System.lineSeparator());
572                         buffer.append("Network Technology:");
573                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(crNode, SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY));
574                         buffer.append(System.lineSeparator());
575         
576                         }
577                 }
578         
579         List<NodeTemplate> allottedResourceList = toscaResourceStructure.getSdcCsarHelper().getAllottedResources();
580         
581                 if(allottedResourceList != null){
582                         
583                         buffer.append(System.lineSeparator());
584                         buffer.append("Allotted Resource Properties:");
585                         buffer.append(System.lineSeparator());
586                 
587                         for(NodeTemplate allottedNode : allottedResourceList){
588                                 
589                                 buffer.append("Model Name:");
590                                 buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
591                                 buffer.append(System.lineSeparator());
592                                 buffer.append("Model Name:");
593                                 buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
594                                 buffer.append(System.lineSeparator()); 
595                                 buffer.append("Model InvariantUuid:");
596                                 buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
597                                 buffer.append(System.lineSeparator());  
598                                 buffer.append("Model Version:");
599                                 buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
600                                 buffer.append(System.lineSeparator()); 
601                                 buffer.append("Model UUID:");
602                                 buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
603                                 buffer.append(System.lineSeparator());
604                                 buffer.append("Model Subcategory:");
605                                 buffer.append(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY));
606                                         buffer.append(System.lineSeparator());
607                                         buffer.append("Model Description:");
608                                         buffer.append(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
609                                         buffer.append(System.lineSeparator());
610                                 
611                                 
612                                 buffer.append("Allotted Resource Customization Properties:");
613                                 buffer.append(System.lineSeparator());
614                         
615                                 buffer.append("Model Cutomization UUID:");
616                                 buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
617                         buffer.append(System.lineSeparator());
618                         buffer.append("NFFunction:");
619                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(allottedNode, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
620                         buffer.append(System.lineSeparator());
621                         buffer.append("NFCode:");
622                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(allottedNode, "nf_naming_code"));
623                         buffer.append(System.lineSeparator());
624                         buffer.append("NFRole:");
625                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(allottedNode, SdcPropertyNames.PROPERTY_NAME_NFROLE));
626                         buffer.append(System.lineSeparator());
627                         buffer.append("NFType:");
628                         buffer.append(toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(allottedNode, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
629                         buffer.append(System.lineSeparator());      
630                                 
631                                 
632                         }
633                 }
634                 
635                 
636                 return buffer.toString();
637         }
638         
639         public static String dumpVfModuleMetaDataList(List<IVfModuleData> moduleMetaDataList) {
640                 if (moduleMetaDataList == null ) {
641                         return null;
642                 }
643
644                 StringBuilder buffer = new StringBuilder("VfModuleMetaData List:");
645                 buffer.append(System.lineSeparator());
646
647                 buffer.append("{");
648
649                 for (IVfModuleData moduleMetaData:moduleMetaDataList) {
650                         buffer.append(System.lineSeparator());
651                         buffer.append(testNull(dumpVfModuleMetaData(moduleMetaData)));
652                         buffer.append(System.lineSeparator());
653                         buffer.append(",");
654
655                 }
656                 buffer.replace(buffer.length()-1,buffer.length(), System.lineSeparator());
657                 buffer.append("}");
658                 buffer.append(System.lineSeparator());
659
660                 return buffer.toString();
661         }
662
663         private static String dumpVfModuleMetaData(IVfModuleData moduleMetaData) {
664
665                 if (moduleMetaData == null ) {
666                         return "NULL";
667                 }
668
669                 StringBuilder stringBuilder = new StringBuilder("VfModuleMetaData:");
670                 stringBuilder.append(System.lineSeparator());
671
672                 stringBuilder.append("VfModuleModelName:");
673                 stringBuilder.append(testNull(moduleMetaData.getVfModuleModelName()));
674                 stringBuilder.append(System.lineSeparator());
675
676                 stringBuilder.append("VfModuleModelVersion:");
677                 stringBuilder.append(testNull(moduleMetaData.getVfModuleModelVersion()));
678                 stringBuilder.append(System.lineSeparator());
679
680                 stringBuilder.append("VfModuleModelUUID:");
681                 stringBuilder.append(testNull(moduleMetaData.getVfModuleModelUUID()));
682                 stringBuilder.append(System.lineSeparator());
683
684                 stringBuilder.append("VfModuleModelInvariantUUID:");
685                 stringBuilder.append(testNull(moduleMetaData.getVfModuleModelInvariantUUID()));
686                 stringBuilder.append(System.lineSeparator());
687
688                 stringBuilder.append("VfModuleModelDescription:");
689                 stringBuilder.append(testNull(moduleMetaData.getVfModuleModelDescription()));
690                 stringBuilder.append(System.lineSeparator());
691
692                 stringBuilder.append("Artifacts UUID List:");
693
694                 if (moduleMetaData.getArtifacts() != null) {
695                         stringBuilder.append("{");
696
697                         for (String artifactUUID:moduleMetaData.getArtifacts()) {
698                                 stringBuilder.append(System.lineSeparator());
699                                 stringBuilder.append(testNull(artifactUUID));
700                                 stringBuilder.append(System.lineSeparator());
701                                 stringBuilder.append(",");
702                         }
703                         stringBuilder.replace(stringBuilder.length()-1,stringBuilder.length(), System.lineSeparator());
704                         stringBuilder.append("}");
705                         stringBuilder.append(System.lineSeparator());
706                 } else {
707                         stringBuilder.append("NULL");
708                 }
709
710                 if (moduleMetaData.getProperties() != null) {
711                         Map<String, String> vfModuleMap = moduleMetaData.getProperties();
712                         stringBuilder.append("Properties List:");
713                         stringBuilder.append("{");
714
715                         for (Map.Entry<String, String> entry : vfModuleMap.entrySet()) {
716                                 stringBuilder.append(System.lineSeparator());
717                                 stringBuilder.append("  ").append(entry.getKey()).append(" : ").append(entry.getValue());
718                         }
719                         stringBuilder.replace(stringBuilder.length()-1,stringBuilder.length(), System.lineSeparator());
720                         stringBuilder.append("}");
721                         stringBuilder.append(System.lineSeparator());
722                 } else {
723                         stringBuilder.append("NULL");
724                 }
725
726
727                 stringBuilder.append(System.lineSeparator());
728
729                 stringBuilder.append("isBase:");
730                 stringBuilder.append(moduleMetaData.isBase());
731                 stringBuilder.append(System.lineSeparator());
732
733                 return stringBuilder.toString();
734         }
735
736         private static String testNull(Object object) {
737                 if (object == null) {
738                         return "NULL";
739                 } else if (object instanceof Integer) {
740                         return object.toString();
741                 } else if (object instanceof String) {
742                         return (String)object;
743                 } else {
744                         return "Type not recognized";
745                 }
746         }
747
748         private static String dumpASDCResourcesList(INotificationData asdcNotification) {
749                 if (asdcNotification == null || asdcNotification.getResources() == null) {
750                         return null;
751                 }
752
753                 StringBuilder buffer = new StringBuilder();
754                 buffer.append("{");
755
756                 for (IResourceInstance resourceInstanceElem:asdcNotification.getResources()) {
757                         buffer.append(System.lineSeparator());
758                         buffer.append(testNull(dumpASDCResourceInstance(resourceInstanceElem)));
759                         buffer.append(System.lineSeparator());
760                         buffer.append(",");
761                 }
762                 buffer.replace(buffer.length()-1,buffer.length(), System.lineSeparator());
763                 buffer.append("}");
764                 buffer.append(System.lineSeparator());
765
766                 return buffer.toString();
767
768         }
769
770         private static String dumpASDCResourceInstance(IResourceInstance resourceInstance) {
771
772                 if (resourceInstance == null) {
773                         return null;
774                 }
775
776         return "Resource Instance Info:" + System.lineSeparator() +
777             "ResourceInstanceName:" + testNull(resourceInstance.getResourceInstanceName()) + System.lineSeparator() +
778             "ResourceCustomizationUUID:" + testNull(resourceInstance.getResourceCustomizationUUID()) + System.lineSeparator() +
779             "ResourceInvariantUUID:" + testNull(resourceInstance.getResourceInvariantUUID()) + System.lineSeparator() +
780             "ResourceName:" + testNull(resourceInstance.getResourceName()) + System.lineSeparator() +
781             "ResourceType:" + testNull(resourceInstance.getResourceType()) + System.lineSeparator() +
782             "ResourceUUID:" + testNull(resourceInstance.getResourceUUID()) + System.lineSeparator() +
783             "ResourceVersion:" + testNull(resourceInstance.getResourceVersion()) + System.lineSeparator() +
784             "Category:" + testNull(resourceInstance.getCategory()) + System.lineSeparator() +
785             "SubCategory:" + testNull(resourceInstance.getSubcategory()) + System.lineSeparator() +
786             "Resource Artifacts List:" + System.lineSeparator() + testNull(dumpArtifactInfoList(resourceInstance.getArtifacts())) + System.lineSeparator();
787         }
788
789
790         private static String dumpArtifactInfoList(List<IArtifactInfo> artifactsList) {
791
792                 if (artifactsList == null || artifactsList.isEmpty()) {
793                         return null;
794                 }
795
796                 StringBuilder buffer = new StringBuilder();
797                 buffer.append("{");
798                 for (IArtifactInfo artifactInfoElem:artifactsList) {
799                         buffer.append(System.lineSeparator());
800                         buffer.append(testNull(dumpASDCArtifactInfo(artifactInfoElem)));
801                         buffer.append(System.lineSeparator());
802                         buffer.append(",");
803
804                 }
805                 buffer.replace(buffer.length()-1,buffer.length(), System.lineSeparator());
806                 buffer.append("}");
807                 buffer.append(System.lineSeparator());
808
809                 return buffer.toString();
810         }
811
812         private static String dumpASDCArtifactInfo(IArtifactInfo artifactInfo) {
813
814                 if (artifactInfo == null) {
815                         return null;
816                 }
817
818                 StringBuilder buffer = new StringBuilder("Service Artifacts Info:");
819                 buffer.append(System.lineSeparator());
820
821                 buffer.append("ArtifactName:");
822                 buffer.append(testNull(artifactInfo.getArtifactName()));
823                 buffer.append(System.lineSeparator());
824
825                 buffer.append("ArtifactVersion:");
826                 buffer.append(testNull(artifactInfo.getArtifactVersion()));
827                 buffer.append(System.lineSeparator());
828
829                 buffer.append("ArtifactType:");
830                 buffer.append(testNull(artifactInfo.getArtifactType()));
831                 buffer.append(System.lineSeparator());
832
833                 buffer.append("ArtifactDescription:");
834                 buffer.append(testNull(artifactInfo.getArtifactDescription()));
835                 buffer.append(System.lineSeparator());
836
837                 buffer.append("ArtifactTimeout:");
838                 buffer.append(testNull(artifactInfo.getArtifactTimeout()));
839                 buffer.append(System.lineSeparator());
840
841                 buffer.append("ArtifactURL:");
842                 buffer.append(testNull(artifactInfo.getArtifactURL()));
843                 buffer.append(System.lineSeparator());
844
845                 buffer.append("ArtifactUUID:");
846                 buffer.append(testNull(artifactInfo.getArtifactUUID()));
847                 buffer.append(System.lineSeparator());
848
849                 buffer.append("ArtifactChecksum:");
850                 buffer.append(testNull(artifactInfo.getArtifactChecksum()));
851                 buffer.append(System.lineSeparator());
852
853                 buffer.append("GeneratedArtifact:");
854                 buffer.append("{");
855                 buffer.append(testNull(dumpASDCArtifactInfo(artifactInfo.getGeneratedArtifact())));
856                 buffer.append(System.lineSeparator());
857                 buffer.append("}");
858                 buffer.append(System.lineSeparator());
859
860                 buffer.append("RelatedArtifacts:");
861
862
863                 if (artifactInfo.getRelatedArtifacts() != null) {
864                         buffer.append("{");
865                         buffer.append(System.lineSeparator());
866                         for (IArtifactInfo artifactInfoElem:artifactInfo.getRelatedArtifacts()) {
867
868                                 buffer.append(testNull(dumpASDCArtifactInfo(artifactInfoElem)));
869                                 buffer.append(System.lineSeparator());
870                                 buffer.append(",");
871
872                         }
873                         buffer.replace(buffer.length()-1,buffer.length(), System.lineSeparator());
874                         buffer.append("}");
875                         buffer.append(System.lineSeparator());
876                 } else {
877                         buffer.append("NULL");
878                 }
879
880                 buffer.append(System.lineSeparator());
881
882                 return buffer.toString();
883         }
884 }