X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pcep%2Fimpl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fpcep%2Fimpl%2Fobject%2FPCEPPathKeyObjectParser.java;h=427953dfe6265aeba5c95d1b684f79b183c4779b;hb=af10e2fd4f6bb29954f01b9c0d80dc6ee82a1615;hp=8a3824bce23333c7ea073be34680c9b1214d33d3;hpb=0a070794dbec3f4a5879784dcae1b0afc0dc89d5;p=bgpcep.git diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPPathKeyObjectParser.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPPathKeyObjectParser.java index 8a3824bce2..427953dfe6 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPPathKeyObjectParser.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/object/PCEPPathKeyObjectParser.java @@ -9,9 +9,8 @@ package org.opendaylight.protocol.pcep.impl.object; import java.util.List; -import org.opendaylight.protocol.pcep.PCEPDeserializerException; -import org.opendaylight.protocol.pcep.PCEPDocumentedException; import org.opendaylight.protocol.pcep.spi.EROSubobjectHandlerRegistry; +import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException; 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.explicit.route.object.ero.Subobjects; @@ -37,14 +36,14 @@ public class PCEPPathKeyObjectParser extends AbstractEROWithSubobjectsParser { } @Override - public PathKey parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException { + public PathKey parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException { final PathKeyBuilder builder = new PathKeyBuilder(); builder.setIgnore(header.isIgnore()); builder.setProcessingRule(header.isProcessingRule()); final List pk = Lists.newArrayList(); final List subs = parseSubobjects(bytes); for (final Subobjects s : subs) { - final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKey k = (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKey) s.getSubobjectType(); + final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCase k = (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCase) s.getSubobjectType(); pk.add(new PathKeysBuilder().setLoose(s.isLoose()).setPceId(k.getPathKey().getPceId()).setPathKey(k.getPathKey().getPathKey()).build()); } builder.setPathKeys(pk); @@ -61,11 +60,11 @@ public class PCEPPathKeyObjectParser extends AbstractEROWithSubobjectsParser { final List subs = Lists.newArrayList(); for (final PathKeys p : pk) { subs.add(new SubobjectsBuilder().setLoose(p.isLoose()).setSubobjectType( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyBuilder().setPathKey( - new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.path.key.PathKeyBuilder().setPathKey( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.PathKeyCaseBuilder().setPathKey( + new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.ero.subobjects.subobject.type.path.key._case.PathKeyBuilder().setPathKey( p.getPathKey()).setPceId(p.getPceId()).build()).build()).build()); } - return serializeSubobject(subs); + return ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), serializeSubobject(subs)); } @Override