class CloudRegionOrchestrationValidator implements PreBuildingBlockValidator {

    @Override
    public Optional<String> validate(BuildingBlockExecution execution) {
        String msg = null;
        try {
            CloudRegion cloudRegion = execution.getGeneralBuildingBlock().getCloudRegion();
            if (Boolean.TRUE.equals(cloudRegion.getOrchestrationDisabled())) {
                msg = String.format(
                        "Error: The request has failed due to orchestration currently disabled for the target cloud region %s for cloud owner %s",
                        cloudRegion.getLcpCloudRegionId(), cloudRegion.getCloudOwner());
                logger.error(msg);
                return Optional.ofNullable(msg);
            }
        } catch (Exception e) {
            logger.error("failed to validate", e);
            exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e, ONAPComponents.SO);
        }
        return Optional.empty();
    }

}