| | |
| | | import org.opends.server.core.ModifyDNOperation; |
| | | import org.opends.server.core.SearchOperation; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.BackupConfig; |
| | | import org.opends.server.types.BackupDirectory; |
| | | import org.opends.server.types.ConfigChangeResult; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.LDIFExportConfig; |
| | | import org.opends.server.types.LDIFImportConfig; |
| | | import org.opends.server.types.LDIFImportResult; |
| | | import org.opends.server.types.ObjectClass; |
| | | import org.opends.server.types.RDN; |
| | | import org.opends.server.types.RestoreConfig; |
| | | import org.opends.server.types.ResultCode; |
| | | import org.opends.server.types.SearchFilter; |
| | | import org.opends.server.types.SearchScope; |
| | | import org.opends.server.util.DynamicConstants; |
| | | import org.opends.server.util.LDIFWriter; |
| | | import org.opends.server.util.TimeThread; |
| | |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import org.opends.server.types.*; |
| | | import static org.opends.messages.BackendMessages.*; |
| | | import static org.opends.messages.ConfigMessages.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public ConditionResult hasSubordinates(DN entryDN) throws DirectoryException |
| | | { |
| | | long ret = numSubordinates(entryDN); |
| | | if(ret < 0) |
| | | { |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | else if(ret == 0) |
| | | { |
| | | return ConditionResult.FALSE; |
| | | } |
| | | else |
| | | { |
| | | return ConditionResult.TRUE; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public long numSubordinates(DN entryDN) throws DirectoryException |
| | | { |
| | | // If the requested entry was null, then return undefined. |
| | | if (entryDN == null) |
| | | { |
| | | return -1; |
| | | } |
| | | |
| | | |
| | | // If the requested entry was the monitor base entry, then return |
| | | // the number of monitor providers. |
| | | if (entryDN.equals(baseMonitorDN)) |
| | | { |
| | | return DirectoryServer.getMonitorProviders().size(); |
| | | } |
| | | |
| | | |
| | | // See if the monitor base entry is the immediate parent for the requested |
| | | // entry. If not, then its undefined. |
| | | DN parentDN = entryDN.getParentDNInSuffix(); |
| | | if ((parentDN == null) || (! parentDN.equals(baseMonitorDN))) |
| | | { |
| | | return -1; |
| | | } |
| | | |
| | | |
| | | // Get the RDN for the requested DN and make sure it is single-valued. |
| | | RDN entryRDN = entryDN.getRDN(); |
| | | if (entryRDN.isMultiValued()) |
| | | { |
| | | return -1; |
| | | } |
| | | |
| | | |
| | | // Get the RDN value and see if it matches the instance name for one of |
| | | // the directory server monitor providers. |
| | | String rdnValue = entryRDN.getAttributeValue(0).getStringValue(); |
| | | MonitorProvider<? extends MonitorProviderCfg> monitorProvider = |
| | | DirectoryServer.getMonitorProvider(rdnValue.toLowerCase()); |
| | | if (monitorProvider == null) |
| | | { |
| | | return -1; |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | |
| | | /** |
| | | * Retrieves the requested entry from this backend. |