public ErrorCondition newInstance(Object described) { List l = (List) described; ErrorCondition o = new ErrorCondition(); if(l.isEmpty()) { throw new DecodeException("The condition field cannot be omitted"); } switch(3 - l.size()) { case 0: o.setInfo( (Map) l.get( 2 ) ); case 1: o.setDescription( (String) l.get( 1 ) ); case 2: o.setCondition( (Symbol) l.get( 0 ) ); } return o; }
public ErrorCondition newInstance(Object described) { List l = (List) described; ErrorCondition o = new ErrorCondition(); if(l.isEmpty()) { throw new DecodeException("The condition field cannot be omitted"); } switch(3 - l.size()) { case 0: o.setInfo( (Map) l.get( 2 ) ); case 1: o.setDescription( (String) l.get( 1 ) ); case 2: o.setCondition( (Symbol) l.get( 0 ) ); } return o; }
public ErrorCondition newInstance(Object described) { List l = (List) described; ErrorCondition o = new ErrorCondition(); if(l.isEmpty()) { throw new DecodeException("The condition field cannot be omitted"); } switch(3 - l.size()) { case 0: o.setInfo( (Map) l.get( 2 ) ); case 1: o.setDescription( (String) l.get( 1 ) ); case 2: o.setCondition( (Symbol) l.get( 0 ) ); } return o; }
public ErrorCondition newInstance(Object described) { List l = (List) described; ErrorCondition o = new ErrorCondition(); if(l.isEmpty()) { throw new DecodeException("The condition field cannot be omitted"); } switch(3 - l.size()) { case 0: o.setInfo( (Map) l.get( 2 ) ); case 1: o.setDescription( (String) l.get( 1 ) ); case 2: o.setCondition( (Symbol) l.get( 0 ) ); } return o; }
public boolean validateConnection(org.apache.qpid.proton.engine.Connection connection, SASLResult saslResult) { remoteContainerId = connection.getRemoteContainer(); boolean idOK = server.addClientConnection(remoteContainerId, ExtCapability.needUniqueConnection(connection)); if (!idOK) { //https://issues.apache.org/jira/browse/ARTEMIS-728 Map<Symbol, Object> connProp = new HashMap<>(); connProp.put(AmqpSupport.CONNECTION_OPEN_FAILED, "true"); connection.setProperties(connProp); connection.getCondition().setCondition(AmqpError.INVALID_FIELD); Map<Symbol, Symbol> info = new HashMap<>(); info.put(AmqpSupport.INVALID_FIELD, AmqpSupport.CONTAINER_ID); connection.getCondition().setInfo(info); return false; } registeredConnectionId.set(true); return true; }
public boolean validateConnection(org.apache.qpid.proton.engine.Connection connection, SASLResult saslResult) { remoteContainerId = connection.getRemoteContainer(); boolean idOK = server.addClientConnection(remoteContainerId, ExtCapability.needUniqueConnection(connection)); if (!idOK) { //https://issues.apache.org/jira/browse/ARTEMIS-728 Map<Symbol, Object> connProp = new HashMap<>(); connProp.put(AmqpSupport.CONNECTION_OPEN_FAILED, "true"); connection.setProperties(connProp); connection.getCondition().setCondition(AmqpError.INVALID_FIELD); Map<Symbol, Symbol> info = new HashMap<>(); info.put(AmqpSupport.INVALID_FIELD, AmqpSupport.CONTAINER_ID); connection.getCondition().setInfo(info); return false; } registeredConnectionId.set(true); return true; }
public CompletableFuture<Void> deadLetterMessageAsync( byte[] deliveryTag, String deadLetterReason, String deadLetterErrorDescription, Map<String, Object> propertiesToModify, TransactionContext transaction) { Rejected outcome = new Rejected(); ErrorCondition error = new ErrorCondition(ClientConstants.DEADLETTERNAME, null); Map<String, Object> errorInfo = new HashMap<String, Object>(); if(!StringUtil.isNullOrEmpty(deadLetterReason)) { errorInfo.put(ClientConstants.DEADLETTER_REASON_HEADER, deadLetterReason); } if(!StringUtil.isNullOrEmpty(deadLetterErrorDescription)) { errorInfo.put(ClientConstants.DEADLETTER_ERROR_DESCRIPTION_HEADER, deadLetterErrorDescription); } if(propertiesToModify != null) { errorInfo.putAll(propertiesToModify); } error.setInfo(errorInfo); outcome.setError(error); return this.updateMessageStateAsync(deliveryTag, outcome, transaction); }
condition.setInfo(infoMap);
condition.setInfo(infoMap);