class GenericReportUnitResourceConverter extends DataSourceHolderResourceConverter<ServerReportUnitType, ClientReportUnitType> {

    protected String getResourceNameForReference(ResourceReference reference) {
        String name;
        final String referenceURI = reference.getReferenceURI();
        Matcher matcher = Pattern.compile(EXTRACT_RESOURCE_NAME_FROM_URI_PATTERN).matcher(referenceURI);
        if (matcher.find()) {
            name = matcher.group(1);
        } else {
            throw new IllegalStateException("Invalid reference URI '" + referenceURI + "'. Resource name can't be extracted");
        }
        return name;
    }

}