Bumped stateful draft to 07. 47/4347/1
authorDana Kutenicsova <dkutenic@cisco.com>
Fri, 17 Jan 2014 10:26:22 +0000 (11:26 +0100)
committerDana Kutenicsova <dkutenic@cisco.com>
Fri, 17 Jan 2014 10:26:22 +0000 (11:26 +0100)
Change-Id: Ic81ddd5138436c2795a7b94505d1df49cd3c6639
Signed-off-by: Dana Kutenicsova <dkutenic@cisco.com>
25 files changed:
pcep/api/src/main/yang/pcep-ietf-stateful.yang
pcep/impl-config/src/main/java/org/opendaylight/controller/config/yang/pcep/impl/PCEPSessionProposalFactoryImplModule.java
pcep/impl-config/src/test/java/org/opendaylight/controller/config/yang/pcep/impl/PCEPSessionProposalFactoryImplModuleTest.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionImpl.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionProposalFactoryImpl.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/StatefulActivator.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/message/PCEPErrorMessageParser.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/message/PCEPReportMessageParser.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/message/PCEPRequestMessageParser.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPOpenObjectParser.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPSrpObjectParser.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/tlv/LSPIdentifierIpv4TlvParser.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/tlv/LSPIdentifierIpv6TlvParser.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/tlv/LspDbVersionTlvParser.java [deleted file]
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/tlv/PCEStatefulCapabilityTlvParser.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/tlv/PredundancyGroupTlvParser.java [deleted file]
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPObjectParserTest.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPTlvParserTest.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPValidatorTest.java
pcep/impl/src/test/resources/PCEPOpenMessage1.bin
pcep/impl/src/test/resources/PCEPOpenObject1.bin
pcep/impl/src/test/resources/PCReq.3.bin
pcep/testtool/src/main/java/org/opendaylight/protocol/pcep/testtool/Main.java
pcep/testtool/src/test/java/org/opendaylight/protocol/pcep/testtool/PCCMock.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/ServerSessionManager.java

index 4e778b6c209fb495a07dac13649902c096a2fdba..7f0e74a3fd5eabb5988b4c9b3fd920c27660e191 100644 (file)
@@ -66,22 +66,9 @@ module pcep-ietf-stateful {
                }
        }
 
-       grouping lsp-db-version-tlv {
-               description "LSP State Database Version TLV";
-               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.1.2";
-
-               container lsp-db-version {
-                       uses pcep:tlv;
-                       leaf version {
-                               type uint64;
-                               mandatory true;
-                       }
-               }
-       }
-
        grouping lsp-identifiers-tlv {
                description "LSP Identifiers TLV";
-               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.3.1";
+               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.3.1";
                container lsp-identifiers {
                        uses pcep:tlv;
                        leaf lsp-id {
@@ -105,6 +92,10 @@ module pcep-ietf-stateful {
                                                        type rsvp:ipv4-extended-tunnel-id;
                                                        mandatory true;
                                                }
+                                               leaf ipv4-tunnel-endpoint-address {
+                                                       type inet:ipv4-address;
+                                                       mandatory true;
+                                               }
                                        }
                                }
                                case ipv6-case {
@@ -117,6 +108,10 @@ module pcep-ietf-stateful {
                                                        type rsvp:ipv6-extended-tunnel-id;
                                                        mandatory true;
                                                }
+                                               leaf ipv6-tunnel-endpoint-address {
+                                                       type inet:ipv6-address;
+                                                       mandatory true;
+                                               }
                                        }
                                }
                        }
