Java 类com.amazonaws.mturk.filter.Reply 实例源码

项目:java-aws-mturk    文件:AppendKeywordFilter.java   
/**
 * 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);
}
项目:mturksdk-java-code-maven    文件:AppendKeywordFilter.java   
/**
 * 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);
}
项目:gort-public    文件:AppendKeywordFilter.java   
/**
 * 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);
}
项目:java-aws-mturk    文件:TestFilter.java   
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);
}
项目:mturksdk-java-code-maven    文件:TestFilter.java   
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);
}