Package com.comcast.cqs.model

Examples of com.comcast.cqs.model.CQSBatchResultErrorEntry


            }
           
          idList.add(suppliedId);
           
          if (receiptHandle.isEmpty()) {
                failedList.add(new CQSBatchResultErrorEntry(suppliedId, true, "EmptyValue", "No Value Found for " + this.actionName + CQSConstants.REQUEST_ENTRY + index + "." + CQSConstants.RECEIPT_HANDLE));
            } else {
                idMap.put(suppliedId, receiptHandle);
            }
           
          index++;
View Full Code Here


            }
         
            idList.add(suppliedId);
           
            if (messageBody == null || messageBody.isEmpty()) {
                invalidBodyIdList.add(new CQSBatchResultErrorEntry(suppliedId, true, "EmptyValue", "No value found for " + this.actionName + CQSConstants.REQUEST_ENTRY + index + "." + CQSConstants.MESSAGE_BODY));
            } else if (!com.comcast.cmb.common.util.Util.isValidUnicode(messageBody)) {
              invalidBodyIdList.add(new CQSBatchResultErrorEntry(suppliedId, true, "InvalidMessageContents", "Invalid character was found in the message body."));
            } else {
               
              HashMap<String, String> attributes = new HashMap<String, String>();
                String delaySecondsStr = request.getParameter(this.actionName + CQSConstants.REQUEST_ENTRY + index + "." + CQSConstants.DELAY_SECONDS);
               
View Full Code Here

            }
         
          idList.add(suppliedId);
           
          if (receiptHandle.isEmpty()) {
                failedList.add(new CQSBatchResultErrorEntry(suppliedId, true, "ReceiptHandleIsInvalid", "No Value Found for " + this.actionName + CQSConstants.REQUEST_ENTRY + index + "." + CQSConstants.RECEIPT_HANDLE));
            } else {
           
              String visibilityTimeoutStr = request.getParameter(this.actionName + CQSConstants.REQUEST_ENTRY + index + "." + CQSConstants.VISIBILITY_TIMEOUT);
               
              if (visibilityTimeoutStr != null) {
               
                Integer visibilityTimeout = Integer.parseInt(visibilityTimeoutStr);
                   
                if (visibilityTimeout < 0 || visibilityTimeout > CMBProperties.getInstance().getCQSMaxVisibilityTimeOut()) {
                        throw new CMBException(CMBErrorCodes.InvalidParameterValue, "VisibilityTimeout is limited from 0 to " + CMBProperties.getInstance().getCQSMaxVisibilityTimeOut() + " seconds");
                    }
                }
                idMap.put(suppliedId, Arrays.asList(receiptHandle, visibilityTimeoutStr));
            }
         
            index++;
            suppliedId = request.getParameter(this.actionName + CQSConstants.REQUEST_ENTRY + index + ".Id");
            receiptHandle = request.getParameter(this.actionName + CQSConstants.REQUEST_ENTRY + index + "." + CQSConstants.RECEIPT_HANDLE);
        }
       
        if (idMap.size() == 0) {
            throw new CMBException(CMBErrorCodes.InvalidQueryParameter, "Both user supplied message Id and receiptHandle are required");
        }

        List<String> successList = new ArrayList<String>();
       
        for (Map.Entry<String, List<String>> entry : idMap.entrySet()) {
         
            if (PersistenceFactory.getCQSMessagePersistence().changeMessageVisibility(queue, entry.getValue().get(0), Integer.parseInt(entry.getValue().get(1)))) {
                successList.add(entry.getKey());
            } else {
                failedList.add(new CQSBatchResultErrorEntry(entry.getKey(), true, "ReceiptHandleIsInvalid", "The input receipt handle is invalid."));
            }
        }
       
        String out = CQSMessagePopulator.getChangeMessageVisibilityBatchResponse(successList, failedList);
        writeResponse(out, response);
View Full Code Here

TOP

Related Classes of com.comcast.cqs.model.CQSBatchResultErrorEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.