BUG-47 : switched subobjects to generated source code.
[bgpcep.git] / pcep / impl / src / main / java / org / opendaylight / protocol / pcep / impl / subobject / EROExplicitExclusionRouteSubobjectParser.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.protocol.pcep.impl.subobject;
9
10 import org.opendaylight.protocol.pcep.PCEPDeserializerException;
11 import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
12 import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.Subobjects;
14
15 public class EROExplicitExclusionRouteSubobjectParser implements EROSubobjectParser, EROSubobjectSerializer {
16
17         public static final int TYPE = 33;
18
19         @Override
20         public Subobjects parseSubobject(final byte[] buffer, final boolean loose) throws PCEPDeserializerException {
21                 if (buffer == null || buffer.length == 0)
22                         throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty.");
23
24                 // return new EROExplicitExclusionRouteSubobject(PCEPXROSubobjectParser.parse(cutBytes));
25                 return null;
26         }
27
28         @Override
29         public byte[] serializeSubobject(final Subobjects subobject) {
30                 // return PCEPXROSubobjectParser.put(subobject.getXroSubobjets());
31                 return new byte[0];
32         }
33
34         @Override
35         public int getType() {
36                 return TYPE;
37         }
38 }