class TreeSaveIndex implements ISaveIndex {

    @Override
    public ResourceSaveIndexes getIndexes(String policyRule) {
        // Create legacy indexes first.
        ResourceSaveIndexes legacyIndexes = legacySaveIndex.getIndexes(policyRule);

        // Indexes are handled in lower case.
        policyRule = policyRule.toLowerCase();
        // Capture the full resource path as the path index.
        Set<String> pathIndexes = new HashSet<String>();
        pathIndexes.add(parsePolicyRule(policyRule));

        return new ResourceSaveIndexes(
                legacyIndexes.getHostIndexes(), pathIndexes, legacyIndexes.getParentPathIndexes());
    }

}