use of com.google.protobuf.Struct.Builder in project so by onap.
the class AbstractCDSProcessingBBUtils method prepareExecutionServiceInput.
private ExecutionServiceInput prepareExecutionServiceInput(AbstractCDSPropertiesBean executionObject) {
String payload = executionObject.getRequestObject();
CommonHeader commonHeader = CommonHeader.newBuilder().setOriginatorId(executionObject.getOriginatorId()).setRequestId(executionObject.getRequestId()).setSubRequestId(executionObject.getSubRequestId()).build();
ActionIdentifiers actionIdentifiers = ActionIdentifiers.newBuilder().setBlueprintName(executionObject.getBlueprintName()).setBlueprintVersion(executionObject.getBlueprintVersion()).setActionName(executionObject.getActionName()).setMode(executionObject.getMode()).build();
Builder struct = Struct.newBuilder();
try {
JsonFormat.parser().merge(payload, struct);
} catch (InvalidProtocolBufferException e) {
logger.error("Failed to parse received message. blueprint({}:{}) for action({}). {}", executionObject.getBlueprintVersion(), executionObject.getBlueprintName(), executionObject.getActionName(), e);
}
return ExecutionServiceInput.newBuilder().setCommonHeader(commonHeader).setActionIdentifiers(actionIdentifiers).setPayload(struct.build()).build();
}
Aggregations