Move route target ext comm container
[bgpcep.git] / bgp / parser-impl / src / main / java / org / opendaylight / protocol / bgp / parser / impl / message / update / extended / communities / route / target / RouteTarget4OctectASEcHandler.java
@@ -6,34 +6,34 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
-package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.four.octect.as.specific;
+package org.opendaylight.protocol.bgp.parser.impl.message.update.extended.communities.route.target;
 
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.bgp.parser.BGPDocumentedException;
 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
 import org.opendaylight.protocol.bgp.parser.spi.extended.community.Abstract4OctetAsExtendedCommunity;
-import org.opendaylight.protocol.bgp.parser.spi.extended.community.FourOctAsCommonECUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.ExtendedCommunity;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.As4RouteTargetExtendedCommunityCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.As4RouteTargetExtendedCommunityCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev180329.extended.community.extended.community.as._4.route.target.extended.community._case.As4RouteTargetExtendedCommunityBuilder;
 
 public final class RouteTarget4OctectASEcHandler extends Abstract4OctetAsExtendedCommunity {
     private static final int SUBTYPE = 2;
 
     @Override
-    public ExtendedCommunity parseExtendedCommunity(final ByteBuf body) throws BGPDocumentedException, BGPParsingException {
-        return new As4RouteTargetExtendedCommunityCaseBuilder().setAs4RouteTargetExtendedCommunity(new As4RouteTargetExtendedCommunityBuilder()
-            .setAs4SpecificCommon(FourOctAsCommonECUtil.parseCommon(body)).build()).build();
+    public ExtendedCommunity parseExtendedCommunity(final ByteBuf body)
+            throws BGPDocumentedException, BGPParsingException {
+        return new As4RouteTargetExtendedCommunityCaseBuilder()
+                .setAs4RouteTargetExtendedCommunity(As4RouteTargetExtendedHandler.parse(body)).build();
     }
 
     @Override
     public void serializeExtendedCommunity(final ExtendedCommunity extendedCommunity, final ByteBuf body) {
         Preconditions.checkArgument(extendedCommunity instanceof As4RouteTargetExtendedCommunityCase,
-            "The extended community %s is not As4RouteTargetExtendedCommunityCase type.", extendedCommunity);
-        FourOctAsCommonECUtil.serializeCommon(((As4RouteTargetExtendedCommunityCase) extendedCommunity).getAs4RouteTargetExtendedCommunity()
-            .getAs4SpecificCommon(), body);
+                "The extended community %s is not As4RouteTargetExtendedCommunityCase type.",
+                extendedCommunity);
+        As4RouteTargetExtendedHandler.serialize(((As4RouteTargetExtendedCommunityCase) extendedCommunity)
+                .getAs4RouteTargetExtendedCommunity(), body);
     }
 
     @Override