396784add4343fb6edb689acac38e77ad4efbd27
[so.git] / asdc-controller / src / main / java / org / openecomp / mso / 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.openecomp.mso.asdc.util;
22
23
24 import java.util.List;
25 import java.util.Map;
26
27 import org.openecomp.sdc.api.notification.IArtifactInfo;
28 import org.openecomp.sdc.api.notification.INotificationData;
29 import org.openecomp.sdc.api.notification.IResourceInstance;
30 import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
31 import org.openecomp.sdc.tosca.parser.impl.SdcPropertyNames;
32 import org.openecomp.sdc.toscaparser.api.Group;
33 import org.openecomp.sdc.toscaparser.api.NodeTemplate;
34 import org.openecomp.sdc.toscaparser.api.elements.Metadata;
35 import org.openecomp.mso.asdc.installer.IVfModuleData;
36 import org.openecomp.mso.asdc.installer.ToscaResourceStructure;
37
38 public class ASDCNotificationLogging {
39
40         public static String dumpASDCNotification(INotificationData asdcNotification) {
41
42                 if (asdcNotification == null) {
43                         return "NULL";
44                 }
45         return "ASDC Notification:" + System.lineSeparator() +
46             "DistributionID:" + testNull(asdcNotification.getDistributionID()) + System.lineSeparator() +
47             "ServiceName:" + testNull(asdcNotification.getServiceName()) + System.lineSeparator() +
48             "ServiceVersion:" + testNull(asdcNotification.getServiceVersion()) + System.lineSeparator() +
49             "ServiceUUID:" + testNull(asdcNotification.getServiceUUID()) + System.lineSeparator() +
50             "ServiceInvariantUUID:" + testNull(asdcNotification.getServiceInvariantUUID()) + System.lineSeparator() +
51             "ServiceDescription:" + testNull(asdcNotification.getServiceDescription()) + System.lineSeparator() +
52             "Service Artifacts List:" + System.lineSeparator() + testNull(dumpArtifactInfoList(asdcNotification.getServiceArtifacts())) + System.lineSeparator() +
53             "Resource Instances List:" + System.lineSeparator() + testNull(dumpASDCResourcesList(asdcNotification)) + System.lineSeparator();
54         }
55
56         public static String dumpCSARNotification(INotificationData asdcNotification, ToscaResourceStructure toscaResourceStructure) {
57                 
58                 if (asdcNotification == null) {
59                         return "NULL";
60                 }
61                 
62
63                 StringBuilder buffer = new StringBuilder("CSAR Notification:");
64                 buffer.append(System.lineSeparator());
65                 buffer.append(System.lineSeparator());
66                 
67                 
68                 ISdcCsarHelper csarHelper = toscaResourceStructure.getSdcCsarHelper();
69
70         
71                 buffer.append("Service Level Properties:");
72                 buffer.append(System.lineSeparator());
73                 buffer.append("Name:");
74                 buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
75                 buffer.append(System.lineSeparator());
76                 buffer.append("Description:");
77                 buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
78                 buffer.append(System.lineSeparator());
79                 buffer.append("Model UUID:");
80                 buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
81                 buffer.append(System.lineSeparator());
82                 buffer.append("Model Version:");
83                 buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
84                 buffer.append(System.lineSeparator());
85                 buffer.append("Model InvariantUuid:");
86                 buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
87                 
88                 buffer.append(System.lineSeparator());
89                 buffer.append(System.lineSeparator());
90                 buffer.append("VNF Level Properties:");
91                 buffer.append(System.lineSeparator());
92                 
93         List<NodeTemplate> vfNodeTemplatesList = toscaResourceStructure.getSdcCsarHelper().getServiceVfList();
94         for (NodeTemplate vfNodeTemplate :  vfNodeTemplatesList) {
95                 
96                 buffer.append("Model Name:");
97                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME).trim()));
98                 buffer.append(System.lineSeparator());
99                 buffer.append("Description:");
100                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION).trim()));
101                 buffer.append(System.lineSeparator());
102                 buffer.append("Version:");
103                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION).trim()));
104                 buffer.append(System.lineSeparator());
105                 buffer.append("Type:");
106                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_TYPE).trim()));
107                 buffer.append(System.lineSeparator());
108                 buffer.append("InvariantUuid:");
109                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID).trim()));
110                 buffer.append(System.lineSeparator());
111                 buffer.append("Max Instances:");
112                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES).trim()));
113                 buffer.append(System.lineSeparator());
114                 buffer.append("Min Instances:");
115                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES).trim()));
116                 buffer.append(System.lineSeparator());
117                 
118                 buffer.append(System.lineSeparator());
119                 buffer.append("VNF Customization Properties:");
120                 buffer.append(System.lineSeparator());
121                 
122                 buffer.append("Customization UUID:");
123                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID).trim()));
124                 buffer.append(System.lineSeparator());
125                 buffer.append("NFFunction:");
126                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NFFUNCTION).trim()));
127                 buffer.append(System.lineSeparator());
128                 buffer.append("NFCode:");
129                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NFCODE).trim()));
130                 buffer.append(System.lineSeparator());
131                 buffer.append("NFRole:");
132                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NFROLE).trim()));
133                 buffer.append(System.lineSeparator());
134                 buffer.append("NFType:");
135                 buffer.append(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NFTYPE).trim()));
136                 buffer.append(System.lineSeparator());      
137                 
138                 buffer.append(System.lineSeparator());
139                 buffer.append("VF Module Properties:");
140                 buffer.append(System.lineSeparator());
141                 List<Group> vfGroups = toscaResourceStructure.getSdcCsarHelper().getVfModulesByVf(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID).trim()));
142                 
143                 for(Group group : vfGroups){
144                         
145                         Metadata vfMetadata = group.getMetadata();
146                         
147                         buffer.append("ModelInvariantUuid:");
148                         buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID).trim()));
149                         buffer.append(System.lineSeparator());
150                         buffer.append("ModelName:");
151                         buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELNAME).trim()));
152                         buffer.append(System.lineSeparator()); 
153                         buffer.append("ModelUuid:");
154                         buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID).trim()));
155                         buffer.append(System.lineSeparator());
156                         buffer.append("ModelVersion:");
157                         buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION).trim()));
158                         buffer.append(System.lineSeparator()); 
159                         buffer.append("Description:");
160                         buffer.append(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_DESCRIPTION).trim()));
161                         buffer.append(System.lineSeparator());     
162                 }
163   
164         }
165         
166                 
167                 List<NodeTemplate> nodeTemplatesVLList = toscaResourceStructure.getSdcCsarHelper().getServiceVlList();
168                                         
169         if(nodeTemplatesVLList != null){
170                 
171                 buffer.append(System.lineSeparator());
172                 buffer.append("NETWORK Level Properties:");
173                 buffer.append(System.lineSeparator());
174                 
175                 for(NodeTemplate vlNode : nodeTemplatesVLList){
176                         
177                         buffer.append("Model Name:");
178                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME).trim()));
179                         buffer.append(System.lineSeparator()); 
180                         buffer.append("Model InvariantUuid:");
181                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID).trim()));
182                         buffer.append(System.lineSeparator());   
183                         buffer.append("Model UUID:");
184                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID).trim()));
185                         buffer.append(System.lineSeparator()); 
186                         buffer.append("Model Version:");
187                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION).trim()));
188                         buffer.append(System.lineSeparator());   
189                         buffer.append("AIC Max Version:");
190                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES).trim()));
191                         buffer.append(System.lineSeparator()); 
192                         buffer.append("AIC Min Version:");
193                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES).trim()));
194                         buffer.append(System.lineSeparator());  
195                         buffer.append("Tosca Node Type:");
196                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_TYPE).trim()));
197                         buffer.append(System.lineSeparator());  
198                         buffer.append("Description:");
199                         buffer.append(testNull(vlNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION).trim()));
200                         buffer.append(System.lineSeparator());  
201                 
202                 }
203                         
204         }
205         
206         List<NodeTemplate> allottedResourceList = toscaResourceStructure.getSdcCsarHelper().getAllottedResources();
207         
208                 if(allottedResourceList != null){
209                         
210                         buffer.append(System.lineSeparator());
211                         buffer.append("Allotted Resource Properties:");
212                         buffer.append(System.lineSeparator());
213                 
214                         for(NodeTemplate allottedNode : allottedResourceList){
215                                 
216                                 buffer.append("Model Name:");
217                                 buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME).trim()));
218                                 buffer.append(System.lineSeparator());
219                                 buffer.append("Model Name:");
220                                 buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME).trim()));
221                                 buffer.append(System.lineSeparator()); 
222                                 buffer.append("Model InvariantUuid:");
223                                 buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID).trim()));
224                                 buffer.append(System.lineSeparator());  
225                                 buffer.append("Model Version:");
226                                 buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION).trim()));
227                                 buffer.append(System.lineSeparator()); 
228                                 buffer.append("Model UUID:");
229                                 buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID).trim()));
230                                 buffer.append(System.lineSeparator());
231                                 
232                                 
233                                 buffer.append("Allotted Resource Customization Properties:");
234                                 buffer.append(System.lineSeparator());
235                         
236                                 buffer.append("Model Cutomization UUID:");
237                                 buffer.append(testNull(allottedNode.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID).trim()));
238                                 buffer.append(System.lineSeparator());
239                                 
240                                 
241                         }
242                 }
243                 
244                 
245                 return buffer.toString();
246         }
247         
248         public static String dumpVfModuleMetaDataList(List<IVfModuleData> moduleMetaDataList) {
249                 if (moduleMetaDataList == null ) {
250                         return null;
251                 }
252
253                 StringBuilder buffer = new StringBuilder("VfModuleMetaData List:");
254                 buffer.append(System.lineSeparator());
255
256                 buffer.append("{");
257
258                 for (IVfModuleData moduleMetaData:moduleMetaDataList) {
259                         buffer.append(System.lineSeparator());
260                         buffer.append(testNull(dumpVfModuleMetaData(moduleMetaData)));
261                         buffer.append(System.lineSeparator());
262                         buffer.append(",");
263
264                 }
265                 buffer.replace(buffer.length()-1,buffer.length(), System.lineSeparator());
266                 buffer.append("}");
267                 buffer.append(System.lineSeparator());
268
269                 return buffer.toString();
270         }
271
272         private static String dumpVfModuleMetaData(IVfModuleData moduleMetaData) {
273
274                 if (moduleMetaData == null ) {
275                         return "NULL";
276                 }
277
278                 StringBuilder stringBuilder = new StringBuilder("VfModuleMetaData:");
279                 stringBuilder.append(System.lineSeparator());
280
281                 stringBuilder.append("VfModuleModelName:");
282                 stringBuilder.append(testNull(moduleMetaData.getVfModuleModelName()));
283                 stringBuilder.append(System.lineSeparator());
284
285                 stringBuilder.append("VfModuleModelVersion:");
286                 stringBuilder.append(testNull(moduleMetaData.getVfModuleModelVersion()));
287                 stringBuilder.append(System.lineSeparator());
288
289                 stringBuilder.append("VfModuleModelUUID:");
290                 stringBuilder.append(testNull(moduleMetaData.getVfModuleModelUUID()));
291                 stringBuilder.append(System.lineSeparator());
292
293                 stringBuilder.append("VfModuleModelInvariantUUID:");
294                 stringBuilder.append(testNull(moduleMetaData.getVfModuleModelInvariantUUID()));
295                 stringBuilder.append(System.lineSeparator());
296
297                 stringBuilder.append("VfModuleModelDescription:");
298                 stringBuilder.append(testNull(moduleMetaData.getVfModuleModelDescription()));
299                 stringBuilder.append(System.lineSeparator());
300
301                 stringBuilder.append("Artifacts UUID List:");
302
303                 if (moduleMetaData.getArtifacts() != null) {
304                         stringBuilder.append("{");
305
306                         for (String artifactUUID:moduleMetaData.getArtifacts()) {
307                                 stringBuilder.append(System.lineSeparator());
308                                 stringBuilder.append(testNull(artifactUUID));
309                                 stringBuilder.append(System.lineSeparator());
310                                 stringBuilder.append(",");
311                         }
312                         stringBuilder.replace(stringBuilder.length()-1,stringBuilder.length(), System.lineSeparator());
313                         stringBuilder.append("}");
314                         stringBuilder.append(System.lineSeparator());
315                 } else {
316                         stringBuilder.append("NULL");
317                 }
318
319                 if (moduleMetaData.getProperties() != null) {
320                         Map<String, String> vfModuleMap = moduleMetaData.getProperties();
321                         stringBuilder.append("Properties List:");
322                         stringBuilder.append("{");
323
324                         for (Map.Entry<String, String> entry : vfModuleMap.entrySet()) {
325                                 stringBuilder.append(System.lineSeparator());
326                                 stringBuilder.append("  ").append(entry.getKey()).append(" : ").append(entry.getValue());
327                         }
328                         stringBuilder.replace(stringBuilder.length()-1,stringBuilder.length(), System.lineSeparator());
329                         stringBuilder.append("}");
330                         stringBuilder.append(System.lineSeparator());
331                 } else {
332                         stringBuilder.append("NULL");
333                 }
334
335
336                 stringBuilder.append(System.lineSeparator());
337
338                 stringBuilder.append("isBase:");
339                 stringBuilder.append(moduleMetaData.isBase());
340                 stringBuilder.append(System.lineSeparator());
341
342                 return stringBuilder.toString();
343         }
344
345         private static String testNull(Object object) {
346                 if (object == null) {
347                         return "NULL";
348                 } else if (object instanceof Integer) {
349                         return object.toString();
350                 } else if (object instanceof String) {
351                         return (String)object;
352                 } else {
353                         return "Type not recognized";
354                 }
355         }
356
357         private static String dumpASDCResourcesList(INotificationData asdcNotification) {
358                 if (asdcNotification == null || asdcNotification.getResources() == null) {
359                         return null;
360                 }
361
362                 StringBuilder buffer = new StringBuilder();
363                 buffer.append("{");
364
365                 for (IResourceInstance resourceInstanceElem:asdcNotification.getResources()) {
366                         buffer.append(System.lineSeparator());
367                         buffer.append(testNull(dumpASDCResourceInstance(resourceInstanceElem)));
368                         buffer.append(System.lineSeparator());
369                         buffer.append(",");
370                 }
371                 buffer.replace(buffer.length()-1,buffer.length(), System.lineSeparator());
372                 buffer.append("}");
373                 buffer.append(System.lineSeparator());
374
375                 return buffer.toString();
376
377         }
378
379         private static String dumpASDCResourceInstance(IResourceInstance resourceInstance) {
380
381                 if (resourceInstance == null) {
382                         return null;
383                 }
384
385         return "Resource Instance Info:" + System.lineSeparator() +
386             "ResourceInstanceName:" + testNull(resourceInstance.getResourceInstanceName()) + System.lineSeparator() +
387             "ResourceCustomizationUUID:" + testNull(resourceInstance.getResourceCustomizationUUID()) + System.lineSeparator() +
388             "ResourceInvariantUUID:" + testNull(resourceInstance.getResourceInvariantUUID()) + System.lineSeparator() +
389             "ResourceName:" + testNull(resourceInstance.getResourceName()) + System.lineSeparator() +
390             "ResourceType:" + testNull(resourceInstance.getResourceType()) + System.lineSeparator() +
391             "ResourceUUID:" + testNull(resourceInstance.getResourceUUID()) + System.lineSeparator() +
392             "ResourceVersion:" + testNull(resourceInstance.getResourceVersion()) + System.lineSeparator() +
393             "Category:" + testNull(resourceInstance.getCategory()) + System.lineSeparator() +
394             "SubCategory:" + testNull(resourceInstance.getSubcategory()) + System.lineSeparator() +
395             "Resource Artifacts List:" + System.lineSeparator() + testNull(dumpArtifactInfoList(resourceInstance.getArtifacts())) + System.lineSeparator();
396         }
397
398
399         private static String dumpArtifactInfoList(List<IArtifactInfo> artifactsList) {
400
401                 if (artifactsList == null || artifactsList.isEmpty()) {
402                         return null;
403                 }
404
405                 StringBuilder buffer = new StringBuilder();
406                 buffer.append("{");
407                 for (IArtifactInfo artifactInfoElem:artifactsList) {
408                         buffer.append(System.lineSeparator());
409                         buffer.append(testNull(dumpASDCArtifactInfo(artifactInfoElem)));
410                         buffer.append(System.lineSeparator());
411                         buffer.append(",");
412
413                 }
414                 buffer.replace(buffer.length()-1,buffer.length(), System.lineSeparator());
415                 buffer.append("}");
416                 buffer.append(System.lineSeparator());
417
418                 return buffer.toString();
419         }
420
421         private static String dumpASDCArtifactInfo(IArtifactInfo artifactInfo) {
422
423                 if (artifactInfo == null) {
424                         return null;
425                 }
426
427                 StringBuilder buffer = new StringBuilder("Service Artifacts Info:");
428                 buffer.append(System.lineSeparator());
429
430                 buffer.append("ArtifactName:");
431                 buffer.append(testNull(artifactInfo.getArtifactName()));
432                 buffer.append(System.lineSeparator());
433
434                 buffer.append("ArtifactVersion:");
435                 buffer.append(testNull(artifactInfo.getArtifactVersion()));
436                 buffer.append(System.lineSeparator());
437
438                 buffer.append("ArtifactType:");
439                 buffer.append(testNull(artifactInfo.getArtifactType()));
440                 buffer.append(System.lineSeparator());
441
442                 buffer.append("ArtifactDescription:");
443                 buffer.append(testNull(artifactInfo.getArtifactDescription()));
444                 buffer.append(System.lineSeparator());
445
446                 buffer.append("ArtifactTimeout:");
447                 buffer.append(testNull(artifactInfo.getArtifactTimeout()));
448                 buffer.append(System.lineSeparator());
449
450                 buffer.append("ArtifactURL:");
451                 buffer.append(testNull(artifactInfo.getArtifactURL()));
452                 buffer.append(System.lineSeparator());
453
454                 buffer.append("ArtifactUUID:");
455                 buffer.append(testNull(artifactInfo.getArtifactUUID()));
456                 buffer.append(System.lineSeparator());
457
458                 buffer.append("ArtifactChecksum:");
459                 buffer.append(testNull(artifactInfo.getArtifactChecksum()));
460                 buffer.append(System.lineSeparator());
461
462                 buffer.append("GeneratedArtifact:");
463                 buffer.append("{");
464                 buffer.append(testNull(dumpASDCArtifactInfo(artifactInfo.getGeneratedArtifact())));
465                 buffer.append(System.lineSeparator());
466                 buffer.append("}");
467                 buffer.append(System.lineSeparator());
468
469                 buffer.append("RelatedArtifacts:");
470
471
472                 if (artifactInfo.getRelatedArtifacts() != null) {
473                         buffer.append("{");
474                         buffer.append(System.lineSeparator());
475                         for (IArtifactInfo artifactInfoElem:artifactInfo.getRelatedArtifacts()) {
476
477                                 buffer.append(testNull(dumpASDCArtifactInfo(artifactInfoElem)));
478                                 buffer.append(System.lineSeparator());
479                                 buffer.append(",");
480
481                         }
482                         buffer.replace(buffer.length()-1,buffer.length(), System.lineSeparator());
483                         buffer.append("}");
484                         buffer.append(System.lineSeparator());
485                 } else {
486                         buffer.append("NULL");
487                 }
488
489                 buffer.append(System.lineSeparator());
490
491                 return buffer.toString();
492         }
493 }