public AmqpErrorException(ErrorCondition condition) { _error = new Error(); _error.setCondition(condition); }
@Override protected Object next() { switch(_field++) { case 0: return _value.getError(); default: return null; } }
@Override protected Object next() { switch(_field++) { case 0: return _value.getError(); default: return null; } }
public void close(ErrorCondition condition, String message) { performCloseTasks(); final End end = new End(); final Error theError = new Error(); theError.setDescription(message); theError.setCondition(condition); end.setError(theError); end(end); }
private Error createError(final ErrorCondition framingError, final String description, final Object... args) { Error error = new Error(); error.setCondition(framingError); Formatter formatter = new Formatter(); error.setDescription(formatter.format(description, args).toString()); return error; }
@Override protected Object next() { switch(_field++) { case 0: return _value.getCondition(); case 1: return _value.getDescription(); case 2: return _value.getInfo(); default: return null; } }
public Delivery(Transfer transfer, final LinkEndpoint<? extends BaseSource, ? extends BaseTarget> endpoint) { _totalPayloadSize = 0L; _deliveryId = transfer.getDeliveryId(); _deliveryTag = transfer.getDeliveryTag(); _linkEndpoint = endpoint; _messageFormat = transfer.getMessageFormat() != null ? transfer.getMessageFormat() : UnsignedInteger.ZERO; addTransfer(transfer); }
@Override protected void reattachLink(final Attach attach) throws AmqpErrorException { if (attach.getTarget() instanceof Coordinator) { throw new AmqpErrorException(new Error(AmqpError.PRECONDITION_FAILED, "Cannot reattach standard receiving Link as a transaction coordinator")); } attachReceived(attach); }
@Override protected Close construct(final FieldValueReader fieldValueReader) throws AmqpErrorException { Close obj = new Close(); org.apache.qpid.server.protocol.v1_0.type.transport.Error error = fieldValueReader.readValue(0, "error", false, org.apache.qpid.server.protocol.v1_0.type.transport.Error.class); if (error != null) { obj.setError(error); } return obj; } }
@Override protected void resumeLink(final Attach attach) throws AmqpErrorException { throw new AmqpErrorException(new Error(AmqpError.NOT_IMPLEMENTED, "Cannot resume a Coordinator Link.")); }
public void discard() { for (Transfer transfer: _transfers) { transfer.dispose(); } _transfers.clear(); }
public void receiveDetach(final Detach detach) { receivedComplete(); UnsignedInteger handle = detach.getHandle(); detach(handle, detach); }
private Session_1_0 getSession(final int channel) { Session_1_0 session = _receivingSessions[channel]; if (session == null) { Error error = new Error(); error.setCondition(ConnectionError.FRAMING_ERROR); error.setDescription("Frame received on channel " + channel + " which is not known as a begun session."); handleError(error); } return session; }
private int calculateCount() { if( _value.getInfo() != null) { return 3; } if( _value.getDescription() != null) { return 2; } if( _value.getCondition() != null) { return 1; } return 0; } @Override
@Override protected void recoverLink(final Attach attach) throws AmqpErrorException { throw new AmqpErrorException(new Error(AmqpError.NOT_IMPLEMENTED, "Cannot recover a Coordinator Link.")); }
private int calculateCount() { if( _value.getError() != null) { return 1; } return 0; }
private int calculateCount() { if( _value.getError() != null) { return 1; } return 0; }
private void closeConnection(ErrorCondition errorCondition, String description) { closeConnection(new Error(errorCondition, description)); }