TreeSearchIndex.java revision 8f7e975b2c8f8ca4e108d632b8cfa8281b561381
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2013 ForgeRock Inc.
*/
/**
* Implementation provides search index by means of an in memory rule index cache.
*
* @author apforrest
*/
public class TreeSearchIndex implements ISearchIndex {
private final IndexTreeService indexTreeService;
/**
* This constructor has been added as the entitlements framework expects a no args constructor due to its use of
* reflection for object instantiation. However, as this implementation has dependencies, and to reduce coupling,
* where possible this constructor should be avoided and an alternative should be used in favour.
*/
public TreeSearchIndex() {
}
this.indexTreeService = indexTreeService;
}
public ResourceSearchIndexes getIndexes(String resource, String realm) throws EntitlementException {
// Ignore host and parent path indexes.
// Search the index tree for matching path indexes.
}
/**
* Normalises the resource.
*
* @param resource
* The resource.
* @return The normalised resource.
*/
try {
} catch (MalformedURLException mUrlE) {
// Unable to parse the URL.
// Flag up as a warning and pass through the string.
}
return resource;
}
/**
* Prepare path indexes for LDAP search.
* <p/>
* TODO: This should use Filter#escapeAssertionValue() as provided by the OpenDJ SDK once it becomes available.
*
* @param pathIndexes
* Path Indexes to be escaped.
* @return Escaped path indexes.
*/
}
return escapedPathIndexes;
}
}