/*
* ============LICENSE_START=======================================================
- * Copyright (c) 2021 Bell Canada.
+ * Copyright (c) 2021-2022 Bell Canada.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.onap.cps.temporal.controller.utils.DateTimeUtility
import com.fasterxml.jackson.databind.ObjectMapper
+import org.onap.cps.temporal.domain.Operation
+
import java.time.OffsetDateTime
import org.onap.cps.temporal.controller.rest.model.AnchorDetails
import org.onap.cps.temporal.controller.rest.model.AnchorDetailsMapperImpl
return NetworkData.builder().dataspace(myDataspace)
.schemaSet(mySchemaset).anchor(myAnchor).payload('{"message" : "Hello World"}')
.observedTimestamp(OffsetDateTime.now())
+ .operation(Operation.CREATE)
.createdTimestamp(OffsetDateTime.now()).build()
}
anchorDetails.setAnchor(networkData.getAnchor())
anchorDetails.setSchemaSet(networkData.getSchemaSet())
anchorDetails.setObservedTimestamp(DateTimeUtility.toString(networkData.getObservedTimestamp()))
+ anchorDetails.setOperation(AnchorDetails.OperationEnum.valueOf(networkData.getOperation().toString()))
anchorDetails.setData(networkData.getPayload())
return anchorDetails
}