/** * Checks if method is createHIT and appends 'myHIT' to the set of keywords */ @Override public Reply execute(Message m) throws ServiceException { if (m.getMethodName().equals("CreateHIT")) { CreateHITRequest[] requestArray = (CreateHITRequest[]) m.getRequests(); for (CreateHITRequest request : requestArray) { StringBuffer keywords = new StringBuffer(); //append existing keywords to string buffer if (request.getKeywords() != null) { keywords.append(request.getKeywords()); keywords.append(", "); } keywords.append("myHIT"); request.setKeywords(keywords.toString()); } } //pass the message to the next filter return passMessage(m); }
public Reply execute(Message m) { if (m.getMethodName().equals("CreateHIT")) { CreateHITRequest[] requestArray = (CreateHITRequest[]) m.getRequests(); for (CreateHITRequest request : requestArray) { if (request.getReward().getAmount().doubleValue() < 0.05) { request.getReward().setAmount(new BigDecimal(0.05)); } } } return passMessage(m); }