class DelegateFactory {

    public Delegate parseDelegate(final String delegateName, final Buffer buffer) throws ValidationException {
        final String configString;

        // replace wildcard configs
        try {
            configString = StringUtils.replaceWildcardConfigs(buffer.toString("UTF-8"), properties);
        } catch(Exception e){
            throw new ValidationException(e);
        }

        // validate json
        ValidationResult validationResult = Validator.validateStatic(Buffer.buffer(configString), delegatesSchema, LOG);
        if(!validationResult.isSuccess()){
            throw new ValidationException(validationResult);
        }

        // everything is fine, create Delegate
        return createDelegate(delegateName, configString);
    }

    public  DelegateFactory(final MonitoringHandler monitoringHandler, final HttpClient selfClient, final Map<String, Object> properties, final String delegatesSchema);

}