public static int validateRequest(JRTConfigRequest request) {
        ConfigKey<?> key = request.getConfigKey();
        if (!RequestValidation.verifyName(key.getName())) {
            log.log(WARNING, "Illegal name '" + key.getName() + "'");
            return ErrorCode.ILLEGAL_NAME;
        }
        if (!RequestValidation.verifyNamespace(key.getNamespace())) {
            log.log(WARNING, "Illegal name space '" + key.getNamespace() + "'");
            return ErrorCode.ILLEGAL_NAME_SPACE;
        }
        if (!(new PayloadChecksum(request.getRequestDefMd5(), MD5).valid())) {
            log.log(WARNING, "Illegal checksum '" + key.getNamespace() + "'");
            return ErrorCode.ILLEGAL_DEF_MD5;  // TODO: Use ILLEGAL_DEF_CHECKSUM
        }
        if (! request.getRequestConfigChecksums().valid()) {
            log.log(WARNING, "Illegal config checksum '" + request.getRequestConfigChecksums() + "'");
            return ErrorCode.ILLEGAL_CONFIG_MD5; // TODO: Use ILLEGAL_CONFIG_CHECKSUM
        }
        if (!RequestValidation.verifyGeneration(request.getRequestGeneration())) {
            log.log(WARNING, "Illegal generation '" + request.getRequestGeneration() + "'");
            return ErrorCode.ILLEGAL_GENERATION;
        }
        if (!RequestValidation.verifyTimeout(request.getTimeout())) {
            log.log(WARNING, "Illegal timeout '" + request.getTimeout() + "'");
            return ErrorCode.ILLEGAL_TIMEOUT;
        }
        if (!RequestValidation.verifyHostname(request.getClientHostName())) {
            log.log(WARNING, "Illegal client host name '" + request.getClientHostName() + "'");
            return ErrorCode.ILLEGAL_CLIENT_HOSTNAME;
        }
        return 0;
    }
Static utility methods for verifying common request properties.

@author Ulf Lilleengen
config/src/main/java/com/yahoo/vespa/config/protocol/RequestValidation.java