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