| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006 Sun Microsystems, Inc. |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.api; |
| | | |
| | |
| | | import org.opends.server.types.RestoreConfig; |
| | | import org.opends.server.types.WritabilityMode; |
| | | |
| | | import static org.opends.server.loggers.Debug.*; |
| | | import static org.opends.server.messages.BackendMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | | |
| | |
| | | */ |
| | | public abstract class Backend |
| | | { |
| | | /** |
| | | * The fully-qualified name of this class for debugging purposes. |
| | | */ |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.api.Backend"; |
| | | |
| | | |
| | | |
| | |
| | | */ |
| | | protected Backend() |
| | | { |
| | | assert debugConstructor(CLASS_NAME); |
| | | |
| | | backendID = null; |
| | | parentBackend = null; |
| | |
| | | public boolean entryExists(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "entryExists", |
| | | String.valueOf(entryDN)); |
| | | |
| | | Lock lock = null; |
| | | for (int i=0; i < 3; i++) |
| | |
| | | */ |
| | | public final boolean supportsControl(String controlOID) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "supportsControl", |
| | | String.valueOf(controlOID)); |
| | | |
| | | Set<String> supportedControls = getSupportedControls(); |
| | | return ((supportedControls != null) && |
| | |
| | | */ |
| | | public final boolean supportsFeature(String featureOID) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "supportsFeature", |
| | | String.valueOf(featureOID)); |
| | | |
| | | Set<String> supportedFeatures = getSupportedFeatures(); |
| | | return ((supportedFeatures != null) && |
| | |
| | | */ |
| | | public String getBackendID() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getBackendID"); |
| | | |
| | | return backendID; |
| | | } |
| | |
| | | */ |
| | | public void setBackendID(String backendID) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setBackendID", |
| | | String.valueOf(backendID)); |
| | | |
| | | this.backendID = backendID; |
| | | } |
| | |
| | | */ |
| | | public boolean isPrivateBackend() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "isPrivateBackend"); |
| | | |
| | | return isPrivateBackend; |
| | | } |
| | |
| | | */ |
| | | public WritabilityMode getWritabilityMode() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getWritabilityMode"); |
| | | |
| | | return writabilityMode; |
| | | } |
| | |
| | | */ |
| | | public void setWritabilityMode(WritabilityMode writabilityMode) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setWritabilityMode", |
| | | String.valueOf(writabilityMode)); |
| | | |
| | | if (writabilityMode == null) |
| | | { |
| | |
| | | */ |
| | | public BackendMonitor getBackendMonitor() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getBackendMonitor"); |
| | | |
| | | return backendMonitor; |
| | | } |
| | |
| | | */ |
| | | public void setBackendMonitor(BackendMonitor backendMonitor) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setBackendMonitor", |
| | | String.valueOf(backendMonitor)); |
| | | |
| | | this.backendMonitor = backendMonitor; |
| | | } |
| | |
| | | */ |
| | | public Backend getParentBackend() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getParentBackend"); |
| | | |
| | | return parentBackend; |
| | | } |
| | |
| | | */ |
| | | public void setParentBackend(Backend parentBackend) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setParentBackend", |
| | | String.valueOf(parentBackend)); |
| | | |
| | | synchronized (this) |
| | | { |
| | |
| | | */ |
| | | public Backend[] getSubordinateBackends() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getSubordinateBackends"); |
| | | |
| | | return subordinateBackends; |
| | | } |
| | |
| | | */ |
| | | public void setSubordinateBackends(Backend[] subordinateBackends) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setSubordinateBackends", |
| | | String.valueOf(subordinateBackends)); |
| | | |
| | | synchronized (this) |
| | | { |
| | |
| | | */ |
| | | public boolean hasSubSuffix(DN subSuffixDN) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "hasSubSuffix", |
| | | String.valueOf(subSuffixDN)); |
| | | |
| | | Backend[] subBackends = subordinateBackends; |
| | | for (Backend b : subBackends) |
| | |
| | | public void removeSubSuffix(DN subSuffixDN, DN parentDN) |
| | | throws ConfigException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "removeSubSuffix", |
| | | String.valueOf(subSuffixDN)); |
| | | |
| | | synchronized (this) |
| | | { |
| | |
| | | */ |
| | | public void addSubordinateBackend(Backend subordinateBackend) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "addSubordinateBackend", |
| | | String.valueOf(subordinateBackend)); |
| | | |
| | | synchronized (this) |
| | | { |
| | |
| | | */ |
| | | public void removeSubordinateBackend(Backend subordinateBackend) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "removeSubordinateBackend", |
| | | String.valueOf(subordinateBackend)); |
| | | |
| | | synchronized (this) |
| | | { |
| | |
| | | */ |
| | | public boolean handlesEntry(DN entryDN) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "handlesEntry", |
| | | String.valueOf(entryDN)); |
| | | |
| | | DN[] baseDNs = getBaseDNs(); |
| | | for (int i=0; i < baseDNs.length; i++) |
| | |
| | | List<DN> baseDNs, |
| | | List<DN> excludeDNs) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "handlesEntry", |
| | | String.valueOf(entryDN)); |
| | | |
| | | for (DN baseDN : baseDNs) |
| | | { |