/*
* 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
* 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
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2008 Sun Microsystems, Inc.
*/
/**
* testing. The following behaviors of this backend implementation
* should be noted:
* <ul>
* <li>All read operations return success but no data.
* <li>All write operations return success but do nothing.
* <li>Bind operations fail with invalid credentials.
* <li>Compare operations are only possible on objectclass and return
* true for the following objeclasses only: top, nullbackendobject,
* extensibleobject. Otherwise comparison result is false or comparison
* fails altogether.
* <li>Controls are supported although this implementation does not
* provide any specific emulation for controls. Generally known request
* controls are accepted and default response controls returned where
* applicable.
* <li>Searches within this backend are always considered indexed.
* <li>Backend Import is supported by iterating over ldif reader on a
* single thread and issuing add operations which essentially do nothing
* at all.
* <li>Backend Export is supported but does nothing producing an empty
* ldif.
* <li>Backend Backup and Restore are not supported.
* </ul>
* This backend implementation is for development and testing only, does
* not represent a complete and stable API, should be considered private
* and subject to change without notice.
*/
{
/**
* The tracer object for the debug logger.
*/
// The base DNs for this backend.
// The base DNs for this backend, in a hash set.
// The set of supported controls for this backend.
// The set of supported features for this backend.
// The map of null entry object classes.
/**
* Creates a new backend with the provided information. All backend
* implementations must implement a default constructor that use
* <CODE>super()</CODE> to invoke this constructor.
*/
public NullBackend()
{
super();
// Perform all initialization in initializeBackend.
}
/**
* Set the base DNs for this backend. This is used by the unit tests
* to set the base DNs without having to provide a configuration
* object when initializing the backend.
* @param baseDNs The set of base DNs to be served by this memory backend.
*/
{
}
/**
* {@inheritDoc}
*/
@Override()
throws ConfigException
{
{
}
}
/**
* {@inheritDoc}
*/
@Override()
public synchronized void initializeBackend()
{
{
}
// Add supported controls.
// Add supported features.
// Register base DNs.
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
throw new InitializationException(message, e);
}
}
// Initialize null entry object classes.
"Unable to locate " + topOCName +
" objectclass in the current server schema"));
}
try {
} catch (DirectoryException de) {
if (debugEnabled())
{
}
}
"Unable to locate " + extOCName +
" objectclass in the current server schema"));
}
}
/**
* {@inheritDoc}
*/
@Override()
public synchronized void finalizeBackend()
{
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
}
/**
* {@inheritDoc}
*/
@Override()
{
return baseDNs;
}
/**
* {@inheritDoc}
*/
@Override()
public long getEntryCount()
{
return -1;
}
/**
* {@inheritDoc}
*/
@Override()
public boolean isLocal()
{
// For the purposes of this method, this is a local backend.
return true;
}
/**
* {@inheritDoc}
*/
@Override()
{
// All searches in this backend will always be considered indexed.
return true;
}
/**
* {@inheritDoc}
*/
throws DirectoryException
{
return ConditionResult.UNDEFINED;
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
return -1;
}
/**
* {@inheritDoc}
*/
@Override()
{
}
/**
* {@inheritDoc}
*/
@Override()
{
return false;
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
return;
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
return;
}
/**
* {@inheritDoc}
*/
@Override()
{
return;
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
return;
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
if (pageRequest != null) {
// Indicate no more pages.
control =
}
return;
}
/**
* {@inheritDoc}
*/
@Override()
{
return supportedControls;
}
/**
* {@inheritDoc}
*/
@Override()
{
return supportedFeatures;
}
/**
* {@inheritDoc}
*/
@Override()
public boolean supportsLDIFExport()
{
return true;
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
try {
} catch (Exception e) {
if (debugEnabled()) {
}
message);
}
try {
ldifWriter.close();
} catch (Exception e) {
if (debugEnabled()) {
}
}
}
/**
* {@inheritDoc}
*/
@Override()
public boolean supportsLDIFImport()
{
return true;
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
try
{
}
catch (Exception e)
{
message);
}
try
{
while (true)
{
try
{
if (e == null)
{
break;
}
}
catch (LDIFException le)
{
if (! le.canContinueReading())
{
throw new DirectoryException(
}
else
{
continue;
}
}
try
{
}
catch (DirectoryException de)
{
}
}
}
catch (DirectoryException de)
{
throw de;
}
catch (Exception e)
{
message);
}
finally
{
}
}
/**
* {@inheritDoc}
*/
@Override()
public boolean supportsBackup()
{
return false;
}
/**
* {@inheritDoc}
*/
@Override()
{
return false;
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
"The null backend does not support backup operation");
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
"The null backend does not support remove backup operation");
}
/**
* {@inheritDoc}
*/
@Override()
public boolean supportsRestore()
{
return false;
}
/**
* {@inheritDoc}
*/
@Override()
throws DirectoryException
{
"The null backend does not support restore operation");
}
/**
* {@inheritDoc}
*/
throw new UnsupportedOperationException("Operation not supported.");
}
}