@@ -125,7 +120,7 @@ module pcep-ietf-stateful {
 
        grouping lsp-error-code-tlv {
                description "LSP Error Code TLV";
-               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.3.3";
+               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.3.3";
                container lsp-error-code {
                        uses pcep:tlv;
                        leaf error-code {
@@ -137,7 +132,7 @@ module pcep-ietf-stateful {
 
        grouping rsvp-error-spec-tlv {
                description "RSVP Error Spec TLV";
-               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.3.4";
+               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.3.4";
                container rsvp-error-spec {
                        uses pcep:tlv;
                        choice error-type {
@@ -157,7 +152,7 @@ module pcep-ietf-stateful {
 
        grouping stateful-capability-tlv {
                description "Stateful PCE Capability TLV";
-               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.1.1";
+               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.1.1";
 
                container stateful {
                        uses pcep:tlv;
@@ -166,16 +161,12 @@ module pcep-ietf-stateful {
                                type boolean;
                                default false;
                        }
-                       leaf include-db-version {
-                               type boolean;
-                               default false;
-                       }
                }
        }
 
        grouping symbolic-path-name-tlv {
                description "Symbolic Path Name TLV";
-               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.3.2";
+               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.3.2";
                container symbolic-path-name {
                        uses pcep:tlv;
                        leaf path-name {
@@ -185,22 +176,9 @@ module pcep-ietf-stateful {
                }
        }
 
-       grouping predundancy-group-id-tlv {
-               description "PCE Redundancy Group Identifier TLV";
-               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.1.3";
-
-               container predundancy-group-id {
-                       uses pcep:tlv;
-                       leaf identifier {
-                               type binary;
-                               mandatory true;
-                       }
-               }
-       }
-
        grouping lsp-object {
                description "LSP Object";
-               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.3";
+               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.3";
 
                container lsp {
                        uses pcep:object;
@@ -248,23 +226,19 @@ module pcep-ietf-stateful {
 
        grouping srp-object {
                description "SRP Object";
-               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-7.2";
+               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-7.2";
 
                container srp {
                        uses pcep:object;
 
+                       container "tlvs" {
+                               uses symbolic-path-name-tlv;
+                       }
+
                        leaf operation-id {
                                type srp-id-number;
                                mandatory true;
                        }
-
-                       leaf flags {
-                               type bits {
-                                       bit lsp-remove {
-                                               position 31;
-                                       }
-                               }
-                       }
                }
        }
 
@@ -273,7 +247,7 @@ module pcep-ietf-stateful {
 
                container pcupd-message {
                        description "State Update Request Message";
-                       reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-6.2";
+                       reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-6.2";
 
                        uses pcep:message-header;
 
@@ -294,7 +268,7 @@ module pcep-ietf-stateful {
 
                container pcrpt-message {
                        description "State Report Message";
-                       reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-6.1";
+                       reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-6.1";
 
                        uses pcep:message-header;
 
@@ -319,34 +293,20 @@ module pcep-ietf-stateful {
        }
 
        augment "/msg:open/msg:open-message/msg:open/msg:tlvs" {
-               uses lsp-db-version-tlv;
-
-               uses predundancy-group-id-tlv;
-
                uses stateful-capability-tlv;
        }
 
        augment "/msg:pcerr/msg:pcerr-message/msg:error-type/msg:session-case/msg:session/msg:open/msg:tlvs" {
-               uses lsp-db-version-tlv;
-
-               uses predundancy-group-id-tlv;
-
                uses stateful-capability-tlv;
        }
 
-       augment "/msg:pcreq/msg:pcreq-message/msg:requests/msg:segment-computation/msg:p2p" {
-               uses lsp-object;
-       }
-
-       augment "/msg:pcrep/msg:pcrep-message/msg:replies" {
-               uses lsp-object;
-       }
-
        augment "/msg:pcerr/msg:pcerr-message/msg:error-type" {
+               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-07#section-6.3";
                case stateful-case {
                        container stateful {
-                               reference "https://tools.ietf.org/html/draft-ietf-pce-stateful-pce-05#section-6.3";
-                               uses srp-object;
+                               list srps {
+                                       uses srp-object;
+                               }
                        }
                }
        }
index 1a9117bff24d8567f6a6dc476f449e94681cbe15..04b46db27ed6e198208f8e94f9e1a618b39583e1 100644 (file)
@@ -48,7 +48,6 @@ public final class PCEPSessionProposalFactoryImplModule extends
        public void validate() {
                super.validate();
                JmxAttributeValidationException.checkNotNull(getActive(), "value is not set.", this.activeJmxAttribute);
-               JmxAttributeValidationException.checkNotNull(getVersioned(), "value is not set.", this.versionedJmxAttribute);
                JmxAttributeValidationException.checkNotNull(getInitiated(), "value is not set.", this.initiatedJmxAttribute);
                JmxAttributeValidationException.checkNotNull(getDeadTimerValue(), "value is not set.", this.deadTimerValueJmxAttribute);
                JmxAttributeValidationException.checkNotNull(getKeepAliveTimerValue(), "value is not set.", this.keepAliveTimerValueJmxAttribute);
@@ -59,7 +58,7 @@ public final class PCEPSessionProposalFactoryImplModule extends
                                LOG.warn("DeadTimerValue should be 4 times greater than KeepAliveTimerValue");
                        }
                }
-               if ((getActive() || getVersioned()) && !getStateful()) {
+               if (getActive() && !getStateful()) {
                        setStateful(true);
                }
                JmxAttributeValidationException.checkNotNull(getStateful(), "value is not set.", this.statefulJmxAttribute);
@@ -67,7 +66,7 @@ public final class PCEPSessionProposalFactoryImplModule extends
 
        @Override
        public java.lang.AutoCloseable createInstance() {
-               final PCEPSessionProposalFactoryImpl inner = new PCEPSessionProposalFactoryImpl(getDeadTimerValue(), getKeepAliveTimerValue(), getStateful(), getActive(), getVersioned(), getInitiated());
+               final PCEPSessionProposalFactoryImpl inner = new PCEPSessionProposalFactoryImpl(getDeadTimerValue(), getKeepAliveTimerValue(), getStateful(), getActive(), getInitiated());
                return new PCEPSessionProposalFactoryCloseable(inner);
        }
 
index a5d6c8b9583af24a4e49e7212e9db9a9596954a9..7d6ceca6e20bb6df3e39461a6ccf6f4bddf3a776 100644 (file)
@@ -23,8 +23,7 @@ import org.opendaylight.controller.config.manager.impl.AbstractConfigTest;
 import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver;
 import org.opendaylight.controller.config.util.ConfigTransactionJMXClient;
 
-public class PCEPSessionProposalFactoryImplModuleTest extends
-AbstractConfigTest {
+public class PCEPSessionProposalFactoryImplModuleTest extends AbstractConfigTest {
 
        private final String instanceName = "pcep-proposal";
 
@@ -33,198 +32,138 @@ AbstractConfigTest {
        @Before
        public void setUp() throws Exception {
                this.factory = new PCEPSessionProposalFactoryImplModuleFactory();
-               super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(
-                               factory));
+               super.initConfigTransactionManagerImpl(new HardcodedModuleFactoriesResolver(this.factory));
        }
 
        @Test
-       public void testValidationExceptionDeadTimerValueNotSet()
-                       throws InstanceAlreadyExistsException {
+       public void testValidationExceptionDeadTimerValueNotSet() throws InstanceAlreadyExistsException {
                try {
-                       ConfigTransactionJMXClient transaction = configRegistryClient
-                                       .createTransaction();
-                       createInstance(transaction, this.factory.getImplementationName(),
-                                       instanceName, null, 100, true, true, true, true);
+                       final ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
+                       createInstance(transaction, this.factory.getImplementationName(), this.instanceName, null, 100, true, true, true, true);
                        transaction.validateConfig();
                        fail();
-               } catch (ValidationException e) {
-                       assertTrue(e.getMessage().contains(
-                                       "DeadTimerValue value is not set"));
+               } catch (final ValidationException e) {
+                       assertTrue(e.getMessage().contains("DeadTimerValue value is not set"));
                }
        }
 
        @Test
-       public void testValidationExceptionKeepAliveTimerNotSet()
-                       throws InstanceAlreadyExistsException {
+       public void testValidationExceptionKeepAliveTimerNotSet() throws InstanceAlreadyExistsException {
                try {
-                       ConfigTransactionJMXClient transaction = configRegistryClient
-                                       .createTransaction();
-                       createInstance(transaction, this.factory.getImplementationName(),
-                                       instanceName, 400, null, true, true, true, true);
+                       final ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
+                       createInstance(transaction, this.factory.getImplementationName(), this.instanceName, 400, null, true, true, true, true);
                        transaction.validateConfig();
                        fail();
-               } catch (ValidationException e) {
-                       assertTrue(e.getMessage().contains(
-                                       "KeepAliveTimerValue value is not set"));
+               } catch (final ValidationException e) {
+                       assertTrue(e.getMessage().contains("KeepAliveTimerValue value is not set"));
                }
        }
 
        @Test
-       public void testValidationExceptionStatefulNotSet()
-                       throws InstanceAlreadyExistsException {
+       public void testValidationExceptionStatefulNotSet() throws InstanceAlreadyExistsException {
                try {
-                       ConfigTransactionJMXClient transaction = configRegistryClient
-                                       .createTransaction();
-                       createInstance(transaction, this.factory.getImplementationName(),
-                                       instanceName, 400, 100, null, false, false, false);
+                       final ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
+                       createInstance(transaction, this.factory.getImplementationName(), this.instanceName, 400, 100, null, false, false, false);
                        transaction.validateConfig();
                        fail();
-               } catch (ValidationException e) {
+               } catch (final ValidationException e) {
                        assertTrue(e.getMessage().contains("Stateful value is not set"));
                }
        }
 
        @Test
-       public void testValidationExceptionActiveNotSet()
-                       throws InstanceAlreadyExistsException {
+       public void testValidationExceptionActiveNotSet() throws InstanceAlreadyExistsException {
                try {
-                       ConfigTransactionJMXClient transaction = configRegistryClient
-                                       .createTransaction();
-                       createInstance(transaction, this.factory.getImplementationName(),
-                                       instanceName, 400, 100, true, null, true, true);
+                       final ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
+                       createInstance(transaction, this.factory.getImplementationName(), this.instanceName, 400, 100, true, null, true, true);
                        transaction.validateConfig();
                        fail();
-               } catch (ValidationException e) {
+               } catch (final ValidationException e) {
                        assertTrue(e.getMessage().contains("Active value is not set"));
                }
        }
 
        @Test
-       public void testValidationExceptionVersionedNotSet()
-                       throws InstanceAlreadyExistsException {
+       public void testValidationExceptionInstantiatedNotSet() throws InstanceAlreadyExistsException {
                try {
-                       ConfigTransactionJMXClient transaction = configRegistryClient
-                                       .createTransaction();
-                       createInstance(transaction, this.factory.getImplementationName(),
-                                       instanceName, 400, 100, true, true, null, true);
+                       final ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
+                       createInstance(transaction, this.factory.getImplementationName(), this.instanceName, 400, 100, true, true, true, null);
                        transaction.validateConfig();
                        fail();
-               } catch (ValidationException e) {
-                       assertTrue(e.getMessage().contains("Versioned value is not set"));
-               }
-       }
-
-       @Test
-       public void testValidationExceptionInstantiatedNotSet()
-                       throws InstanceAlreadyExistsException {
-               try {
-                       ConfigTransactionJMXClient transaction = configRegistryClient
-                                       .createTransaction();
-                       createInstance(transaction, this.factory.getImplementationName(),
-                                       instanceName, 400, 100, true, true, true, null);
-                       transaction.validateConfig();
-                       fail();
-               } catch (ValidationException e) {
+               } catch (final ValidationException e) {
                        assertTrue(e.getMessage().contains("Initiated value is not set"));
                }
        }
 
        @Test
-       public void testValidationExceptionKeepAliveTimerMinValue()
-                       throws InstanceAlreadyExistsException {
+       public void testValidationExceptionKeepAliveTimerMinValue() throws InstanceAlreadyExistsException {
                try {
-                       ConfigTransactionJMXClient transaction = configRegistryClient
-                                       .createTransaction();
-                       createInstance(transaction, this.factory.getImplementationName(),
-                                       instanceName, 400, -10, true, true, true, true);
+                       final ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
+                       createInstance(transaction, this.factory.getImplementationName(), this.instanceName, 400, -10, true, true, true, true);
                        transaction.validateConfig();
                        fail();
-               } catch (ValidationException e) {
+               } catch (final ValidationException e) {
                        assertTrue(e.getMessage().contains("minimum value is 1."));
                }
        }
 
        @Test
-       public void testStatefulAfterCommitted()
-                       throws InstanceAlreadyExistsException, InstanceNotFoundException {
-               ConfigTransactionJMXClient transaction = configRegistryClient
-                               .createTransaction();
-               createInstance(transaction, this.factory.getImplementationName(),
-                               instanceName, 400, 100, false, true, true, true);
+       public void testStatefulAfterCommitted() throws InstanceAlreadyExistsException, InstanceNotFoundException {
+               ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
+               createInstance(transaction, this.factory.getImplementationName(), this.instanceName, 400, 100, false, true, true, true);
                transaction.validateConfig();
                transaction.commit();
-               transaction = configRegistryClient.createTransaction();
-               PCEPSessionProposalFactoryImplModuleMXBean mxBean = transaction
-                               .newMBeanProxy(
-                                               transaction
-                                               .lookupConfigBean(
-                                                               AbstractPCEPSessionProposalFactoryImplModuleFactory.NAME,
-                                                               instanceName),
-                                                               PCEPSessionProposalFactoryImplModuleMXBean.class);
+               transaction = this.configRegistryClient.createTransaction();
+               final PCEPSessionProposalFactoryImplModuleMXBean mxBean = transaction.newMBeanProxy(
+                               transaction.lookupConfigBean(AbstractPCEPSessionProposalFactoryImplModuleFactory.NAME, this.instanceName),
+                               PCEPSessionProposalFactoryImplModuleMXBean.class);
                assertTrue(mxBean.getStateful());
        }
 
        @Test
        public void testCreateBean() throws Exception {
-               ConfigTransactionJMXClient transaction = configRegistryClient
-                               .createTransaction();
-               createInstance(transaction, this.factory.getImplementationName(),
-                               instanceName, 0, 0, true, true, true, true);
+               final ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
+               createInstance(transaction, this.factory.getImplementationName(), this.instanceName, 0, 0, true, true, true, true);
                transaction.validateConfig();
-               CommitStatus status = transaction.commit();
-               assertBeanCount(1, factory.getImplementationName());
+               final CommitStatus status = transaction.commit();
+               assertBeanCount(1, this.factory.getImplementationName());
                assertStatus(status, 1, 0, 0);
        }
 
        @Test
-       public void testReusingOldInstance() throws InstanceAlreadyExistsException,
-       ConflictingVersionException, ValidationException {
-               ConfigTransactionJMXClient transaction = configRegistryClient
-                               .createTransaction();
-               createInstance(transaction, this.factory.getImplementationName(),
-                               instanceName, 400, 100, true, true, true, true);
+       public void testReusingOldInstance() throws InstanceAlreadyExistsException, ConflictingVersionException, ValidationException {
+               ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
+               createInstance(transaction, this.factory.getImplementationName(), this.instanceName, 400, 100, true, true, true, true);
                transaction.commit();
-               transaction = configRegistryClient.createTransaction();
-               assertBeanCount(1, factory.getImplementationName());
-               CommitStatus status = transaction.commit();
-               assertBeanCount(1, factory.getImplementationName());
+               transaction = this.configRegistryClient.createTransaction();
+               assertBeanCount(1, this.factory.getImplementationName());
+               final CommitStatus status = transaction.commit();
+               assertBeanCount(1, this.factory.getImplementationName());
                assertStatus(status, 0, 0, 1);
        }
 
        @Test
-       public void testReconfigure() throws InstanceAlreadyExistsException,
-       ConflictingVersionException, ValidationException,
-       InstanceNotFoundException {
-               ConfigTransactionJMXClient transaction = configRegistryClient
-                               .createTransaction();
-               createInstance(transaction, this.factory.getImplementationName(),
-                               instanceName, 400, 100, true, true, true, true);
+       public void testReconfigure() throws InstanceAlreadyExistsException, ConflictingVersionException, ValidationException,
+                       InstanceNotFoundException {
+               ConfigTransactionJMXClient transaction = this.configRegistryClient.createTransaction();
+               createInstance(transaction, this.factory.getImplementationName(), this.instanceName, 400, 100, true, true, true, true);
                transaction.commit();
-               transaction = configRegistryClient.createTransaction();
-               assertBeanCount(1, factory.getImplementationName());
-               PCEPSessionProposalFactoryImplModuleMXBean mxBean = transaction
-                               .newMBeanProxy(
-                                               transaction
-                                               .lookupConfigBean(
-                                                               AbstractPCEPSessionProposalFactoryImplModuleFactory.NAME,
-                                                               instanceName),
-                                                               PCEPSessionProposalFactoryImplModuleMXBean.class);
-               CommitStatus status = transaction.commit();
-               assertBeanCount(1, factory.getImplementationName());
+               transaction = this.configRegistryClient.createTransaction();
+               assertBeanCount(1, this.factory.getImplementationName());
+               final PCEPSessionProposalFactoryImplModuleMXBean mxBean = transaction.newMBeanProxy(
+                               transaction.lookupConfigBean(AbstractPCEPSessionProposalFactoryImplModuleFactory.NAME, this.instanceName),
+                               PCEPSessionProposalFactoryImplModuleMXBean.class);
+               final CommitStatus status = transaction.commit();
+               assertBeanCount(1, this.factory.getImplementationName());
                assertStatus(status, 0, 0, 1);
        }
 
-       public static ObjectName createInstance(
-                       final ConfigTransactionJMXClient transaction,
-                       final String moduleName, final String instanceName,
-                       final Integer deadTimer, final Integer keepAlive,
-                       final Boolean stateful, final Boolean active,
+       public static ObjectName createInstance(final ConfigTransactionJMXClient transaction, final String moduleName,
+                       final String instanceName, final Integer deadTimer, final Integer keepAlive, final Boolean stateful, final Boolean active,
                        final Boolean versioned, final Boolean instant) throws InstanceAlreadyExistsException {
-               ObjectName nameCreated = transaction.createModule(moduleName,
-                               instanceName);
-               PCEPSessionProposalFactoryImplModuleMXBean mxBean = transaction
-                               .newMBeanProxy(nameCreated,
-                                               PCEPSessionProposalFactoryImplModuleMXBean.class);
+               final ObjectName nameCreated = transaction.createModule(moduleName, instanceName);
+               final PCEPSessionProposalFactoryImplModuleMXBean mxBean = transaction.newMBeanProxy(nameCreated,
+                               PCEPSessionProposalFactoryImplModuleMXBean.class);
                mxBean.setActive(active);
                mxBean.setDeadTimerValue(deadTimer);
                mxBean.setInitiated(instant);
index 56d3b7da1f23b5f13453179d772c68aee5b36785..8bfa59c80018d3085e59b1c640c96cd042ddeeef 100644 (file)
@@ -29,7 +29,6 @@ import org.opendaylight.protocol.pcep.PCEPSession;
 import org.opendaylight.protocol.pcep.PCEPSessionListener;
 import org.opendaylight.protocol.pcep.TerminationReason;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.Tlvs2;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.CloseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Keepalive;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.KeepaliveBuilder;
@@ -46,7 +45,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Charsets;
 import com.google.common.base.Objects;
 import com.google.common.base.Objects.ToStringHelper;
 import com.google.common.base.Preconditions;
@@ -395,9 +393,6 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
 
        @Override
        public String getNodeIdentifier() {
-               if (this.remoteOpen.getTlvs() == null && this.remoteOpen.getTlvs().getAugmentation(Tlvs2.class).getPredundancyGroupId() != null) {
-                       return new String(this.remoteOpen.getTlvs().getAugmentation(Tlvs2.class).getPredundancyGroupId().getIdentifier(), Charsets.UTF_8);
-               }
                return "";
        }
 }
index fa4c38b157599ffba278126b6209ef0db38f019e..978e26d6f0260088eb5449f723fbd73b03ac001a 100644 (file)
@@ -23,15 +23,14 @@ public class PCEPSessionProposalFactoryImpl implements PCEPSessionProposalFactor
 
        private final int keepAlive, deadTimer;
 
-       private final boolean stateful, active, versioned, instant;
+       private final boolean stateful, active, instant;
 
        public PCEPSessionProposalFactoryImpl(final int deadTimer, final int keepAlive, final boolean stateful, final boolean active,
-                       final boolean versioned, final boolean instant) {
+                       final boolean instant) {
                this.deadTimer = deadTimer;
                this.keepAlive = keepAlive;
                this.stateful = stateful;
                this.active = active;
-               this.versioned = versioned;
                this.instant = instant;
        }
 
@@ -42,8 +41,8 @@ public class PCEPSessionProposalFactoryImpl implements PCEPSessionProposalFactor
                        builder.addAugmentation(
                                        Tlvs2.class,
                                        new Tlvs2Builder().setStateful(
-                                                       new StatefulBuilder().setIncludeDbVersion(this.versioned).setLspUpdateCapability(this.active).addAugmentation(
-                                                                       Stateful1.class, new Stateful1Builder().setInitiation(this.instant).build()).build()).build()).build();
+                                                       new StatefulBuilder().setLspUpdateCapability(this.active).addAugmentation(Stateful1.class,
+                                                                       new Stateful1Builder().setInitiation(this.instant).build()).build()).build()).build();
                }
                final OpenBuilder oBuilder = new OpenBuilder();
                oBuilder.setSessionId((short) sessionId);
@@ -72,8 +71,9 @@ public class PCEPSessionProposalFactoryImpl implements PCEPSessionProposalFactor
                return this.active;
        }
 
+       @Deprecated
        public boolean isVersioned() {
-               return this.versioned;
+               return false;
        }
 
        public boolean isInstant() {
index ce0634d592a95470cefe96f84178f697f78ab6ac..dfbcb9825a681fa04ae271bed1cdea1b93608a4d 100644 (file)
@@ -19,11 +19,9 @@ import org.opendaylight.protocol.pcep.impl.object.PCEPOpenObjectParser;
 import org.opendaylight.protocol.pcep.impl.object.PCEPSrpObjectParser;
 import org.opendaylight.protocol.pcep.impl.tlv.LSPIdentifierIpv4TlvParser;
 import org.opendaylight.protocol.pcep.impl.tlv.LSPIdentifierIpv6TlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.LspDbVersionTlvParser;
 import org.opendaylight.protocol.pcep.impl.tlv.LspSymbolicNameTlvParser;
 import org.opendaylight.protocol.pcep.impl.tlv.LspUpdateErrorTlvParser;
 import org.opendaylight.protocol.pcep.impl.tlv.PCEStatefulCapabilityTlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.PredundancyGroupTlvParser;
 import org.opendaylight.protocol.pcep.impl.tlv.RSVPErrorSpecTlvParser;
 import org.opendaylight.protocol.pcep.spi.ObjectHandlerRegistry;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
@@ -31,11 +29,9 @@ import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
 import org.opendaylight.protocol.pcep.spi.pojo.AbstractPCEPExtensionProviderActivator;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.Pcrpt;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.Pcupd;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.db.version.tlv.LspDbVersion;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.error.code.tlv.LspErrorCode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.identifiers.tlv.LspIdentifiers;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.object.Lsp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.predundancy.group.id.tlv.PredundancyGroupId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.rsvp.error.spec.tlv.RsvpErrorSpec;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.srp.object.Srp;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.stateful.capability.tlv.Stateful;
@@ -67,8 +63,6 @@ public final class StatefulActivator extends AbstractPCEPExtensionProviderActiva
                regs.add(context.registerObjectParser(PCEPOpenObjectParser.CLASS, PCEPOpenObjectParser.TYPE, new PCEPOpenObjectParser(tlvReg)));
                regs.add(context.registerObjectSerializer(Open.class, new PCEPOpenObjectParser(tlvReg)));
 
-               regs.add(context.registerTlvParser(LspDbVersionTlvParser.TYPE, new LspDbVersionTlvParser()));
-               regs.add(context.registerTlvSerializer(LspDbVersion.class, new LspDbVersionTlvParser()));
                regs.add(context.registerTlvParser(LSPIdentifierIpv4TlvParser.TYPE, new LSPIdentifierIpv4TlvParser()));
                regs.add(context.registerTlvParser(LSPIdentifierIpv6TlvParser.TYPE, new LSPIdentifierIpv6TlvParser()));
                regs.add(context.registerTlvSerializer(LspIdentifiers.class, new LSPIdentifierIpv4TlvParser()));
@@ -80,8 +74,6 @@ public final class StatefulActivator extends AbstractPCEPExtensionProviderActiva
                regs.add(context.registerTlvSerializer(Stateful.class, new PCEStatefulCapabilityTlvParser()));
                regs.add(context.registerTlvParser(LspSymbolicNameTlvParser.TYPE, new LspSymbolicNameTlvParser()));
                regs.add(context.registerTlvSerializer(SymbolicPathName.class, new LspSymbolicNameTlvParser()));
-               regs.add(context.registerTlvParser(PredundancyGroupTlvParser.TYPE, new PredundancyGroupTlvParser()));
-               regs.add(context.registerTlvSerializer(PredundancyGroupId.class, new PredundancyGroupTlvParser()));
 
                return regs;
        }
index 6f8cdbd4014c993886d14092a56a73af8d2e3349..6fc9192a2cf36e357e79c0c356557d6cae67db86 100644 (file)
@@ -9,12 +9,17 @@ package org.opendaylight.protocol.pcep.impl.message;
 
 import io.netty.buffer.ByteBuf;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.opendaylight.protocol.pcep.spi.ObjectHandlerRegistry;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.UnknownObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.pcerr.pcerr.message.error.type.StatefulCase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.pcerr.pcerr.message.error.type.stateful._case.stateful.Srps;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.pcerr.pcerr.message.error.type.stateful._case.stateful.SrpsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.srp.object.Srp;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.PcerrBuilder;
 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.Object;
@@ -34,8 +39,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcerr.message.pcerr.message.error.type.session._case.SessionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.rp.object.Rp;
 
-import com.google.common.collect.Lists;
-
 /**
  * Parser for {@link PcerrMessage}
  */
@@ -66,6 +69,13 @@ public class PCEPErrorMessageParser extends AbstractMessageParser {
                        }
                }
 
+               if (err.getErrorType() instanceof StatefulCase) {
+                       final List<Srps> srps = ((StatefulCase) err.getErrorType()).getStateful().getSrps();
+                       for (final Srps s : srps) {
+                               buffer.writeBytes(serializeObject(s.getSrp()));
+                       }
+               }
+
                for (final Errors e : err.getErrors()) {
                        buffer.writeBytes(serializeObject(e.getErrorObject()));
                }
@@ -85,8 +95,9 @@ public class PCEPErrorMessageParser extends AbstractMessageParser {
                        throw new PCEPDeserializerException("Error message is empty.");
                }
 
-               final List<Rps> requestParameters = Lists.newArrayList();
-               final List<Errors> errorObjects = Lists.newArrayList();
+               final List<Rps> requestParameters = new ArrayList<>();
+               final List<Srps> srps = new ArrayList<>();
+               final List<Errors> errorObjects = new ArrayList<>();
                final PcerrMessageBuilder b = new PcerrMessageBuilder();
 
                Object obj;
@@ -99,7 +110,7 @@ public class PCEPErrorMessageParser extends AbstractMessageParser {
                        state = State.ErrorIn;
                        objects.remove(0);
                } else if (obj instanceof Rp) {
-                       final Rp o = ((Rp) obj);
+                       final Rp o = (Rp) obj;
                        if (o.isProcessingRule()) {
                                errors.add(createErrorMsg(PCEPErrors.P_FLAG_NOT_SET));
                                return null;
@@ -107,6 +118,11 @@ public class PCEPErrorMessageParser extends AbstractMessageParser {
                        requestParameters.add(new RpsBuilder().setRp(o).build());
                        state = State.RpIn;
                        objects.remove(0);
+               } else if (obj instanceof Srp) {
+                       final Srp s = (Srp) obj;
+                       srps.add(new SrpsBuilder().setSrp(s).build());
+                       state = State.SrpIn;
+                       objects.remove(0);
                }
 
                while (!objects.isEmpty()) {
@@ -133,6 +149,14 @@ public class PCEPErrorMessageParser extends AbstractMessageParser {
                                        state = State.RpIn;
                                        break;
                                }
+                       case SrpIn:
+                               state = State.Error;
+                               if (obj instanceof Srp) {
+                                       final Srp o = ((Srp) obj);
+                                       srps.add(new SrpsBuilder().setSrp(o).build());
+                                       state = State.SrpIn;
+                                       break;
+                               }
                        case Open:
                                state = State.OpenIn;
                                if (obj instanceof Open) {
@@ -175,7 +199,7 @@ public class PCEPErrorMessageParser extends AbstractMessageParser {
        }
 
        private enum State {
-               Init, ErrorIn, RpIn, Open, Error, OpenIn, End
+               Init, ErrorIn, RpIn, SrpIn, Open, Error, OpenIn, End
        }
 
        @Override
index b07ddc25fff0be68912021672c3e8b3d6b151797..10446ba3db93274b1fcc0902a42f7e1819f50d3c 100644 (file)
@@ -62,9 +62,7 @@ public class PCEPReportMessageParser extends AbstractMessageParser {
                        buffer.writeBytes(serializeObject(report.getLsp()));
                        final Path p = report.getPath();
                        if (p != null) {
-                               if (p.getEro() != null) {
-                                       buffer.writeBytes(serializeObject(p.getEro()));
-                               }
+                               buffer.writeBytes(serializeObject(p.getEro()));
                                if (p.getLspa() != null) {
                                        buffer.writeBytes(serializeObject(p.getLspa()));
                                }
index 97cb6ab433b5e4ff9b606a617035bf3688407aaf..4344fc84dfec82b34c9573b01358222a2245ce7e 100644 (file)
@@ -14,9 +14,6 @@ import java.util.List;
 import org.opendaylight.protocol.pcep.spi.ObjectHandlerRegistry;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.P2p1;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.P2p1Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.object.Lsp;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.Pcreq;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev131007.PcreqBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
@@ -149,11 +146,6 @@ public class PCEPRequestMessageParser extends AbstractMessageParser {
                if (p2p.getClassType() != null) {
                        buffer.writeBytes(serializeObject(p2p.getClassType()));
                }
-
-               final P2p1 stateful = p2p.getAugmentation(P2p1.class);
-               if (stateful != null && stateful.getLsp() != null) {
-                       buffer.writeBytes(serializeObject(stateful.getLsp()));
-               }
        }
 
        @Override
@@ -313,12 +305,6 @@ public class PCEPRequestMessageParser extends AbstractMessageParser {
                                        break;
                                }
                        case CtIn:
-                               state = State.LspIn;
-                               if (obj instanceof Lsp) {
-                                       builder.addAugmentation(P2p1.class, new P2p1Builder().setLsp((Lsp)obj).build());
-                                       break;
-                               }
-                       case LspIn:
                                state = State.End;
                                break;
                        case End:
@@ -336,7 +322,7 @@ public class PCEPRequestMessageParser extends AbstractMessageParser {
                                && builder.getBandwidth() != null
                                && builder.getReportedRoute().getBandwidth().getBandwidth() != new BandwidthBuilder().setBandwidth(
                                                new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.Bandwidth(new byte[] { 0 })).build()
-                                               && builder.getReportedRoute().getRro() == null) {
+                               && builder.getReportedRoute().getRro() == null) {
                        errors.add(createErrorMsg(PCEPErrors.RRO_MISSING, rp));
                        return null;
                }
@@ -344,7 +330,7 @@ public class PCEPRequestMessageParser extends AbstractMessageParser {
        }
 
        private enum State {
-               Init, ReportedIn, LoadBIn, LspaIn, BandwidthIn, MetricIn, IroIn, RroIn, XroIn, OfIn, CtIn, LspIn, End
+               Init, ReportedIn, LoadBIn, LspaIn, BandwidthIn, MetricIn, IroIn, RroIn, XroIn, OfIn, CtIn, End
        }
 
        private Svec getValidSvec(final SvecBuilder builder, final List<Object> objects) {
index 2335710187095beb4692173b84703d0f7c7fee23..e8a8eb02bccb42d62bf85931f94fdcce46e5ed3a 100644 (file)
@@ -15,8 +15,6 @@ import org.opendaylight.protocol.pcep.spi.UnknownObject;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.Tlvs2;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.Tlvs2Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.db.version.tlv.LspDbVersion;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.predundancy.group.id.tlv.PredundancyGroupId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.stateful.capability.tlv.Stateful;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ObjectHeader;
@@ -109,12 +107,6 @@ public class PCEPOpenObjectParser extends AbstractObjectWithTlvsParser<TlvsBuild
                final Tlvs2Builder statefulBuilder = new Tlvs2Builder();
                if (tbuilder.getAugmentation(Tlvs2.class) != null) {
                        final Tlvs2 t = tbuilder.getAugmentation(Tlvs2.class);
-                       if (t.getLspDbVersion() != null) {
-                               statefulBuilder.setLspDbVersion(t.getLspDbVersion());
-                       }
-                       if (t.getPredundancyGroupId() != null) {
-                               statefulBuilder.setPredundancyGroupId(t.getPredundancyGroupId());
-                       }
                        if (t.getClass() != null) {
                                statefulBuilder.setStateful(t.getStateful());
                        }
@@ -123,10 +115,6 @@ public class PCEPOpenObjectParser extends AbstractObjectWithTlvsParser<TlvsBuild
                        tbuilder.setOfList((OfList) tlv);
                } else if (tlv instanceof Stateful) {
                        statefulBuilder.setStateful((Stateful) tlv);
-               } else if (tlv instanceof PredundancyGroupId) {
-                       statefulBuilder.setPredundancyGroupId((PredundancyGroupId) tlv);
-               } else if (tlv instanceof LspDbVersion) {
-                       statefulBuilder.setLspDbVersion((LspDbVersion) tlv);
                }
                tbuilder.addAugmentation(Tlvs2.class, statefulBuilder.build());
        }
@@ -161,8 +149,6 @@ public class PCEPOpenObjectParser extends AbstractObjectWithTlvsParser<TlvsBuild
                int finalLength = 0;
                byte[] ofListBytes = null;
                byte[] statefulBytes = null;
-               byte[] predundancyBytes = null;
-               byte[] lspDbBytes = null;
                if (tlvs.getOfList() != null) {
                        ofListBytes = serializeTlv(tlvs.getOfList());
                        finalLength += ofListBytes.length;
@@ -173,14 +159,6 @@ public class PCEPOpenObjectParser extends AbstractObjectWithTlvsParser<TlvsBuild
                                statefulBytes = serializeTlv(statefulTlvs.getStateful());
                                finalLength += statefulBytes.length;
                        }
-                       if (statefulTlvs.getPredundancyGroupId() != null) {
-                               predundancyBytes = serializeTlv(statefulTlvs.getPredundancyGroupId());
-                               finalLength += predundancyBytes.length;
-                       }
-                       if (statefulTlvs.getLspDbVersion() != null) {
-                               lspDbBytes = serializeTlv(statefulTlvs.getLspDbVersion());
-                               finalLength += lspDbBytes.length;
-                       }
                }
 
                int offset = 0;
@@ -193,14 +171,6 @@ public class PCEPOpenObjectParser extends AbstractObjectWithTlvsParser<TlvsBuild
                        ByteArray.copyWhole(statefulBytes, result, offset);
                        offset += statefulBytes.length;
                }
-               if (lspDbBytes != null) {
-                       ByteArray.copyWhole(lspDbBytes, result, offset);
-                       offset += lspDbBytes.length;
-               }
-               if (predundancyBytes != null) {
-                       ByteArray.copyWhole(predundancyBytes, result, offset);
-                       offset += predundancyBytes.length;
-               }
                return result;
        }
 
index 7ced388881ace8c6389de5dc1a81998c3de47aa8..3b50bb74424a400197d49be3c1491314e71534ed 100644 (file)
@@ -15,6 +15,9 @@ import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.SrpIdNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.srp.object.Srp;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.srp.object.SrpBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.srp.object.srp.Tlvs;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.srp.object.srp.TlvsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.symbolic.path.name.tlv.SymbolicPathName;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ObjectHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Tlv;
@@ -32,6 +35,8 @@ public final class PCEPSrpObjectParser extends AbstractObjectWithTlvsParser<SrpB
 
        private static final int SRP_ID_SIZE = 4;
 
+       private static final int TLVS_OFFSET = FLAGS_SIZE + SRP_ID_SIZE;
+
        private static final int MIN_SIZE = FLAGS_SIZE + SRP_ID_SIZE;
 
        public PCEPSrpObjectParser(final TlvHandlerRegistry tlvReg) {
@@ -63,7 +68,9 @@ public final class PCEPSrpObjectParser extends AbstractObjectWithTlvsParser<SrpB
 
        @Override
        public void addTlv(final SrpBuilder builder, final Tlv tlv) {
-               // No tlvs defined
+               if (tlv instanceof SymbolicPathName) {
+                       builder.setTlvs(new TlvsBuilder().setSymbolicPathName((SymbolicPathName) tlv).build());
+               }
        }
 
        @Override
@@ -72,15 +79,29 @@ public final class PCEPSrpObjectParser extends AbstractObjectWithTlvsParser<SrpB
                        throw new IllegalArgumentException("Wrong instance of PCEPObject. Passed " + object.getClass() + ". Needed SrpObject.");
                }
                final Srp srp = (Srp) object;
+               final byte[] tlvs = serializeTlvs(srp.getTlvs());
                final Long id = srp.getOperationId().getValue();
                if (id == 0 || id == 0xFFFFFFFFL) {
                        throw new IllegalArgumentException("Min/Max values for SRP ID are reserved.");
                }
                final byte[] retBytes = new byte[MIN_SIZE];
+               if (tlvs != null) {
+                       ByteArray.copyWhole(tlvs, retBytes, TLVS_OFFSET);
+               }
                System.arraycopy(ByteArray.intToBytes(id.intValue(), SRP_ID_SIZE), 0, retBytes, FLAGS_SIZE, SRP_ID_SIZE);
+               ByteArray.copyWhole(tlvs, retBytes, TLVS_OFFSET);
                return ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), retBytes);
        }
 
+       public byte[] serializeTlvs(final Tlvs tlvs) {
+               if (tlvs == null) {
+                       return new byte[0];
+               } else if (tlvs.getSymbolicPathName() != null) {
+                       return serializeTlv(tlvs.getSymbolicPathName());
+               }
+               return new byte[0];
+       }
+
        @Override
        public int getObjectType() {
                return TYPE;
index 13c1b878d364c0e17222941ec1b40c81d6a46595..b054c953552bac7826e21895611098a51ee63d79 100644 (file)
@@ -38,7 +38,7 @@ public class LSPIdentifierIpv4TlvParser implements TlvParser, TlvSerializer {
        private static final int LSP_ID_F_LENGTH = 2;
        private static final int TUNNEL_ID_F_LENGTH = 2;
 
-       private static final int V4_LENGTH = 12;
+       private static final int V4_LENGTH = 16;
 
        @Override
        public LspIdentifiers parseTlv(final byte[] valueBytes) throws PCEPDeserializerException {
@@ -58,8 +58,9 @@ public class LSPIdentifierIpv4TlvParser implements TlvParser, TlvSerializer {
                position += TUNNEL_ID_F_LENGTH;
                builder.setIpv4ExtendedTunnelId(new Ipv4ExtendedTunnelId(Ipv4Util.addressForBytes(ByteArray.subByte(valueBytes, position,
                                EX_TUNNEL_ID4_F_LENGTH))));
-               final AddressFamily afi = new Ipv4CaseBuilder().setIpv4(builder.build()).build();
                position += EX_TUNNEL_ID4_F_LENGTH;
+               builder.setIpv4TunnelEndpointAddress(Ipv4Util.addressForBytes(ByteArray.subByte(valueBytes, position, IP4_F_LENGTH)));
+               final AddressFamily afi = new Ipv4CaseBuilder().setIpv4(builder.build()).build();
                return new LspIdentifiersBuilder().setAddressFamily(afi).setLspId(lspId).setTunnelId(tunnelId).build();
        }
 
@@ -85,6 +86,8 @@ public class LSPIdentifierIpv4TlvParser implements TlvParser, TlvSerializer {
                ByteArray.copyWhole(ByteArray.intToBytes(lsp.getTunnelId().getValue(), TUNNEL_ID_F_LENGTH), bytes, offset);
                offset += TUNNEL_ID_F_LENGTH;
                ByteArray.copyWhole(Ipv4Util.bytesForAddress(ipv4.getIpv4ExtendedTunnelId()), bytes, offset);
+               offset += EX_TUNNEL_ID4_F_LENGTH;
+               ByteArray.copyWhole(Ipv4Util.bytesForAddress(ipv4.getIpv4TunnelEndpointAddress()), bytes, offset);
                return bytes;
        }
 
index b838b079cc0e1170347109e29cae0d0c0953edcf..6849c2a4042c4f32557a6b580e905cd41f3273a3 100644 (file)
@@ -37,7 +37,7 @@ public class LSPIdentifierIpv6TlvParser implements TlvParser, TlvSerializer {
        private static final int LSP_ID_F_LENGTH = 2;
        private static final int TUNNEL_ID_F_LENGTH = 2;
 
-       private static final int V6_LENGTH = 36;
+       private static final int V6_LENGTH = 52;
 
        @Override
        public LspIdentifiers parseTlv(final byte[] valueBytes) throws PCEPDeserializerException {
@@ -57,8 +57,9 @@ public class LSPIdentifierIpv6TlvParser implements TlvParser, TlvSerializer {
                position += TUNNEL_ID_F_LENGTH;
                builder.setIpv6ExtendedTunnelId(new Ipv6ExtendedTunnelId(Ipv6Util.addressForBytes(ByteArray.subByte(valueBytes, position,
                                EX_TUNNEL_ID6_F_LENGTH))));
-               final AddressFamily afi = new Ipv6CaseBuilder().setIpv6(builder.build()).build();
                position += EX_TUNNEL_ID6_F_LENGTH;
+               builder.setIpv6TunnelEndpointAddress(Ipv6Util.addressForBytes(ByteArray.subByte(valueBytes, position, IP6_F_LENGTH)));
+               final AddressFamily afi = new Ipv6CaseBuilder().setIpv6(builder.build()).build();
                return new LspIdentifiersBuilder().setAddressFamily(afi).setLspId(lspId).setTunnelId(tunnelId).build();
        }
 
@@ -78,6 +79,8 @@ public class LSPIdentifierIpv6TlvParser implements TlvParser, TlvSerializer {
                ByteArray.copyWhole(ByteArray.intToBytes(lsp.getTunnelId().getValue(), TUNNEL_ID_F_LENGTH), bytes, offset);
                offset += TUNNEL_ID_F_LENGTH;
                ByteArray.copyWhole(Ipv6Util.bytesForAddress(ipv6.getIpv6ExtendedTunnelId()), bytes, offset);
+               offset += EX_TUNNEL_ID6_F_LENGTH;
+               ByteArray.copyWhole(Ipv6Util.bytesForAddress(ipv6.getIpv6TunnelEndpointAddress()), bytes, offset);
                return bytes;
        }
 
diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/tlv/LspDbVersionTlvParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/tlv/LspDbVersionTlvParser.java
deleted file mode 100644 (file)
index 1dae8d6..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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.impl.tlv;
-
-import java.util.Arrays;
-
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.spi.TlvParser;
-import org.opendaylight.protocol.pcep.spi.TlvSerializer;
-import org.opendaylight.protocol.util.ByteArray;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.db.version.tlv.LspDbVersion;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.db.version.tlv.LspDbVersionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Tlv;
-
-import com.google.common.primitives.UnsignedLong;
-
-/**
- * Parser for {@link LspDbVersion}
- */
-public class LspDbVersionTlvParser implements TlvParser, TlvSerializer {
-
-       public static final int TYPE = 23;
-
-       private static final int DBV_F_LENGTH = 8;
-
-       @Override
-       public LspDbVersion parseTlv(final byte[] buffer) throws PCEPDeserializerException {
-               return new LspDbVersionBuilder().setVersion(
-                               UnsignedLong.fromLongBits(ByteArray.bytesToLong(ByteArray.subByte(buffer, 0, DBV_F_LENGTH))).bigIntegerValue()).build();
-       }
-
-       @Override
-       public byte[] serializeTlv(final Tlv tlv) {
-               if (tlv == null) {
-                       throw new IllegalArgumentException("LspDbVersionTlv is mandatory.");
-               }
-               final LspDbVersion lsp = (LspDbVersion) tlv;
-               final byte[] array = ByteArray.longToBytes(UnsignedLong.valueOf(lsp.getVersion()).longValue(), DBV_F_LENGTH);
-               if (array.length > DBV_F_LENGTH) {
-                       throw new IllegalArgumentException("LspDBVersion too big.");
-               }
-               final byte[] result = new byte[DBV_F_LENGTH];
-               Arrays.fill(result, (byte) 0);
-               int j = 7;
-               for (int i = array.length - 1; i >= 0; i--) {
-                       result[j] |= array[i];
-                       j--;
-               }
-               return result;
-       }
-
-       @Override
-       public int getType() {
-               return TYPE;
-       }
-}
index 94b6d9e7652057aa7c1197b1a2a4650ef050eaf2..b822c437df3f16d506d677851fd1fb371cbedb16 100644 (file)
@@ -29,7 +29,6 @@ public final class PCEStatefulCapabilityTlvParser implements TlvParser, TlvSeria
        private static final int FLAGS_F_LENGTH = 4;
 
        private static final int I_FLAG_OFFSET = 29;
-       private static final int S_FLAG_OFFSET = 30;
        private static final int U_FLAG_OFFSET = 31;
 
        @Override
@@ -41,17 +40,14 @@ public final class PCEStatefulCapabilityTlvParser implements TlvParser, TlvSeria
                        throw new PCEPDeserializerException("Wrong length of array of bytes. Passed: " + buffer.length + "; Expected: >= "
                                        + FLAGS_F_LENGTH + ".");
                }
-
                final BitSet flags = ByteArray.bytesToBitSet(ByteArray.subByte(buffer, 0, FLAGS_F_LENGTH));
 
                final StatefulBuilder sb = new StatefulBuilder();
-               sb.setIncludeDbVersion(flags.get(S_FLAG_OFFSET));
                sb.setLspUpdateCapability(flags.get(U_FLAG_OFFSET));
 
                if (flags.get(I_FLAG_OFFSET)) {
                        sb.addAugmentation(Stateful1.class, new Stateful1Builder().setInitiation(Boolean.TRUE).build());
                }
-
                return sb.build();
        }
 
@@ -68,10 +64,7 @@ public final class PCEStatefulCapabilityTlvParser implements TlvParser, TlvSeria
                if (sfi != null) {
                        flags.set(I_FLAG_OFFSET, sfi.isInitiation());
                }
-
                flags.set(U_FLAG_OFFSET, sct.isLspUpdateCapability());
-               flags.set(S_FLAG_OFFSET, sct.isIncludeDbVersion());
-
                return ByteArray.bitSetToBytes(flags, FLAGS_F_LENGTH);
        }
 
diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/tlv/PredundancyGroupTlvParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/tlv/PredundancyGroupTlvParser.java
deleted file mode 100644 (file)
index 8b5642c..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.impl.tlv;
-
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.spi.TlvParser;
-import org.opendaylight.protocol.pcep.spi.TlvSerializer;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.predundancy.group.id.tlv.PredundancyGroupId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.predundancy.group.id.tlv.PredundancyGroupIdBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Tlv;
-
-/**
- * Parser for {@link PredundancyGroupId}
- */
-public class PredundancyGroupTlvParser implements TlvParser, TlvSerializer {
-
-       public static final int TYPE = 24;
-
-       @Override
-       public PredundancyGroupId parseTlv(final byte[] buffer) throws PCEPDeserializerException {
-               return new PredundancyGroupIdBuilder().setIdentifier(buffer).build();
-       }
-
-       @Override
-       public byte[] serializeTlv(final Tlv tlv) {
-               if (tlv == null) {
-                       throw new IllegalArgumentException("PredundancyGroupIdTlv is mandatory.");
-               }
-               final PredundancyGroupId pgt = (PredundancyGroupId) tlv;
-               return pgt.getIdentifier();
-       }
-
-       @Override
-       public int getType() {
-               return TYPE;
-       }
-}
index 2a91f251b6e2ab24c94865488e61344efe68bcf6..11f776b67cdfe23b4dd94d25837cd9ac11991e44 100644 (file)
@@ -11,7 +11,6 @@ import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 
 import java.io.IOException;
-import java.math.BigInteger;
 import java.util.List;
 
 import org.junit.Before;
@@ -57,13 +56,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.iet
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.SrpIdNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.Tlvs2;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.Tlvs2Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.db.version.tlv.LspDbVersion;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.db.version.tlv.LspDbVersionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.error.code.tlv.LspErrorCode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.error.code.tlv.LspErrorCodeBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.object.LspBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.predundancy.group.id.tlv.PredundancyGroupId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.predundancy.group.id.tlv.PredundancyGroupIdBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.srp.object.SrpBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.stateful.capability.tlv.Stateful;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.stateful.capability.tlv.StatefulBuilder;
@@ -142,16 +137,10 @@ public class PCEPObjectParserTest {
                builder.setDeadTimer((short) 120);
                builder.setSessionId((short) 1);
 
-               final Stateful tlv1 = new StatefulBuilder().setLspUpdateCapability(Boolean.TRUE).setIncludeDbVersion(Boolean.TRUE).build();
-               final LspDbVersion tlv2 = new LspDbVersionBuilder().setVersion(BigInteger.valueOf(0x80L)).build();
-               final byte[] predundancyBytes = { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9a, (byte) 0xbc, (byte) 0xde,
-                               (byte) 0xf0 };
-               final PredundancyGroupId tlv3 = new PredundancyGroupIdBuilder().setIdentifier(predundancyBytes).build();
+               final Stateful tlv1 = new StatefulBuilder().setLspUpdateCapability(Boolean.TRUE).build();
 
                final Tlvs2Builder statBuilder = new Tlvs2Builder();
                statBuilder.setStateful(tlv1);
-               statBuilder.setLspDbVersion(tlv2);
-               statBuilder.setPredundancyGroupId(tlv3);
 
                builder.setTlvs(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.open.TlvsBuilder().addAugmentation(
                                Tlvs2.class, statBuilder.build()).build());
index 188e6d6d48ab16489eae27cf8e9b84b06b5659c0..ddc7996bd0b09eb6b2f37545e33c55b25039ce09 100644 (file)
@@ -17,7 +17,6 @@ import org.opendaylight.protocol.concepts.Ipv4Util;
 import org.opendaylight.protocol.concepts.Ipv6Util;
 import org.opendaylight.protocol.pcep.impl.tlv.LSPIdentifierIpv4TlvParser;
 import org.opendaylight.protocol.pcep.impl.tlv.LSPIdentifierIpv6TlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.LspDbVersionTlvParser;
 import org.opendaylight.protocol.pcep.impl.tlv.LspSymbolicNameTlvParser;
 import org.opendaylight.protocol.pcep.impl.tlv.LspUpdateErrorTlvParser;
 import org.opendaylight.protocol.pcep.impl.tlv.NoPathVectorTlvParser;
@@ -25,14 +24,11 @@ import org.opendaylight.protocol.pcep.impl.tlv.OFListTlvParser;
 import org.opendaylight.protocol.pcep.impl.tlv.OrderTlvParser;
 import org.opendaylight.protocol.pcep.impl.tlv.OverloadedDurationTlvParser;
 import org.opendaylight.protocol.pcep.impl.tlv.PCEStatefulCapabilityTlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.PredundancyGroupTlvParser;
 import org.opendaylight.protocol.pcep.impl.tlv.RSVPErrorSpecTlvParser;
 import org.opendaylight.protocol.pcep.impl.tlv.ReqMissingTlvParser;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.EnterpriseNumber;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.db.version.tlv.LspDbVersion;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.db.version.tlv.LspDbVersionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.error.code.tlv.LspErrorCode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.error.code.tlv.LspErrorCodeBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.identifiers.tlv.LspIdentifiers;
@@ -41,8 +37,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.iet
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.identifiers.tlv.lsp.identifiers.address.family.Ipv6CaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv4._case.Ipv4Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.identifiers.tlv.lsp.identifiers.address.family.ipv6._case.Ipv6Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.predundancy.group.id.tlv.PredundancyGroupId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.predundancy.group.id.tlv.PredundancyGroupIdBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.rsvp.error.spec.tlv.RsvpErrorSpec;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.rsvp.error.spec.tlv.RsvpErrorSpecBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.rsvp.error.spec.tlv.rsvp.error.spec.error.type.RsvpCaseBuilder;
@@ -71,13 +65,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.TunnelId;
 
 import com.google.common.collect.Lists;
-import com.google.common.primitives.UnsignedLong;
 
 public class PCEPTlvParserTest {
 
-       private static final byte[] statefulBytes = { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x02 };
-       private static final byte[] DbVersionBytes = { (byte) 0xff, (byte) 0x00, (byte) 0xff, (byte) 0xaa, (byte) 0xb2, (byte) 0xf5,
-                       (byte) 0xf2, (byte) 0xcf };
+       private static final byte[] statefulBytes = { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x01 };
        private static final byte[] noPathVectorBytes = { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0xa7 };
        private static final byte[] overloadedBytes = { (byte) 0x7f, (byte) 0xff, (byte) 0xff, (byte) 0xff };
        private static final byte[] symbolicNameBytes = { (byte) 0x4d, (byte) 0x65, (byte) 0x64, (byte) 0x20, (byte) 0x74, (byte) 0x65,
@@ -86,12 +77,15 @@ public class PCEPTlvParserTest {
                        (byte) 0x65 };
        private static final byte[] lspUpdateErrorBytes = { (byte) 0x25, (byte) 0x68, (byte) 0x95, (byte) 0x03 };
        private static final byte[] lspIdentifiers4Bytes = { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0xFF, (byte) 0xFF,
-                       (byte) 0x12, (byte) 0x34, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78 };
+                       (byte) 0x12, (byte) 0x34, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x12, (byte) 0x34, (byte) 0x56,
+                       (byte) 0x78 };
        private static final byte[] lspIdentifiers6Bytes = { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9A, (byte) 0xBC,
                        (byte) 0xDE, (byte) 0xF0, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE,
                        (byte) 0xF0, (byte) 0x12, (byte) 0x34, (byte) 0xFF, (byte) 0xFF, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78,
                        (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x01, (byte) 0x23, (byte) 0x45, (byte) 0x67, (byte) 0x01,
-                       (byte) 0x23, (byte) 0x45, (byte) 0x67 };
+                       (byte) 0x23, (byte) 0x45, (byte) 0x67, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9A, (byte) 0xBC,
+                       (byte) 0xDE, (byte) 0xF0, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE,
+                       (byte) 0xF0 };
        private static final byte[] rsvpErrorBytes = { (byte) 0x06, (byte) 0x01, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78,
                        (byte) 0x02, (byte) 0x92, (byte) 0x16, (byte) 0x02 };
        private static final byte[] rsvpError6Bytes = { (byte) 0x06, (byte) 0x02, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78,
@@ -104,24 +98,15 @@ public class PCEPTlvParserTest {
        private static final byte[] orderBytes = { (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0x00, (byte) 0x00, (byte) 0x00,
                        (byte) 0x01 };
        private static final byte[] ofListBytes = { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78 };
-       private static final byte[] predundancyBytes = { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78 };
 
        @Test
        public void testStatefulTlv() throws PCEPDeserializerException {
                final PCEStatefulCapabilityTlvParser parser = new PCEStatefulCapabilityTlvParser();
-               final Stateful tlv = new StatefulBuilder().setLspUpdateCapability(Boolean.FALSE).setIncludeDbVersion(Boolean.TRUE).build();
+               final Stateful tlv = new StatefulBuilder().setLspUpdateCapability(Boolean.TRUE).build();
                assertEquals(tlv, parser.parseTlv(statefulBytes));
                assertArrayEquals(statefulBytes, parser.serializeTlv(tlv));
        }
 
-       @Test
-       public void testStateDbVersionTlv() throws PCEPDeserializerException {
-               final LspDbVersionTlvParser parser = new LspDbVersionTlvParser();
-               final LspDbVersion tlv = new LspDbVersionBuilder().setVersion(UnsignedLong.fromLongBits(0xFF00FFAAB2F5F2CFL).bigIntegerValue()).build();
-               assertEquals(tlv, parser.parseTlv(DbVersionBytes));
-               assertArrayEquals(DbVersionBytes, parser.serializeTlv(tlv));
-       }
-
        @Test
        public void testNoPathVectorTlv() throws PCEPDeserializerException {
                final NoPathVectorTlvParser parser = new NoPathVectorTlvParser();
@@ -163,6 +148,7 @@ public class PCEPTlvParserTest {
                afi.setIpv4TunnelSenderAddress(Ipv4Util.addressForBytes(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78 }));
                afi.setIpv4ExtendedTunnelId(new Ipv4ExtendedTunnelId(Ipv4Util.addressForBytes(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56,
                                (byte) 0x78 })));
+               afi.setIpv4TunnelEndpointAddress(Ipv4Util.addressForBytes(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78 }));
                final LspIdentifiers tlv = new LspIdentifiersBuilder().setAddressFamily(new Ipv4CaseBuilder().setIpv4(afi.build()).build()).setLspId(
                                new LspId(65535L)).setTunnelId(new TunnelId(4660)).build();
                assertEquals(tlv, parser.parseTlv(lspIdentifiers4Bytes));
@@ -179,6 +165,9 @@ public class PCEPTlvParserTest {
                afi.setIpv6ExtendedTunnelId(new Ipv6ExtendedTunnelId(Ipv6Util.addressForBytes(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56,
                                (byte) 0x78, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x01, (byte) 0x23, (byte) 0x45, (byte) 0x67,
                                (byte) 0x01, (byte) 0x23, (byte) 0x45, (byte) 0x67 })));
+               afi.setIpv6TunnelEndpointAddress(Ipv6Util.addressForBytes(new byte[] { (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78,
+                               (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0xF0, (byte) 0x12, (byte) 0x34, (byte) 0x56, (byte) 0x78, (byte) 0x9A,
+                               (byte) 0xBC, (byte) 0xDE, (byte) 0xF0 }));
                final LspIdentifiers tlv = new LspIdentifiersBuilder().setAddressFamily(new Ipv6CaseBuilder().setIpv6(afi.build()).build()).setLspId(
                                new LspId(4660L)).setTunnelId(new TunnelId(65535)).build();
                assertEquals(tlv, parser.parseTlv(lspIdentifiers6Bytes));
@@ -252,12 +241,4 @@ public class PCEPTlvParserTest {
                assertEquals(tlv, parser.parseTlv(ofListBytes));
                assertArrayEquals(ofListBytes, parser.serializeTlv(tlv));
        }
-
-       @Test
-       public void testPredundancyTlv() throws PCEPDeserializerException {
-               final PredundancyGroupTlvParser parser = new PredundancyGroupTlvParser();
-               final PredundancyGroupId tlv = new PredundancyGroupIdBuilder().setIdentifier(predundancyBytes).build();
-               assertEquals(tlv, parser.parseTlv(predundancyBytes));
-               assertArrayEquals(predundancyBytes, parser.serializeTlv(tlv));
-       }
 }
index 9ea972c4a10043d02542db292891a4a2b229a21e..db210d46d8df26641f108bc8fbb6381e2a575974 100644 (file)
@@ -13,7 +13,6 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 
 import java.io.IOException;
-import java.math.BigInteger;
 import java.util.Collections;
 import java.util.List;
 
@@ -40,16 +39,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.cra
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev131126.pcinitiate.message.pcinitiate.message.Requests;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.crabbe.initiated.rev131126.pcinitiate.message.pcinitiate.message.RequestsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.OperationalStatus;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.P2p1;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.P2p1Builder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.PcrptBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.PcupdBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.PlspId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.SrpIdNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.Tlvs2;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.Tlvs2Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.db.version.tlv.LspDbVersion;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.db.version.tlv.LspDbVersionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.object.Lsp;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.object.LspBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.lsp.object.lsp.TlvsBuilder;
@@ -322,10 +317,9 @@ public class PCEPValidatorTest {
                b.setKeepalive((short) 30);
                b.setDeadTimer((short) 120);
                b.setSessionId((short) 1);
-               final Stateful tlv1 = new StatefulBuilder().setLspUpdateCapability(Boolean.TRUE).setIncludeDbVersion(Boolean.TRUE).build();
-               final LspDbVersion tlv2 = new LspDbVersionBuilder().setVersion(BigInteger.valueOf(0x80L)).build();
+               final Stateful tlv1 = new StatefulBuilder().setLspUpdateCapability(Boolean.TRUE).build();
                b.setTlvs(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.open.TlvsBuilder().addAugmentation(
-                               Tlvs2.class, new Tlvs2Builder().setStateful(tlv1).setLspDbVersion(tlv2).build()).build());
+                               Tlvs2.class, new Tlvs2Builder().setStateful(tlv1).build()).build());
                builder.setOpen(b.build());
 
                assertEquals(new OpenBuilder().setOpenMessage(builder.build()).build(),
@@ -389,7 +383,6 @@ public class PCEPValidatorTest {
                rBuilder1.setRp(this.rpTrue);
                final P2pBuilder p2pBuilder = new P2pBuilder();
                p2pBuilder.setEndpointsObj(this.endpoints);
-               p2pBuilder.addAugmentation(P2p1.class, new P2p1Builder().setLsp(this.lsp).build());
                p2pBuilder.setMetrics(Lists.newArrayList(this.metrics));
                p2pBuilder.setIro(this.iro);
                rBuilder1.setSegmentComputation(new SegmentComputationBuilder().setP2p(p2pBuilder.build()).build());
index a755e6301fe548e659214ddc0d098119610f654c..388f09874fcf75203cea354a1d1ff1a19e87eb7b 100644 (file)
Binary files a/pcep/impl/src/test/resources/PCEPOpenMessage1.bin and b/pcep/impl/src/test/resources/PCEPOpenMessage1.bin differ
index 58f380f21160f45b20aee319978e68d0f9935076..388f09874fcf75203cea354a1d1ff1a19e87eb7b 100644 (file)
Binary files a/pcep/impl/src/test/resources/PCEPOpenObject1.bin and b/pcep/impl/src/test/resources/PCEPOpenObject1.bin differ
index e10e19d5c2db2b168faa45c9e641a60afa5ccfe5..91a5ae8210668ed055a045c7e84ae83ae7dbef77 100644 (file)
Binary files a/pcep/impl/src/test/resources/PCReq.3.bin and b/pcep/impl/src/test/resources/PCReq.3.bin differ
index 2dca3180d9d121dc8eda3c11eb5f799cc3fb8064..3fd8602691c41186ffe08e6c8eec4750155370ab 100644 (file)
@@ -27,8 +27,8 @@ public final class Main {
        private static final Logger LOG = LoggerFactory.getLogger(Main.class);
 
        public static final String USAGE = "DESCRIPTION:\n"
-                       + "\tCreates a server with given parameters. As long as it runs, it accepts connections "
-                       + "from PCCs.\n" + "USAGE:\n" + "\t-a, --address\n" + "\t\tthe ip address to which is this server bound.\n"
+                       + "\tCreates a server with given parameters. As long as it runs, it accepts connections " + "from PCCs.\n" + "USAGE:\n"
+                       + "\t-a, --address\n" + "\t\tthe ip address to which is this server bound.\n"
                        + "\t\tFormat: x.x.x.x:y where y is port number.\n\n" +
 
                        "\t-d, --deadtimer\n" + "\t\tin seconds, value of the desired deadtimer\n"
@@ -43,8 +43,6 @@ public final class Main {
 
                        "\t--active\n" + "\t\tactive stateful (implies --stateful)\n\n" +
 
-                       "\t--versioned\n" + "\t\tversioned stateful (implies --stateful)\n\n" +
-
                        "\t--instant\n"
                        + "\t\tinstantiated stateful, <seconds> cleanup timeout (default value, if not included = 0) (implies --stateful)\n\n" +
 
@@ -79,7 +77,7 @@ public final class Main {
                int deadTimerValue = 0;
                boolean stateful = false;
                boolean active = false;
-               boolean versioned = false;
+               final boolean versioned = false;
                boolean instant = false;
 
                int i = 0;
@@ -99,9 +97,6 @@ public final class Main {
                        } else if (args[i].equalsIgnoreCase("--active")) {
                                stateful = true;
                                active = true;
-                       } else if (args[i].equalsIgnoreCase("--versioned")) {
-                               stateful = true;
-                               versioned = true;
                        } else if (args[i].equalsIgnoreCase("--instant")) {
                                stateful = true;
                                instant = true;
@@ -117,7 +112,7 @@ public final class Main {
                        deadTimerValue = keepAliveValue * 4;
                }
 
-               final PCEPSessionProposalFactory spf = new PCEPSessionProposalFactoryImpl(deadTimerValue, keepAliveValue, stateful, active, versioned, instant);
+               final PCEPSessionProposalFactory spf = new PCEPSessionProposalFactoryImpl(deadTimerValue, keepAliveValue, stateful, active, instant);
 
                final Open prefs = spf.getSessionProposal(address, 0);
 
index b3701121054ec58dc77e33a46f4557a1eeea3883..13141a0cc21a6d87f923505570735184af0fb885 100644 (file)
@@ -29,12 +29,8 @@ import org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiatorFactory;
 import org.opendaylight.protocol.pcep.impl.PCEPHandlerFactory;
 import org.opendaylight.protocol.pcep.impl.PCEPSessionImpl;
 import org.opendaylight.protocol.pcep.spi.pojo.ServiceLoaderPCEPExtensionProviderContext;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.Tlvs2;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.Tlvs2Builder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.predundancy.group.id.tlv.PredundancyGroupIdBuilder;
 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.open.object.OpenBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.open.TlvsBuilder;
 
 import com.google.common.base.Preconditions;
 
@@ -63,14 +59,8 @@ public class PCCMock<M, S extends ProtocolSession<M>, L extends SessionListener<
        }
 
        public static void main(final String[] args) throws Exception {
-               final TlvsBuilder builder = new TlvsBuilder();
-               builder.addAugmentation(
-                               Tlvs2.class,
-                               new Tlvs2Builder().setPredundancyGroupId(
-                                               new PredundancyGroupIdBuilder().setIdentifier(new byte[] { (byte) 127, (byte) 2, (byte) 3, (byte) 7 }).build()).build());
-
                final SessionNegotiatorFactory<Message, PCEPSessionImpl, PCEPSessionListener> snf = new DefaultPCEPSessionNegotiatorFactory(new HashedWheelTimer(), new OpenBuilder().setKeepalive(
-                               (short) 30).setDeadTimer((short) 120).setSessionId((short) 0).setTlvs(builder.build()).build(), 0);
+                               (short) 30).setDeadTimer((short) 120).setSessionId((short) 0).build(), 0);
 
                final PCCMock<Message, PCEPSessionImpl, PCEPSessionListener> pcc = new PCCMock<>(snf, new PCEPHandlerFactory(ServiceLoaderPCEPExtensionProviderContext.getSingletonInstance().getMessageHandlerRegistry()), new DefaultPromise<PCEPSessionImpl>(GlobalEventExecutor.INSTANCE));
 
index 028434fda7b10703339384dee0293ef83c34b9ca..693d23886c321d2f14cf6938d605eda36e019e2d 100644 (file)
@@ -45,7 +45,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.iet
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.pcupd.message.pcupd.message.UpdatesBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.pcupd.message.pcupd.message.updates.PathBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.srp.object.Srp;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.srp.object.Srp.Flags;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.srp.object.SrpBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.stateful.capability.tlv.Stateful;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.symbolic.path.name.tlv.SymbolicPathName;
@@ -251,8 +250,7 @@ final class ServerSessionManager implements SessionListenerFactory<PCEPSessionLi
                }
 
                private InstanceIdentifierBuilder<ReportedLsp> lspIdentifier(final ReportedLspKey key) {
-                       return InstanceIdentifier.builder(this.topologyAugment).child(PathComputationClient.class).child(ReportedLsp.class,
-                                       key);
+                       return InstanceIdentifier.builder(this.topologyAugment).child(PathComputationClient.class).child(ReportedLsp.class, key);
                }
 
                @Override
@@ -276,12 +274,15 @@ final class ServerSessionManager implements SessionListenerFactory<PCEPSessionLi
                                        trans.putOperationalData(this.topologyAugment, this.topologyAugmentBuilder.build());
 
                                        // The node has completed synchronization, cleanup metadata no longer reported back
-                                       this.nodeState.cleanupExcept(Collections2.transform(this.lsps.values(), new Function<SymbolicPathName, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.SymbolicPathName>() {
-                                               @Override
-                                               public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.SymbolicPathName apply(final SymbolicPathName input) {
-                                                       return input.getPathName();
-                                               }
-                                       }));
+                                       this.nodeState.cleanupExcept(Collections2.transform(
+                                                       this.lsps.values(),
+                                                       new Function<SymbolicPathName, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.SymbolicPathName>() {
+                                                               @Override
+                                                               public org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.SymbolicPathName apply(
+                                                                               final SymbolicPathName input) {
+                                                                       return input.getPathName();
+                                                               }
+                                                       }));
                                        LOG.debug("Session {} achieved synchronized state", session);
                                        return;
                                }
@@ -310,7 +311,8 @@ final class ServerSessionManager implements SessionListenerFactory<PCEPSessionLi
                                                        break;
                                                case GoingDown:
                                                case GoingUp:
-                                                       // These are transitive states, so we don't have to do anything, as they will be followed up...
+                                                       // These are transitive states, so we don't have to do anything, as they will be followed
+                                                       // up...
                                                        break;
                                                }
                                        }
@@ -342,9 +344,9 @@ final class ServerSessionManager implements SessionListenerFactory<PCEPSessionLi
 
                                        // If this is an unsolicited update. We need to make sure we retain the metadata already present
                                        if (solicited) {
-                                               nodeState.setLspMetadata(rlb.getName(), rlb.getMetadata());
+                                               this.nodeState.setLspMetadata(rlb.getName(), rlb.getMetadata());
                                        } else {
-                                               rlb.setMetadata(nodeState.getLspMetadata(rlb.getName()));
+                                               rlb.setMetadata(this.nodeState.getLspMetadata(rlb.getName()));
                                        }
 
                                        trans.putOperationalData(lspIdentifier(rlb.getKey()).build(), rlb.build());
@@ -382,7 +384,8 @@ final class ServerSessionManager implements SessionListenerFactory<PCEPSessionLi
                        }
                }
 
-               private synchronized ListenableFuture<OperationResult> sendMessage(final Message message, final SrpIdNumber requestId, final Metadata metadata) {
+               private synchronized ListenableFuture<OperationResult> sendMessage(final Message message, final SrpIdNumber requestId,
+                               final Metadata metadata) {
                        final io.netty.util.concurrent.Future<Void> f = this.session.sendMessage(message);
                        final PCEPRequest req = new PCEPRequest(metadata);
 
@@ -442,7 +445,7 @@ final class ServerSessionManager implements SessionListenerFactory<PCEPSessionLi
                                new TopologyBuilder().setKey(k).setTopologyId(k.getTopologyId()).setTopologyTypes(
                                                new TopologyTypesBuilder().addAugmentation(TopologyTypes1.class,
                                                                new TopologyTypes1Builder().setTopologyPcep(new TopologyPcepBuilder().build()).build()).build()).setNode(
-                                                                               new ArrayList<Node>()).build());
+                                               new ArrayList<Node>()).build());
 
                Futures.addCallback(JdkFutureAdapters.listenInPoolThread(t.commit()), new FutureCallback<RpcResult<TransactionStatus>>() {
                        @Override
@@ -459,7 +462,7 @@ final class ServerSessionManager implements SessionListenerFactory<PCEPSessionLi
 
        public void releaseNodeState(final TopologyNodeState nodeState) {
                LOG.debug("Node {} unbound", nodeState.getNodeId());
-               nodes.remove(nodeState.getNodeId());
+               this.nodes.remove(nodeState.getNodeId());
                nodeState.released();
        }
 
@@ -509,7 +512,8 @@ final class ServerSessionManager implements SessionListenerFactory<PCEPSessionLi
                ib.setRequests(ImmutableList.of(rb.build()));
 
                // Send the message
-               return l.sendMessage(new PcinitiateBuilder().setPcinitiateMessage(ib.build()).build(), rb.getSrp().getOperationId(), input.getArguments().getMetadata());
+               return l.sendMessage(new PcinitiateBuilder().setPcinitiateMessage(ib.build()).build(), rb.getSrp().getOperationId(),
+                               input.getArguments().getMetadata());
        }
 
        private static OperationResult createOperationResult(final FailureType type) {
@@ -549,7 +553,7 @@ final class ServerSessionManager implements SessionListenerFactory<PCEPSessionLi
 
                // Build the request and send it
                final RequestsBuilder rb = new RequestsBuilder();
-               rb.setSrp(new SrpBuilder().setOperationId(l.nextRequest()).setProcessingRule(Boolean.TRUE).setFlags(new Flags(Boolean.TRUE)).build());
+               rb.setSrp(new SrpBuilder().setOperationId(l.nextRequest()).setProcessingRule(Boolean.TRUE).build());
                rb.setLsp(new LspBuilder().setRemove(Boolean.TRUE).setPlspId(rep.getLsp().getPlspId()).setDelegate(Boolean.TRUE).build());
 
                final PcinitiateMessageBuilder ib = new PcinitiateMessageBuilder(MESSAGE_HEADER);
@@ -583,7 +587,8 @@ final class ServerSessionManager implements SessionListenerFactory<PCEPSessionLi
 
                final PcupdMessageBuilder ub = new PcupdMessageBuilder(MESSAGE_HEADER);
                ub.setUpdates(ImmutableList.of(rb.build()));
-               return l.sendMessage(new PcupdBuilder().setPcupdMessage(ub.build()).build(), rb.getSrp().getOperationId(), input.getArguments().getMetadata());
+               return l.sendMessage(new PcupdBuilder().setPcupdMessage(ub.build()).build(), rb.getSrp().getOperationId(),
+                               input.getArguments().getMetadata());
        }
 
        synchronized ListenableFuture<OperationResult> realEnsureLspOperational(final EnsureLspOperationalInput input) {