41bb9642f34aa5f7f8a3b20617570bd50942695c
[packetcable.git] / packetcable-policy-server / src / main / java / org / opendaylight / controller / packetcable / provider / validation / impl / validators / qos / GateSpecValidatator.java
1 /*
2  * Copyright (c) 2015 CableLabs and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.packetcable.provider.validation.impl.validators.qos;
10
11 import org.opendaylight.controller.packetcable.provider.validation.ValidationException;
12 import org.opendaylight.controller.packetcable.provider.validation.impl.validators.AbstractValidator;
13 import org.opendaylight.yang.gen.v1.urn.packetcable.rev151101.pcmm.qos.gate.spec.GateSpec;
14
15 /**
16  * @author rvail
17  */
18 public class GateSpecValidatator extends AbstractValidator<GateSpec> {
19
20     private static final String DIRECTION = "gate-spec.direction";
21
22     @Override
23     public void validate(final GateSpec gateSpec, final Extent extent) throws ValidationException {
24         if (gateSpec == null) {
25             throw new ValidationException("gate-spec must exist");
26         }
27
28         // everything is optional
29
30 //        mustExist(gateSpec.getDirection(), DIRECTION);
31 //
32 //        // dscp-tos-overwrite & dscp-tos-mask are optional
33         throwErrorsIfNeeded();
34     }
35
36 }