IndexQueryFactoryImpl.java revision f0a048d41a13eca4cba405da9403c2469ca3d1ea
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2009-2010 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* This class is an implementation of IndexQueryFactory which creates
* IndexQuery objects as part of the query of the JEB index.
*/
public final class IndexQueryFactoryImpl implements
{
/**
* The Map containing the string type identifier and the corresponding index.
*/
private final IndexingOptions indexingOptions;
private final AttributeType attribute;
/**
* Creates a new IndexQueryFactoryImpl object.
*
* @param indexMap
* A map containing the index id and the corresponding index.
* @param indexingOptions
* The options to use for indexing
* @param attribute
* The Attribute type of this index, for error messages
*/
public IndexQueryFactoryImpl(Map<String, Index> indexMap, IndexingOptions indexingOptions, AttributeType attribute)
{
this.indexingOptions = indexingOptions;
}
/** {@inheritDoc} */
{
return new IndexQuery()
{
{
// Read the database and get Record for the key.
// Select the right index to be used.
{
if(debugMessage != null)
{
}
}
{
}
return entrySet;
}
};
}
/** {@inheritDoc} */
final boolean includeLowerBound, final boolean includeUpperBound)
{
return new IndexQuery()
{
{
// Find the right index.
{
if(debugMessage != null)
{
}
}
{
}
return entrySet;
}
};
}
/** {@inheritDoc} */
{
}
/** {@inheritDoc} */
{
}
/**
* {@inheritDoc}
* <p>
* It returns an empty EntryIDSet object when either all or no record
* sets are requested.
*/
public IndexQuery createMatchAllQuery()
{
return new IndexQuery()
{
{
{
if(debugMessage != null)
{
}
return new EntryIDSet();
}
{
}
return entrySet;
}
};
}
private static void updateStatsUndefinedResults(LocalizableMessageBuilder debugMessage, Index index)
{
{
}
else if (index.isRebuildRunning())
{
}
else
{
}
}
/** {@inheritDoc} */
public IndexingOptions getIndexingOptions()
{
return indexingOptions;
}
}