2 * Copyright © 2023 Fujitsu Network Communications, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.transportpce.servicehandler.validation;
11 import org.opendaylight.transportpce.common.OperationResult;
12 import org.opendaylight.transportpce.servicehandler.CatalogInput;
13 import org.opendaylight.transportpce.servicehandler.validation.checks.ComplianceCheckResult;
14 import org.opendaylight.transportpce.servicehandler.validation.checks.ServicehandlerComplianceCheck;
15 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.RpcActions;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
19 public final class CatalogValidation {
21 private CatalogValidation() {
24 private static final Logger LOG = LoggerFactory.getLogger(CatalogValidation.class);
26 public static OperationResult validateORCatalogRequest(CatalogInput input, RpcActions rpcActions) {
28 * -OR request header and operational mode info compliance are verified.
30 LOG.debug("checking OR Catalog Compliance ...");
31 ComplianceCheckResult serviceHandlerCheckResult = ServicehandlerComplianceCheck.checkORCatalog(
32 input.getSdncRequestHeader(), input.getOperationalModeInfo(), rpcActions, true);
33 if (!serviceHandlerCheckResult.hasPassed()) {
34 return OperationResult.failed(serviceHandlerCheckResult.getMessage());
36 LOG.debug("Catalog OR request compliant !");
37 return OperationResult.ok("Validation successful.");
40 public static OperationResult validateSpecificCatalogRequest(CatalogInput input, RpcActions rpcActions) {
42 * -Specific request header and operational mode info compliance are verified.
44 LOG.debug("checking specific Catalog Compliance ...");
45 ComplianceCheckResult serviceHandlerCheckResult = ServicehandlerComplianceCheck.checkSpecificCatalog(
46 input.getSdncRequestHeader(), input.getOperationalModeInfoSpecific(), rpcActions, true);
47 if (!serviceHandlerCheckResult.hasPassed()) {
48 return OperationResult.failed(serviceHandlerCheckResult.getMessage());
50 LOG.debug("Catalog specific request compliant !");
51 return OperationResult.ok("Validation successful.");