+ protected void retrieveRealizedFlows(SlcExecution slcExecution) {\r
+ Attachment attachment = NewSlcExecutionController\r
+ .realizedFlowsAttachment(slcExecution.getRealizedFlowsXml(),\r
+ slcExecution);\r
+\r
+ ByteArrayOutputStream out = null;\r
+ ByteArrayInputStream in = null;\r
+ try {\r
+ // TODO: optimize with piped streams\r
+ out = new ByteArrayOutputStream();\r
+ attachmentsStorage.retrieveAttachment(attachment, out);\r
+\r
+ byte[] arr = out.toByteArray();\r
+ in = new ByteArrayInputStream(arr);\r
+ StreamSource source = new StreamSource(in);\r
+ ObjectList ol = (ObjectList) unmarshaller.unmarshal(source);\r
+ ol.fill(slcExecution.getRealizedFlows());\r
+ } catch (Exception e) {\r
+ log.error("Could not retrieve realized flows from attachment #"\r
+ + attachment.getUuid(), e);\r
+ } finally {\r
+ IOUtils.closeQuietly(in);\r
+ IOUtils.closeQuietly(out);\r
+ }\r
+ }\r
+\r