2 * Copyright (c) 2013 Cisco Systems, 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
8 package org.opendaylight.protocol.pcep.impl.message;
10 import java.util.ArrayList;
11 import java.util.List;
13 import org.opendaylight.protocol.pcep.PCEPDeserializerException;
14 import org.opendaylight.protocol.pcep.PCEPObject;
15 import org.opendaylight.protocol.pcep.impl.PCEPMessageValidator;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.KeepaliveBuilder;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.keepalive.message.KeepaliveMessageBuilder;
21 * PCEPKeepAliveMessage validator. Validates message integrity.
23 public class PCEPKeepAliveMessageValidator extends PCEPMessageValidator {
26 public List<Message> validate(final List<PCEPObject> objects) throws PCEPDeserializerException {
27 if (objects != null && !objects.isEmpty())
28 throw new PCEPDeserializerException("KeepAlive message has content.");
30 return new ArrayList<Message>() {
31 private static final long serialVersionUID = 1L;
34 this.add(new KeepaliveBuilder().setKeepaliveMessage(new KeepaliveMessageBuilder().build()).build());