use of com.swiftmq.amqp.v100.types.AMQPType in project swiftmq-client by iitsoftware.
the class BeginFrame method decode.
private void decode() throws Exception {
List l = body.getValue();
AMQPType t = null;
int idx = 0;
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
remoteChannel = (AMQPUnsignedShort) t;
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'remoteChannel' in 'Begin' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
if (t.getCode() == AMQPTypeDecoder.NULL)
throw new Exception("Mandatory field 'nextOutgoingId' in 'Begin' frame is NULL");
try {
nextOutgoingId = new TransferNumber(((AMQPUnsignedInt) t).getValue());
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'nextOutgoingId' in 'Begin' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
if (t.getCode() == AMQPTypeDecoder.NULL)
throw new Exception("Mandatory field 'incomingWindow' in 'Begin' frame is NULL");
try {
incomingWindow = (AMQPUnsignedInt) t;
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'incomingWindow' in 'Begin' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
if (t.getCode() == AMQPTypeDecoder.NULL)
throw new Exception("Mandatory field 'outgoingWindow' in 'Begin' frame is NULL");
try {
outgoingWindow = (AMQPUnsignedInt) t;
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'outgoingWindow' in 'Begin' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
handleMax = new Handle(((AMQPUnsignedInt) t).getValue());
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'handleMax' in 'Begin' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
offeredCapabilities = AMQPTypeDecoder.isArray(t.getCode()) ? (AMQPArray) t : singleToArray(t);
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'offeredCapabilities' in 'Begin' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
desiredCapabilities = AMQPTypeDecoder.isArray(t.getCode()) ? (AMQPArray) t : singleToArray(t);
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'desiredCapabilities' in 'Begin' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
properties = new Fields(((AMQPMap) t).getValue());
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'properties' in 'Begin' frame: " + e);
}
}
use of com.swiftmq.amqp.v100.types.AMQPType in project swiftmq-client by iitsoftware.
the class CloseFrame method decode.
private void decode() throws Exception {
List l = body.getValue();
AMQPType t = null;
int idx = 0;
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
error = new Error(((AMQPList) t).getValue());
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'error' in 'Close' frame: " + e);
}
}
use of com.swiftmq.amqp.v100.types.AMQPType in project swiftmq-client by iitsoftware.
the class DetachFrame method decode.
private void decode() throws Exception {
List l = body.getValue();
AMQPType t = null;
int idx = 0;
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
if (t.getCode() == AMQPTypeDecoder.NULL)
throw new Exception("Mandatory field 'handle' in 'Detach' frame is NULL");
try {
handle = new Handle(((AMQPUnsignedInt) t).getValue());
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'handle' in 'Detach' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
closed = (AMQPBoolean) t;
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'closed' in 'Detach' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
error = new Error(((AMQPList) t).getValue());
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'error' in 'Detach' frame: " + e);
}
}
use of com.swiftmq.amqp.v100.types.AMQPType in project swiftmq-client by iitsoftware.
the class DispositionFrame method decode.
private void decode() throws Exception {
List l = body.getValue();
AMQPType t = null;
int idx = 0;
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
if (t.getCode() == AMQPTypeDecoder.NULL)
throw new Exception("Mandatory field 'role' in 'Disposition' frame is NULL");
try {
role = new Role(((AMQPBoolean) t).getValue());
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'role' in 'Disposition' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
if (t.getCode() == AMQPTypeDecoder.NULL)
throw new Exception("Mandatory field 'first' in 'Disposition' frame is NULL");
try {
first = new DeliveryNumber(((AMQPUnsignedInt) t).getValue());
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'first' in 'Disposition' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
last = new DeliveryNumber(((AMQPUnsignedInt) t).getValue());
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'last' in 'Disposition' frame: " + e);
}
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
settled = (AMQPBoolean) t;
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'settled' in 'Disposition' frame: " + e);
}
// Factory : DeliveryStateFactory
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
if (t.getCode() != AMQPTypeDecoder.NULL)
state = DeliveryStateFactory.create(t);
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
batchable = (AMQPBoolean) t;
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'batchable' in 'Disposition' frame: " + e);
}
}
use of com.swiftmq.amqp.v100.types.AMQPType in project swiftmq-client by iitsoftware.
the class EndFrame method decode.
private void decode() throws Exception {
List l = body.getValue();
AMQPType t = null;
int idx = 0;
// Factory : ./.
if (idx >= l.size())
return;
t = (AMQPType) l.get(idx++);
try {
if (t.getCode() != AMQPTypeDecoder.NULL)
error = new Error(((AMQPList) t).getValue());
} catch (ClassCastException e) {
throw new Exception("Invalid type of field 'error' in 'End' frame: " + e);
}
}
Aggregations