class IndexTreeServiceImpl implements IndexTreeService, IndexChangeObserver, ShutdownListener {

    public Set<String> searchTree(String resource, String realm) throws EntitlementException {
        IndexRuleTree indexRuleTree = getIndexTree(realm);

        if (indexRuleTree == null) {
            return Collections.emptySet();
        }

        Set<String> results = indexRuleTree.searchTree(resource);

        if (DEBUG.messageEnabled()) {
            DEBUG.message(String.format("Matched index rules (resource:%s, realm:%s): %s", resource, realm, results));
        }

        return results;
    }

    @Inject public  IndexTreeServiceImpl(IndexChangeManager manager, PrivilegedAction<SSOToken> adminTokenAction,
                                ServiceManagementDAO smDAO, DNWrapper dnMapper,
                                ShutdownManager shutdownManager);

}