class ParamGenericValidationWorker implements DispatchWorker {

    @SuppressWarnings("rawtypes")
    @Override
    public void handle(final DispatchTask task) {
        final BaseCmd cmd = task.getCmd();
        final Map params = task.getParams();

        final List<String> expectedParamNames = getParamNamesForCommand(cmd);

        final StringBuilder errorMsg = new StringBuilder(ERROR_MSG_PREFIX);
        boolean foundUnknownParam = false;
        for (final Object actualParamName : params.keySet()) {
            // If none of the expected params matches, we have an unknown param
            boolean matchedCurrentParam = false;
            for (final String expectedName : expectedParamNames) {
                if (expectedName.equalsIgnoreCase((String) actualParamName)) {
                    matchedCurrentParam = true;
                    break;
                }
            }
            if (!matchedCurrentParam && !((String)actualParamName).equalsIgnoreCase("expires") && !((String)actualParamName).equalsIgnoreCase("signatureversion")) {
                errorMsg.append(" ").append(actualParamName);
                foundUnknownParam= true;
            }
        }

        if (foundUnknownParam) {
            s_logger.warn(String.format("Received unknown parameters for command %s. %s", cmd.getActualCommandName(), errorMsg));
        }
    }

}