+++ /dev/null
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.protocol.pcep.message;
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
-
-/**
- * Structure of Keepalive Message
- *
- * @see <a href="http://tools.ietf.org/html/rfc5440#section-6.3">KeepAlive Message</a>
- */
-public final class PCEPKeepAliveMessage implements Message {
-
- /**
- * Default constructor PCEPKeepAliveMessage.
- */
- public PCEPKeepAliveMessage() {
- }
-
- @Override
- public String toString() {
- final StringBuilder builder = new StringBuilder();
- builder.append("PCEPKeepAliveMessage []");
- return builder.toString();
- }
-}
package org.opendaylight.protocol.pcep.impl.message;
import org.opendaylight.protocol.pcep.impl.PCEPMessageParser;
-import org.opendaylight.protocol.pcep.message.PCEPKeepAliveMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.KeepaliveMessage;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
/**
@Override
public byte[] put(final Message msg) {
- if (!(msg instanceof PCEPKeepAliveMessage))
+ if (!(msg instanceof KeepaliveMessage))
throw new IllegalArgumentException("Wrong instance of PCEPMessage. Passed instance of " + msg.getClass()
+ ". Nedded PCEPKeepAliveMessage.");
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
import org.opendaylight.protocol.pcep.PCEPObject;
import org.opendaylight.protocol.pcep.impl.PCEPMessageValidator;
-import org.opendaylight.protocol.pcep.message.PCEPKeepAliveMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.KeepaliveBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.keepalive.message.KeepaliveMessageBuilder;
/**
* PCEPKeepAliveMessage validator. Validates message integrity.
private static final long serialVersionUID = 1L;
{
- this.add(new PCEPKeepAliveMessage());
+ this.add(new KeepaliveBuilder().setKeepaliveMessage(new KeepaliveMessageBuilder().build()).build());
}
};
}
import org.opendaylight.protocol.pcep.message.PCCreateMessage;
import org.opendaylight.protocol.pcep.message.PCEPCloseMessage;
import org.opendaylight.protocol.pcep.message.PCEPErrorMessage;
-import org.opendaylight.protocol.pcep.message.PCEPKeepAliveMessage;
import org.opendaylight.protocol.pcep.message.PCEPNotificationMessage;
import org.opendaylight.protocol.pcep.message.PCEPOpenMessage;
import org.opendaylight.protocol.pcep.message.PCEPReplyMessage;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.AsNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nps.concepts.rev130930.Bandwidth;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.KeepaliveBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.keepalive.message.KeepaliveMessageBuilder;
import com.google.common.collect.Lists;
public void testKeepAliveMessageValidationFromBin() throws IOException, PCEPDeserializerException, PCEPDocumentedException,
DeserializerException, DocumentedException {
assertEquals(deserMsg("src/test/resources/PCEPKeepAliveMessage1.bin").toString(),
- asList((Message) new PCEPKeepAliveMessage()).toString());
- assertEquals(deserMsg("src/test/resources/Keepalive.1.bin").toString(), asList(new PCEPKeepAliveMessage()).toString());
+ asList(new KeepaliveBuilder().setKeepaliveMessage(new KeepaliveMessageBuilder().build()).build()).toString());
+ assertEquals(deserMsg("src/test/resources/Keepalive.1.bin").toString(),
+ asList(new KeepaliveBuilder().setKeepaliveMessage(new KeepaliveMessageBuilder().build()).build()).toString());
}
@Test
import static org.junit.Assert.assertTrue;
import org.junit.Test;
-import org.opendaylight.protocol.pcep.message.PCEPKeepAliveMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.KeepaliveBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.KeepaliveMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.keepalive.message.KeepaliveMessageBuilder;
public class PCEPTestingToolTest {
public void testSimpleSessionListener() {
final TestingSessionListener ssl = new TestingSessionListener();
assertEquals(0, ssl.messages.size());
- ssl.onMessage(null, new PCEPKeepAliveMessage());
+ ssl.onMessage(null, new KeepaliveBuilder().setKeepaliveMessage(new KeepaliveMessageBuilder().build()).build());
assertEquals(1, ssl.messages.size());
- assertTrue(ssl.messages.get(0) instanceof PCEPKeepAliveMessage);
+ assertTrue(ssl.messages.get(0) instanceof KeepaliveMessage);
assertFalse(ssl.up);
ssl.onSessionUp(null);
assertTrue(ssl.up);