package org.opendaylight.protocol.pcep.impl.object;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
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;
}
@Override
- public Bandwidth parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+ public Bandwidth parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null || bytes.length == 0) {
throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty.");
}
package org.opendaylight.protocol.pcep.impl.object;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
}
@Override
- public CClose parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+ public CClose parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null) {
throw new IllegalArgumentException("Byte array is mandatory.");
}
package org.opendaylight.protocol.pcep.impl.object;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
}
@Override
- public ErrorObject parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+ public ErrorObject parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null) {
throw new IllegalArgumentException("Array of bytes is mandatory.");
}
package org.opendaylight.protocol.pcep.impl.object;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.XROSubobjectHandlerRegistry;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
}
@Override
- public Xro parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+ public Xro parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null || bytes.length == 0) {
throw new IllegalArgumentException("Byte array is mandatory. Can't be null or empty.");
}
package org.opendaylight.protocol.pcep.impl.object;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.EROSubobjectHandlerRegistry;
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;
}
@Override
- public Ero parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+ public Ero parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null || bytes.length == 0) {
throw new IllegalArgumentException("Byte array is mandatory. Can't be null or empty.");
}
package org.opendaylight.protocol.pcep.impl.object;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
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;
}
@Override
- public Gc parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+ public Gc parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null || bytes.length == 0) {
throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty.");
}
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.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;
}
@Override
- public Iro parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+ public Iro parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null || bytes.length == 0) {
throw new IllegalArgumentException("Byte array is mandatory. Can't be null or empty.");
}
package org.opendaylight.protocol.pcep.impl.object;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nps.concepts.rev130930.Bandwidth;
}
@Override
- public LoadBalancing parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException,
- PCEPDocumentedException {
+ public LoadBalancing parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null || bytes.length == 0) {
throw new IllegalArgumentException("Byte array is mandatory. Can't be null or empty.");
}
import java.util.BitSet;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
}
@Override
- public Lsp parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+ public Lsp parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null || bytes.length == 0) {
throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty.");
}
import java.util.BitSet;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
}
@Override
- public Lspa parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+ public Lspa parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null) {
throw new IllegalArgumentException("Bytes array is mandatory.");
}
import java.util.BitSet;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ieee754.rev130819.Float32;
}
@Override
- public Metric parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+ public Metric parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null || bytes.length == 0) {
throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty.");
}
import java.util.BitSet;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
}
@Override
- public NoPath parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+ public NoPath parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null || bytes.length == 0) {
throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty.");
}
package org.opendaylight.protocol.pcep.impl.object;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
}
@Override
- public CNotification parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException,
- PCEPDocumentedException {
+ public CNotification parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null || bytes.length == 0) {
throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty.");
}
package org.opendaylight.protocol.pcep.impl.object;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
}
@Override
- public Of parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+ public Of parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null || bytes.length == 0) {
throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty.");
}
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.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;
}
@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());
package org.opendaylight.protocol.pcep.impl.object;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.RROSubobjectHandlerRegistry;
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;
}
@Override
- public Rro parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+ public Rro parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null || bytes.length == 0) {
throw new IllegalArgumentException("Byte array is mandatory. Can't be null or empty.");
}
final RpBuilder builder = new RpBuilder();
builder.setIgnore(header.isIgnore());
+ // FIXME: change binary files
+ // if (!header.isProcessingRule()) {
+ // throw new PCEPDocumentedException("P flag is not set.", PCEPErrors.P_FLAG_NOT_SET);
+ // }
builder.setProcessingRule(header.isProcessingRule());
builder.setPriority(priority);
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
import org.opendaylight.protocol.pcep.PCEPDocumentedException;
+import org.opendaylight.protocol.pcep.PCEPErrors;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
builder.setIgnore(header.isIgnore());
builder.setProcessingRule(header.isProcessingRule());
final byte[] srpId = ByteArray.subByte(bytes, FLAGS_SIZE, SRP_ID_SIZE);
- if (Arrays.equals(srpId, new byte[] { 0, 0, 0, 0 }) || Arrays.equals(srpId, new byte[] { 0xFFFFFFFF })) {
- throw new PCEPDeserializerException("Min/Max values for SRP ID are reserved.");
+ if (Arrays.equals(srpId, new byte[] { 0, 0, 0, 0 })) {
+ // The absence of the SRP object is equivalent to an SRP object with the reserved value of 0x00000000.
+ throw new PCEPDocumentedException("Srp object has 0 value.", PCEPErrors.SRP_MISSING);
+ }
+ if (Arrays.equals(srpId, new byte[] { 0xFFFFFFFF })) {
+ throw new PCEPDeserializerException("Max values for SRP ID are reserved.");
}
builder.setOperationId(new SrpIdNumber(ByteArray.bytesToLong(srpId)));
return builder.build();
import java.util.List;
import org.opendaylight.protocol.pcep.PCEPDeserializerException;
-import org.opendaylight.protocol.pcep.PCEPDocumentedException;
import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
import org.opendaylight.protocol.util.ByteArray;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
}
@Override
- public Svec parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException, PCEPDocumentedException {
+ public Svec parseObject(final ObjectHeader header, final byte[] bytes) throws PCEPDeserializerException {
if (bytes == null || bytes.length == 0) {
throw new IllegalArgumentException("Array of bytes is mandatory. Can't be null or empty.");
}