* @param isMappingOnly Whether a principal's purpose is for security mappping only.
* @return The {@link InternalUserPrincipal}.
*/
public InternalUserPrincipal getInternalUserPrincipal(String username, boolean isMappingOnly)
{
UserPrincipal userPrincipal = new UserPrincipalImpl(username);
String fullPath = userPrincipal.getFullPath();
// Get user.
Criteria filter = new Criteria();
filter.addEqualTo("fullPath", fullPath);
filter.addEqualTo("isMappingOnly", new Boolean(isMappingOnly));
Query query = QueryFactory.newQuery(InternalUserPrincipalImpl.class, filter);