| | |
| | | AbandonRequest abandonRequest) |
| | | throws IOException |
| | | { |
| | | |
| | | LDAPResult abandonResponse = objFactory.createLDAPResult(); |
| | | |
| | | String requestID = abandonRequest.getRequestID(); |
| | |
| | | CompareRequest compareRequest) |
| | | throws IOException, LDAPException, ASN1Exception |
| | | { |
| | | |
| | | LDAPResult compareResponse = objFactory.createLDAPResult(); |
| | | |
| | | String requestID = compareRequest.getRequestID(); |
| | |
| | | DelRequest deleteRequest) |
| | | throws IOException, LDAPException, ASN1Exception |
| | | { |
| | | |
| | | LDAPResult delResponse = objFactory.createLDAPResult(); |
| | | |
| | | String requestID = deleteRequest.getRequestID(); |
| | |
| | | ExtendedRequest extendedRequest) |
| | | throws IOException, LDAPException, ASN1Exception |
| | | { |
| | | |
| | | ExtendedResponse extendedResponse = objFactory.createExtendedResponse(); |
| | | |
| | | String requestID = extendedRequest.getRequestID(); |
| | |
| | | private UserUninstallData getUserUninstallData(String[] args, |
| | | CurrentInstallStatus installStatus) throws UserUninstallDataException |
| | | { |
| | | |
| | | |
| | | |
| | | UserUninstallData userData = new UserUninstallData(); |
| | | |
| | | boolean silentUninstall = false; |
| | |
| | | */ |
| | | public void finalizeStatusNotificationHandler() |
| | | { |
| | | |
| | | // No action is required by default. |
| | | } |
| | | |
| | |
| | | public void handleStatusNotification( |
| | | AccountStatusNotification notification) |
| | | { |
| | | |
| | | handleStatusNotification(notification.getNotificationType(), |
| | | notification.getUserDN(), |
| | | notification.getMessageID(), |
| | |
| | | public ConditionResult valuesMatch(ByteString attributeValue, |
| | | ByteString assertionValue) |
| | | { |
| | | |
| | | if (approximatelyMatch(attributeValue, assertionValue)) |
| | | { |
| | | return ConditionResult.TRUE; |
| | |
| | | */ |
| | | public void finalizeSyntax() |
| | | { |
| | | |
| | | // No implementation required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public int hashCode() |
| | | { |
| | | |
| | | int hashCode = 0; |
| | | |
| | | String oidString = getOID(); |
| | |
| | | */ |
| | | public boolean equals(Object o) |
| | | { |
| | | |
| | | if (o == null) |
| | | { |
| | | return false; |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("( "); |
| | | buffer.append(getOID()); |
| | | |
| | |
| | | */ |
| | | protected Backend() |
| | | { |
| | | |
| | | backendID = null; |
| | | parentBackend = null; |
| | | subordinateBackends = new Backend[0]; |
| | |
| | | public boolean entryExists(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | Lock lock = null; |
| | | for (int i=0; i < 3; i++) |
| | | { |
| | |
| | | */ |
| | | public final boolean supportsControl(String controlOID) |
| | | { |
| | | |
| | | Set<String> supportedControls = getSupportedControls(); |
| | | return ((supportedControls != null) && |
| | | supportedControls.contains(controlOID)); |
| | |
| | | */ |
| | | public final boolean supportsFeature(String featureOID) |
| | | { |
| | | |
| | | Set<String> supportedFeatures = getSupportedFeatures(); |
| | | return ((supportedFeatures != null) && |
| | | supportedFeatures.contains(featureOID)); |
| | |
| | | */ |
| | | public String getBackendID() |
| | | { |
| | | |
| | | return backendID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setBackendID(String backendID) |
| | | { |
| | | |
| | | this.backendID = backendID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isPrivateBackend() |
| | | { |
| | | |
| | | return isPrivateBackend; |
| | | } |
| | | |
| | |
| | | */ |
| | | public WritabilityMode getWritabilityMode() |
| | | { |
| | | |
| | | return writabilityMode; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setWritabilityMode(WritabilityMode writabilityMode) |
| | | { |
| | | |
| | | if (writabilityMode == null) |
| | | { |
| | | this.writabilityMode = WritabilityMode.ENABLED; |
| | |
| | | */ |
| | | public BackendMonitor getBackendMonitor() |
| | | { |
| | | |
| | | return backendMonitor; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setBackendMonitor(BackendMonitor backendMonitor) |
| | | { |
| | | |
| | | this.backendMonitor = backendMonitor; |
| | | } |
| | | |
| | |
| | | */ |
| | | public Backend getParentBackend() |
| | | { |
| | | |
| | | return parentBackend; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setParentBackend(Backend parentBackend) |
| | | { |
| | | |
| | | synchronized (this) |
| | | { |
| | | this.parentBackend = parentBackend; |
| | |
| | | */ |
| | | public Backend[] getSubordinateBackends() |
| | | { |
| | | |
| | | return subordinateBackends; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setSubordinateBackends(Backend[] subordinateBackends) |
| | | { |
| | | |
| | | synchronized (this) |
| | | { |
| | | this.subordinateBackends = subordinateBackends; |
| | |
| | | */ |
| | | public boolean hasSubSuffix(DN subSuffixDN) |
| | | { |
| | | |
| | | Backend[] subBackends = subordinateBackends; |
| | | for (Backend b : subBackends) |
| | | { |
| | |
| | | public void removeSubSuffix(DN subSuffixDN, DN parentDN) |
| | | throws ConfigException |
| | | { |
| | | |
| | | synchronized (this) |
| | | { |
| | | boolean matchFound = false; |
| | |
| | | */ |
| | | public void addSubordinateBackend(Backend subordinateBackend) |
| | | { |
| | | |
| | | synchronized (this) |
| | | { |
| | | LinkedHashSet<Backend> backendSet = |
| | |
| | | */ |
| | | public void removeSubordinateBackend(Backend subordinateBackend) |
| | | { |
| | | |
| | | synchronized (this) |
| | | { |
| | | ArrayList<Backend> backendList = |
| | |
| | | */ |
| | | public boolean handlesEntry(DN entryDN) |
| | | { |
| | | |
| | | DN[] baseDNs = getBaseDNs(); |
| | | for (int i=0; i < baseDNs.length; i++) |
| | | { |
| | |
| | | List<DN> baseDNs, |
| | | List<DN> excludeDNs) |
| | | { |
| | | |
| | | for (DN baseDN : baseDNs) |
| | | { |
| | | if (entryDN.isDescendantOf(baseDN)) |
| | |
| | | */ |
| | | public void finalizeCertificateMapper() |
| | | { |
| | | |
| | | // No implementation is required by default. |
| | | } |
| | | |
| | |
| | | */ |
| | | protected ClientConnection() |
| | | { |
| | | |
| | | connectTime = TimeThread.getTime(); |
| | | connectTimeString = TimeThread.getUTCTime(); |
| | | authenticationInfo = new AuthenticationInfo(); |
| | |
| | | */ |
| | | public long getConnectTime() |
| | | { |
| | | |
| | | return connectTime; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getConnectTimeString() |
| | | { |
| | | |
| | | return connectTimeString; |
| | | } |
| | | |
| | |
| | | public final boolean sendIntermediateResponse( |
| | | IntermediateResponse intermediateResponse) |
| | | { |
| | | |
| | | |
| | | // Invoke the intermediate response plugins for the response |
| | | // message. |
| | | PluginConfigManager pluginConfigManager = |
| | |
| | | boolean sendNotification, |
| | | int messageID, Object... arguments) |
| | | { |
| | | |
| | | String message = getMessage(messageID, arguments); |
| | | disconnect(disconnectReason, sendNotification, message, |
| | | messageID); |
| | |
| | | */ |
| | | public boolean bindInProgress() |
| | | { |
| | | |
| | | return bindInProgress; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setBindInProgress(boolean bindInProgress) |
| | | { |
| | | |
| | | this.bindInProgress = bindInProgress; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean mustChangePassword() |
| | | { |
| | | |
| | | if (authenticationInfo == null) |
| | | { |
| | | return false; |
| | |
| | | */ |
| | | public void setMustChangePassword(boolean mustChangePassword) |
| | | { |
| | | |
| | | if (authenticationInfo == null) |
| | | { |
| | | authenticationInfo = new AuthenticationInfo(); |
| | |
| | | public CopyOnWriteArrayList<PersistentSearch> |
| | | getPersistentSearches() |
| | | { |
| | | |
| | | return persistentSearches; |
| | | } |
| | | |
| | |
| | | public void registerPersistentSearch(PersistentSearch |
| | | persistentSearch) |
| | | { |
| | | |
| | | persistentSearches.add(persistentSearch); |
| | | } |
| | | |
| | |
| | | public void deregisterPersistentSearch(PersistentSearch |
| | | persistentSearch) |
| | | { |
| | | |
| | | persistentSearches.remove(persistentSearch); |
| | | } |
| | | |
| | |
| | | */ |
| | | public AuthenticationInfo getAuthenticationInfo() |
| | | { |
| | | |
| | | return authenticationInfo; |
| | | } |
| | | |
| | |
| | | public void setAuthenticationInfo(AuthenticationInfo |
| | | authenticationInfo) |
| | | { |
| | | |
| | | if (this.authenticationInfo != null) |
| | | { |
| | | Entry authNEntry = |
| | |
| | | */ |
| | | public void updateAuthenticationInfo(Entry oldEntry, Entry newEntry) |
| | | { |
| | | |
| | | Entry authNEntry = authenticationInfo.getAuthenticationEntry(); |
| | | Entry authZEntry = authenticationInfo.getAuthorizationEntry(); |
| | | |
| | |
| | | */ |
| | | public void setUnauthenticated() |
| | | { |
| | | |
| | | this.authenticationInfo = new AuthenticationInfo(); |
| | | this.sizeLimit = DirectoryServer.getSizeLimit(); |
| | | this.timeLimit = DirectoryServer.getTimeLimit(); |
| | |
| | | public boolean hasPrivilege(Privilege privilege, |
| | | Operation operation) |
| | | { |
| | | |
| | | boolean result = privileges.contains(privilege); |
| | | if (operation == null) |
| | | { |
| | |
| | | public boolean hasAllPrivileges(Privilege[] privileges, |
| | | Operation operation) |
| | | { |
| | | |
| | | HashSet<Privilege> privSet = this.privileges; |
| | | boolean result = true; |
| | | StringBuilder buffer = new StringBuilder(); |
| | |
| | | */ |
| | | private void updatePrivileges(Entry entry, boolean isRoot) |
| | | { |
| | | |
| | | HashSet<Privilege> newPrivileges = new HashSet<Privilege>(); |
| | | HashSet<Privilege> removePrivileges = new HashSet<Privilege>(); |
| | | |
| | |
| | | */ |
| | | public final Object getSASLAuthStateInfo() |
| | | { |
| | | |
| | | return saslAuthState; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setSASLAuthStateInfo(Object saslAuthState) |
| | | { |
| | | |
| | | this.saslAuthState = saslAuthState; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final int getSizeLimit() |
| | | { |
| | | |
| | | return sizeLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setSizeLimit(int sizeLimit) |
| | | { |
| | | |
| | | this.sizeLimit = sizeLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final int getLookthroughLimit() |
| | | { |
| | | |
| | | return lookthroughLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setLookthroughLimit(int lookthroughLimit) |
| | | { |
| | | |
| | | this.lookthroughLimit = lookthroughLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final int getTimeLimit() |
| | | { |
| | | |
| | | return timeLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setTimeLimit(int timeLimit) |
| | | { |
| | | |
| | | this.timeLimit = timeLimit; |
| | | } |
| | | |
| | |
| | | public boolean isMemberOf(Group group, Operation operation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | if (operation == null) |
| | | { |
| | | return group.isMember(authenticationInfo.getAuthorizationDN()); |
| | |
| | | public Set<Group> getGroups(Operation operation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // FIXME -- This probably isn't the most efficient implementation. |
| | | DN authzDN; |
| | | if (operation == null) |
| | |
| | | */ |
| | | public DN getKeyManagerProviderDN() |
| | | { |
| | | |
| | | // In the default implementation, we'll return null. |
| | | return null; |
| | | } |
| | |
| | | */ |
| | | public DN getTrustManagerProviderDN() |
| | | { |
| | | |
| | | // In the default implementation, we'll return null. |
| | | return null; |
| | | } |
| | |
| | | */ |
| | | public final String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public ConnectionHandlerMonitor getConnectionHandlerMonitor() |
| | | { |
| | | |
| | | return monitor; |
| | | } |
| | | |
| | |
| | | public void setConnectionHandlerMonitor( |
| | | ConnectionHandlerMonitor monitor) |
| | | { |
| | | |
| | | this.monitor = monitor; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public StackTraceElement[] getCreationStackTrace() |
| | | { |
| | | |
| | | return creationStackTrace; |
| | | } |
| | | |
| | |
| | | */ |
| | | public Thread getParentThread() |
| | | { |
| | | |
| | | return parentThread; |
| | | } |
| | | |
| | |
| | | */ |
| | | public Task getAssociatedTask() |
| | | { |
| | | |
| | | return task; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setAssociatedTask(Task task) |
| | | { |
| | | |
| | | this.task = task; |
| | | } |
| | | } |
| | |
| | | public ConditionResult valuesMatch(ByteString attributeValue, |
| | | ByteString assertionValue) |
| | | { |
| | | |
| | | if (areEqual(attributeValue, assertionValue)) |
| | | { |
| | | return ConditionResult.TRUE; |
| | |
| | | */ |
| | | public int generateHashCode(AttributeValue attributeValue) |
| | | { |
| | | |
| | | try |
| | | { |
| | | return attributeValue.getNormalizedValue().hashCode(); |
| | |
| | | */ |
| | | public void finalizeExtendedOperationHandler() |
| | | { |
| | | |
| | | // No implementation is required by default. |
| | | } |
| | | |
| | |
| | | */ |
| | | public Set<String> getSupportedControls() |
| | | { |
| | | |
| | | return supportedControlOIDs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final boolean supportsControl(String controlOID) |
| | | { |
| | | |
| | | return getSupportedControls().contains(controlOID); |
| | | } |
| | | |
| | |
| | | */ |
| | | public Set<String> getSupportedFeatures() |
| | | { |
| | | |
| | | return supportedFeatureOIDs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final boolean supportsFeature(String featureOID) |
| | | { |
| | | |
| | | return getSupportedFeatures().contains(featureOID); |
| | | } |
| | | } |
| | |
| | | */ |
| | | public void finalizeGroupImplementation() |
| | | { |
| | | |
| | | // No implementation is required by default. |
| | | } |
| | | |
| | |
| | | public MemberList getMembers() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return getMembers(null, null, null); |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void finalizeIdentityMapper() |
| | | { |
| | | |
| | | // No implementation is required by default. |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getNameOrOID() |
| | | { |
| | | |
| | | String name = getName(); |
| | | if ((name == null) || (name.length() == 0)) |
| | | { |
| | |
| | | */ |
| | | public boolean isObsolete() |
| | | { |
| | | |
| | | return false; |
| | | } |
| | | |
| | |
| | | */ |
| | | public int hashCode() |
| | | { |
| | | |
| | | int hashCode = 0; |
| | | |
| | | String oidString = getOID(); |
| | |
| | | */ |
| | | public boolean equals(Object o) |
| | | { |
| | | |
| | | if (o == null) |
| | | { |
| | | return false; |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("( "); |
| | | buffer.append(getOID()); |
| | | buffer.append(" NAME '"); |
| | |
| | | */ |
| | | public void finalizeMonitorProvider() |
| | | { |
| | | |
| | | // Signal the monitor thread that it should stop. |
| | | stopRequested = true; |
| | | |
| | |
| | | */ |
| | | public ObjectClass getMonitorObjectClass() |
| | | { |
| | | |
| | | return DirectoryConfig.getObjectClass(OC_EXTENSIBLE_OBJECT_LC, |
| | | true); |
| | | } |
| | |
| | | */ |
| | | public final void run() |
| | | { |
| | | |
| | | |
| | | monitorThread = Thread.currentThread(); |
| | | |
| | | |
| | |
| | | public ConditionResult valuesMatch(ByteString attributeValue, |
| | | ByteString assertionValue) |
| | | { |
| | | |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | } |
| | |
| | | */ |
| | | public void finalizePasswordGenerator() |
| | | { |
| | | |
| | | // No action is performed by default. |
| | | } |
| | | |
| | |
| | | */ |
| | | public void finalizePasswordStorageScheme() |
| | | { |
| | | |
| | | // No implementation required by default. |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getAuthPasswordSchemeName() |
| | | { |
| | | |
| | | return getStorageSchemeName(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public void finalizePasswordValidator() |
| | | { |
| | | |
| | | |
| | | // No action is required by default. |
| | | } |
| | | |
| | |
| | | */ |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | | |
| | | // No implementation is required by default. |
| | | } |
| | | |
| | |
| | | public ConditionResult valuesMatch(ByteString attributeValue, |
| | | ByteString assertionValue) |
| | | { |
| | | |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | } |
| | |
| | | */ |
| | | public void finalizeSynchronizationProvider() |
| | | { |
| | | |
| | | // No implementation is required by default. |
| | | } |
| | | |
| | |
| | | handleConflictResolution(AddOperation addOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | // No processing is required by default. |
| | | return new SynchronizationProviderResult(true); |
| | | } |
| | |
| | | handleConflictResolution(DeleteOperation deleteOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | // No processing is required by default. |
| | | return new SynchronizationProviderResult(true); |
| | | } |
| | |
| | | modifyOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | // No processing is required by default. |
| | | return new SynchronizationProviderResult(true); |
| | | } |
| | |
| | | modifyDNOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | // No processing is required by default. |
| | | return new SynchronizationProviderResult(true); |
| | | } |
| | |
| | | */ |
| | | public boolean waitUntilIdle(long timeLimit) |
| | | { |
| | | |
| | | long stopWaitingTime; |
| | | if (timeLimit <= 0) |
| | | { |
| | |
| | | */ |
| | | protected DirectoryServerPlugin() |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | public final void initializeInternal(DN pluginDN, |
| | | Set<PluginType> pluginTypes) |
| | | { |
| | | |
| | | this.pluginDN = pluginDN; |
| | | this.pluginTypes = pluginTypes; |
| | | } |
| | |
| | | */ |
| | | public void finalizePlugin() |
| | | { |
| | | |
| | | // No implementation is required by default. |
| | | } |
| | | |
| | |
| | | */ |
| | | public final DN getPluginEntryDN() |
| | | { |
| | | |
| | | return pluginDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Set<PluginType> getPluginTypes() |
| | | { |
| | | |
| | | return pluginTypes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public StartupPluginResult doStartup() |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.STARTUP.getName()); |
| | |
| | | */ |
| | | public void doShutdown(String reason) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.SHUTDOWN.getName()); |
| | |
| | | public PostConnectPluginResult doPostConnect(ClientConnection |
| | | clientConnection) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.POST_CONNECT.getName()); |
| | |
| | | DisconnectReason disconnectReason, |
| | | int messageID, String message) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String msg = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.POST_DISCONNECT.getName()); |
| | |
| | | public LDIFPluginResult doLDIFImport(LDIFImportConfig importConfig, |
| | | Entry entry) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.LDIF_IMPORT.getName()); |
| | |
| | | public LDIFPluginResult doLDIFExport(LDIFExportConfig exportConfig, |
| | | Entry entry) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.LDIF_EXPORT.getName()); |
| | |
| | | public PreParsePluginResult |
| | | doPreParse(PreParseAbandonOperation abandonOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_PARSE_ABANDON.getName()); |
| | |
| | | public PostOperationPluginResult |
| | | doPostOperation(PostOperationAbandonOperation abandonOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = |
| | | getMessage(msgID, String.valueOf(pluginDN), |
| | |
| | | public PreParsePluginResult |
| | | doPreParse(PreParseAddOperation addOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_PARSE_ADD.getName()); |
| | |
| | | public PreOperationPluginResult |
| | | doPreOperation(PreOperationAddOperation addOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_OPERATION_ADD.getName()); |
| | |
| | | public PostOperationPluginResult |
| | | doPostOperation(PostOperationAddOperation addOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.POST_OPERATION_ADD.getName()); |
| | |
| | | public PostResponsePluginResult |
| | | doPostResponse(PostResponseAddOperation addOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.POST_RESPONSE_ADD.getName()); |
| | |
| | | public PreParsePluginResult |
| | | doPreParse(PreParseBindOperation bindOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_PARSE_BIND.getName()); |
| | |
| | | public PreOperationPluginResult |
| | | doPreOperation(PreOperationBindOperation bindOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_OPERATION_BIND.getName()); |
| | |
| | | public PostOperationPluginResult |
| | | doPostOperation(PostOperationBindOperation bindOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.POST_OPERATION_BIND.getName()); |
| | |
| | | public PostResponsePluginResult |
| | | doPostResponse(PostResponseBindOperation bindOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.POST_RESPONSE_BIND.getName()); |
| | |
| | | public PreParsePluginResult |
| | | doPreParse(PreParseCompareOperation compareOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_PARSE_COMPARE.getName()); |
| | |
| | | public PreOperationPluginResult |
| | | doPreOperation(PreOperationCompareOperation compareOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_OPERATION_COMPARE.getName()); |
| | |
| | | public PostOperationPluginResult |
| | | doPostOperation(PostOperationCompareOperation compareOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = |
| | | getMessage(msgID, String.valueOf(pluginDN), |
| | |
| | | public PostResponsePluginResult |
| | | doPostResponse(PostResponseCompareOperation compareOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.POST_RESPONSE_COMPARE.getName()); |
| | |
| | | public PreParsePluginResult |
| | | doPreParse(PreParseDeleteOperation deleteOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_PARSE_DELETE.getName()); |
| | |
| | | public PreOperationPluginResult |
| | | doPreOperation(PreOperationDeleteOperation deleteOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_OPERATION_DELETE.getName()); |
| | |
| | | public PostOperationPluginResult |
| | | doPostOperation(PostOperationDeleteOperation deleteOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.POST_OPERATION_DELETE.getName()); |
| | |
| | | public PostResponsePluginResult |
| | | doPostResponse(PostResponseDeleteOperation deleteOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.POST_RESPONSE_DELETE.getName()); |
| | |
| | | public PreParsePluginResult |
| | | doPreParse(PreParseExtendedOperation extendedOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_PARSE_EXTENDED.getName()); |
| | |
| | | public PreOperationPluginResult |
| | | doPreOperation(PreOperationExtendedOperation extendedOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = |
| | | getMessage(msgID, String.valueOf(pluginDN), |
| | |
| | | doPostOperation(PostOperationExtendedOperation |
| | | extendedOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = |
| | | getMessage(msgID, String.valueOf(pluginDN), |
| | |
| | | public PostResponsePluginResult |
| | | doPostResponse(PostResponseExtendedOperation extendedOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = |
| | | getMessage(msgID, String.valueOf(pluginDN), |
| | |
| | | public PreParsePluginResult |
| | | doPreParse(PreParseModifyOperation modifyOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_PARSE_MODIFY.getName()); |
| | |
| | | public PreOperationPluginResult |
| | | doPreOperation(PreOperationModifyOperation modifyOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_OPERATION_MODIFY.getName()); |
| | |
| | | public PostOperationPluginResult |
| | | doPostOperation(PostOperationModifyOperation modifyOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.POST_OPERATION_MODIFY.getName()); |
| | |
| | | public PostResponsePluginResult |
| | | doPostResponse(PostResponseModifyOperation modifyOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.POST_RESPONSE_MODIFY.getName()); |
| | |
| | | public PreParsePluginResult |
| | | doPreParse(PreParseModifyDNOperation modifyDNOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_PARSE_MODIFY_DN.getName()); |
| | |
| | | public PreOperationPluginResult |
| | | doPreOperation(PreOperationModifyDNOperation modifyDNOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = |
| | | getMessage(msgID, String.valueOf(pluginDN), |
| | |
| | | doPostOperation(PostOperationModifyDNOperation |
| | | modifyDNOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = |
| | | getMessage(msgID, String.valueOf(pluginDN), |
| | |
| | | public PostResponsePluginResult |
| | | doPostResponse(PostResponseModifyDNOperation modifyDNOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = |
| | | getMessage(msgID, String.valueOf(pluginDN), |
| | |
| | | public PreParsePluginResult |
| | | doPreParse(PreParseSearchOperation searchOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_PARSE_SEARCH.getName()); |
| | |
| | | public PreOperationPluginResult |
| | | doPreOperation(PreOperationSearchOperation searchOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_OPERATION_SEARCH.getName()); |
| | |
| | | processSearchEntry(SearchEntrySearchOperation searchOperation, |
| | | SearchResultEntry searchEntry) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.SEARCH_RESULT_ENTRY.getName()); |
| | |
| | | searchOperation, |
| | | SearchResultReference searchReference) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = |
| | | getMessage(msgID, String.valueOf(pluginDN), |
| | |
| | | public PostOperationPluginResult |
| | | doPostOperation(PostOperationSearchOperation searchOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.POST_OPERATION_SEARCH.getName()); |
| | |
| | | public PostResponsePluginResult |
| | | doPostResponse(PostResponseSearchOperation searchOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.POST_RESPONSE_SEARCH.getName()); |
| | |
| | | public PreParsePluginResult |
| | | doPreParse(PreParseUnbindOperation unbindOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.PRE_PARSE_UNBIND.getName()); |
| | |
| | | public PostOperationPluginResult |
| | | doPostOperation(PostOperationUnbindOperation unbindOperation) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.POST_OPERATION_UNBIND.getName()); |
| | |
| | | processIntermediateResponse( |
| | | IntermediateResponse intermediateResponse) |
| | | { |
| | | |
| | | int msgID = MSGID_PLUGIN_TYPE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(pluginDN), |
| | | PluginType.INTERMEDIATE_RESPONSE.getName()); |
| | |
| | | boolean sendIntermediateResponse, |
| | | boolean continueOperation) |
| | | { |
| | | |
| | | this.connectionTerminated = connectionTerminated; |
| | | this.continuePluginProcessing = continuePluginProcessing; |
| | | this.sendIntermediateResponse = sendIntermediateResponse; |
| | |
| | | */ |
| | | public boolean connectionTerminated() |
| | | { |
| | | |
| | | return connectionTerminated; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean continuePluginProcessing() |
| | | { |
| | | |
| | | return continuePluginProcessing; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean sendIntermediateResponse() |
| | | { |
| | | |
| | | return sendIntermediateResponse; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean continueOperation() |
| | | { |
| | | |
| | | return continueOperation; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("IntermediateResponsePluginResult(" + |
| | | "connectionTerminated="); |
| | | buffer.append(connectionTerminated); |
| | |
| | | public LDIFPluginResult(boolean continuePluginProcessing, |
| | | boolean continueEntryProcessing) |
| | | { |
| | | |
| | | this.continuePluginProcessing = continuePluginProcessing; |
| | | this.continueEntryProcessing = continueEntryProcessing; |
| | | } |
| | |
| | | */ |
| | | public boolean continuePluginProcessing() |
| | | { |
| | | |
| | | return continuePluginProcessing; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean continueEntryProcessing() |
| | | { |
| | | |
| | | return continueEntryProcessing; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("LDIFPluginResult(continuePluginProcessing="); |
| | | buffer.append(continuePluginProcessing); |
| | | buffer.append(", continueEntryProcessing="); |
| | |
| | | public PostConnectPluginResult(boolean connectionTerminated, |
| | | boolean continuePluginProcessing) |
| | | { |
| | | |
| | | this.connectionTerminated = connectionTerminated; |
| | | this.continuePluginProcessing = continuePluginProcessing; |
| | | } |
| | |
| | | */ |
| | | public boolean connectionTerminated() |
| | | { |
| | | |
| | | return connectionTerminated; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean continuePluginProcessing() |
| | | { |
| | | |
| | | return continuePluginProcessing; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("PostConnectPluginResult(connectionTerminated="); |
| | | buffer.append(connectionTerminated); |
| | | buffer.append(", continuePluginProcessing="); |
| | |
| | | */ |
| | | public PostDisconnectPluginResult(boolean continuePluginProcessing) |
| | | { |
| | | |
| | | this.continuePluginProcessing = continuePluginProcessing; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean continuePluginProcessing() |
| | | { |
| | | |
| | | return continuePluginProcessing; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("PostDisconnectPluginResult(" + |
| | | "continuePluginProcessing="); |
| | | buffer.append(continuePluginProcessing); |
| | |
| | | public PostOperationPluginResult(boolean connectionTerminated, |
| | | boolean continuePluginProcessing) |
| | | { |
| | | |
| | | this.connectionTerminated = connectionTerminated; |
| | | this.continuePluginProcessing = continuePluginProcessing; |
| | | } |
| | |
| | | */ |
| | | public boolean connectionTerminated() |
| | | { |
| | | |
| | | return connectionTerminated; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean continuePluginProcessing() |
| | | { |
| | | |
| | | return continuePluginProcessing; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("PostOperationPluginResult(connectionTerminated="); |
| | | buffer.append(connectionTerminated); |
| | | buffer.append(", continuePluginProcessing="); |
| | |
| | | public PostResponsePluginResult(boolean connectionTerminated, |
| | | boolean continuePluginProcessing) |
| | | { |
| | | |
| | | this.connectionTerminated = connectionTerminated; |
| | | this.continuePluginProcessing = continuePluginProcessing; |
| | | } |
| | |
| | | */ |
| | | public boolean continuePluginProcessing() |
| | | { |
| | | |
| | | return continuePluginProcessing; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean connectionTerminated() |
| | | { |
| | | |
| | | return connectionTerminated; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("PostResponsePluginResult(connectionTerminated="); |
| | | buffer.append(connectionTerminated); |
| | | buffer.append(", continuePluginProcessing="); |
| | |
| | | boolean continuePluginProcessing, |
| | | boolean sendResponseImmediately) |
| | | { |
| | | |
| | | this.connectionTerminated = connectionTerminated; |
| | | this.continuePluginProcessing = continuePluginProcessing; |
| | | this.sendResponseImmediately = sendResponseImmediately; |
| | |
| | | */ |
| | | public boolean connectionTerminated() |
| | | { |
| | | |
| | | return connectionTerminated; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean continuePluginProcessing() |
| | | { |
| | | |
| | | return continuePluginProcessing; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean sendResponseImmediately() |
| | | { |
| | | |
| | | return sendResponseImmediately; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("PostResponsePluginResult(connectionTerminated="); |
| | | buffer.append(connectionTerminated); |
| | | buffer.append(", continuePluginProcessing="); |
| | |
| | | boolean continuePluginProcessing, |
| | | boolean sendResponseImmediately) |
| | | { |
| | | |
| | | this.connectionTerminated = connectionTerminated; |
| | | this.continuePluginProcessing = continuePluginProcessing; |
| | | this.sendResponseImmediately = sendResponseImmediately; |
| | |
| | | */ |
| | | public boolean connectionTerminated() |
| | | { |
| | | |
| | | return connectionTerminated; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean continuePluginProcessing() |
| | | { |
| | | |
| | | return continuePluginProcessing; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean sendResponseImmediately() |
| | | { |
| | | |
| | | return sendResponseImmediately; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("PostResponsePluginResult(connectionTerminated="); |
| | | buffer.append(connectionTerminated); |
| | | buffer.append(", continuePluginProcessing="); |
| | |
| | | boolean sendEntry, |
| | | boolean continueSearch) |
| | | { |
| | | |
| | | this.connectionTerminated = connectionTerminated; |
| | | this.continuePluginProcessing = continuePluginProcessing; |
| | | this.sendEntry = sendEntry; |
| | |
| | | */ |
| | | public boolean connectionTerminated() |
| | | { |
| | | |
| | | return connectionTerminated; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean continuePluginProcessing() |
| | | { |
| | | |
| | | return continuePluginProcessing; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean sendEntry() |
| | | { |
| | | |
| | | return sendEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean continueSearch() |
| | | { |
| | | |
| | | return continueSearch; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("SearchEntryPluginResult(connectionTerminated="); |
| | | buffer.append(connectionTerminated); |
| | | buffer.append(", continuePluginProcessing="); |
| | |
| | | boolean sendReference, |
| | | boolean continueSearch) |
| | | { |
| | | |
| | | this.connectionTerminated = connectionTerminated; |
| | | this.continuePluginProcessing = continuePluginProcessing; |
| | | this.sendReference = sendReference; |
| | |
| | | */ |
| | | public boolean connectionTerminated() |
| | | { |
| | | |
| | | return connectionTerminated; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean continuePluginProcessing() |
| | | { |
| | | |
| | | return continuePluginProcessing; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean sendReference() |
| | | { |
| | | |
| | | return sendReference; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean continueSearch() |
| | | { |
| | | |
| | | return continueSearch; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("SearchReferencePluginResult(" + |
| | | "connectionTerminated="); |
| | | buffer.append(connectionTerminated); |
| | |
| | | boolean continueStartup, int errorID, |
| | | String errorMessage) |
| | | { |
| | | |
| | | this.completedSuccessfully = completedSuccessfully; |
| | | this.continueStartup = continueStartup; |
| | | this.errorID = errorID; |
| | |
| | | */ |
| | | public boolean completedSuccessfully() |
| | | { |
| | | |
| | | return completedSuccessfully; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean continueStartup() |
| | | { |
| | | |
| | | return continueStartup; |
| | | } |
| | | |
| | |
| | | */ |
| | | public int getErrorID() |
| | | { |
| | | |
| | | return errorID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getErrorMessage() |
| | | { |
| | | |
| | | return errorMessage; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("StartupPluginResult(completedSuccessfully="); |
| | | buffer.append(completedSuccessfully); |
| | | buffer.append(", continueStartup="); |
| | |
| | | |
| | | public boolean match (InetAddress theSourceAddress) |
| | | { |
| | | |
| | | byte[] addr = theSourceAddress.getAddress(); |
| | | |
| | | if ((addr.length * 8) < _bits) { |
| | |
| | | public void initializeBackend(ConfigEntry configEntry, DN[] baseDNs) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // Make sure that a configuration entry was provided. If not, then we will |
| | | // not be able to complete initialization. |
| | | if (configEntry == null) |
| | |
| | | */ |
| | | public void finalizeBackend() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | |
| | | try |
| | |
| | | */ |
| | | public DN[] getBaseDNs() |
| | | { |
| | | |
| | | return baseDNs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getEntryCount() |
| | | { |
| | | |
| | | int numEntries = 1; |
| | | |
| | | AttributeType backupPathType = |
| | |
| | | */ |
| | | public boolean isLocal() |
| | | { |
| | | |
| | | // For the purposes of this method, this is a local backend. |
| | | return true; |
| | | } |
| | |
| | | public Entry getEntry(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // If the requested entry was null, then throw an exception. |
| | | if (entryDN == null) |
| | | { |
| | |
| | | private Entry getBackupDirectoryEntry(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Make sure that the DN specifies a backup directory. |
| | | AttributeType t = |
| | | DirectoryServer.getAttributeType(ATTR_BACKUP_DIRECTORY_PATH, true); |
| | |
| | | private Entry getBackupEntry(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // First, get the backup ID from the entry DN. |
| | | AttributeType idType = DirectoryServer.getAttributeType(ATTR_BACKUP_ID, |
| | | true); |
| | |
| | | public void addEntry(Entry entry, AddOperation addOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_BACKUP_ADD_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void deleteEntry(DN entryDN, DeleteOperation deleteOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_BACKUP_DELETE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void replaceEntry(Entry entry, ModifyOperation modifyOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_BACKUP_MODIFY_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | ModifyDNOperation modifyDNOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_BACKUP_MODIFY_DN_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void search(SearchOperation searchOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Get the base entry for the search, if possible. If it doesn't exist, |
| | | // then this will throw an exception. |
| | | DN baseDN = searchOperation.getBaseDN(); |
| | |
| | | */ |
| | | public HashSet<String> getSupportedControls() |
| | | { |
| | | |
| | | return supportedControls; |
| | | } |
| | | |
| | |
| | | */ |
| | | public HashSet<String> getSupportedFeatures() |
| | | { |
| | | |
| | | return supportedFeatures; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsLDIFExport() |
| | | { |
| | | |
| | | // We do not support LDIF exports. |
| | | return false; |
| | | } |
| | |
| | | LDIFExportConfig exportConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_BACKUP_EXPORT_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | */ |
| | | public boolean supportsLDIFImport() |
| | | { |
| | | |
| | | // This backend does not support LDIF imports. |
| | | return false; |
| | | } |
| | |
| | | LDIFImportConfig importConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not support LDIF imports. |
| | | int msgID = MSGID_BACKUP_IMPORT_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public boolean supportsBackup() |
| | | { |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | public boolean supportsBackup(BackupConfig backupConfig, |
| | | StringBuilder unsupportedReason) |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | public void createBackup(ConfigEntry configEntry, BackupConfig backupConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | int msgID = MSGID_BACKUP_BACKUP_AND_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | String backupID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | int msgID = MSGID_BACKUP_BACKUP_AND_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public boolean supportsRestore() |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | RestoreConfig restoreConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | int msgID = MSGID_BACKUP_BACKUP_AND_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | |
| | | LinkedList<ConfigAttribute> attrs = new LinkedList<ConfigAttribute>(); |
| | | |
| | | |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // We'll accept anything here. The only configurable attribute is the |
| | | // default set of backup directories, but that doesn't require any |
| | | // validation at this point. |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | DN[] baseDNs) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // We won't support anything other than exactly one base DN in this |
| | | // implementation. If we were to add such support in the future, we would |
| | | // likely want to separate the data for each base DN into a separate entry |
| | |
| | | */ |
| | | public synchronized void finalizeBackend() |
| | | { |
| | | |
| | | clearMemoryBackend(); |
| | | |
| | | for (DN dn : baseDNs) |
| | |
| | | */ |
| | | public DN[] getBaseDNs() |
| | | { |
| | | |
| | | return baseDNs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public synchronized long getEntryCount() |
| | | { |
| | | |
| | | if (entryMap != null) |
| | | { |
| | | return entryMap.size(); |
| | |
| | | */ |
| | | public boolean isLocal() |
| | | { |
| | | |
| | | // For the purposes of this method, this is a local backend. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public synchronized Entry getEntry(DN entryDN) |
| | | { |
| | | |
| | | return entryMap.get(entryDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public synchronized boolean entryExists(DN entryDN) |
| | | { |
| | | |
| | | return entryMap.containsKey(entryDN); |
| | | } |
| | | |
| | |
| | | public synchronized void addEntry(Entry entry, AddOperation addOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // See if the target entry already exists. If so, then fail. |
| | | DN entryDN = entry.getDN(); |
| | | if (entryMap.containsKey(entryDN)) |
| | |
| | | DeleteOperation deleteOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Make sure the entry exists. If not, then throw an exception. |
| | | if (! entryMap.containsKey(entryDN)) |
| | | { |
| | |
| | | ModifyOperation modifyOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Make sure the entry exists. If not, then throw an exception. |
| | | DN entryDN = entry.getDN(); |
| | | if (! entryMap.containsKey(entryDN)) |
| | |
| | | ModifyDNOperation modifyDNOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Make sure that the target entry exists. |
| | | if (! entryMap.containsKey(currentDN)) |
| | | { |
| | |
| | | public synchronized void search(SearchOperation searchOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Get the base DN, scope, and filter for the search. |
| | | DN baseDN = searchOperation.getBaseDN(); |
| | | SearchScope scope = searchOperation.getScope(); |
| | |
| | | */ |
| | | public HashSet<String> getSupportedControls() |
| | | { |
| | | |
| | | return supportedControls; |
| | | } |
| | | |
| | |
| | | */ |
| | | public HashSet<String> getSupportedFeatures() |
| | | { |
| | | |
| | | return supportedFeatures; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsLDIFExport() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | LDIFExportConfig exportConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Create the LDIF writer. |
| | | LDIFWriter ldifWriter; |
| | | try |
| | |
| | | */ |
| | | public boolean supportsLDIFImport() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | LDIFImportConfig importConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | clearMemoryBackend(); |
| | | |
| | | LDIFReader reader; |
| | |
| | | */ |
| | | public boolean supportsBackup() |
| | | { |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | public boolean supportsBackup(BackupConfig backupConfig, |
| | | StringBuilder unsupportedReason) |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | public void createBackup(ConfigEntry configEntry, BackupConfig backupConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | int msgID = MSGID_MEMORYBACKEND_BACKUP_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | String backupID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | int msgID = MSGID_MEMORYBACKEND_BACKUP_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | */ |
| | | public boolean supportsRestore() |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | RestoreConfig restoreConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | int msgID = MSGID_MEMORYBACKEND_BACKUP_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void initializeBackend(ConfigEntry configEntry, DN[] baseDNs) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // Make sure that a configuration entry was provided. If not, then we will |
| | | // not be able to complete initialization. |
| | | if (configEntry == null) |
| | |
| | | */ |
| | | public void finalizeBackend() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | |
| | | try |
| | |
| | | */ |
| | | private boolean isMonitorConfigAttribute(Attribute attribute) |
| | | { |
| | | |
| | | AttributeType attrType = attribute.getAttributeType(); |
| | | if (attrType.hasName(ATTR_COMMON_NAME) || |
| | | attrType.hasName(ATTR_BACKEND_ENABLED.toLowerCase()) || |
| | |
| | | */ |
| | | public DN[] getBaseDNs() |
| | | { |
| | | |
| | | return baseDNs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getEntryCount() |
| | | { |
| | | |
| | | return DirectoryServer.getMonitorProviders().size() + 1; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isLocal() |
| | | { |
| | | |
| | | // For the purposes of this method, this is a local backend. |
| | | return true; |
| | | } |
| | |
| | | public Entry getEntry(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // If the requested entry was null, then throw an exception. |
| | | if (entryDN == null) |
| | | { |
| | |
| | | public boolean entryExists(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | if (entryDN.equals(baseMonitorDN)) |
| | | { |
| | | return true; |
| | |
| | | */ |
| | | public Entry getBaseMonitorEntry() |
| | | { |
| | | |
| | | |
| | | HashMap<ObjectClass,String> monitorClasses = |
| | | new LinkedHashMap<ObjectClass,String>(3); |
| | | monitorClasses.putAll(monitorObjectClasses); |
| | |
| | | */ |
| | | private Entry getMonitorEntry(DN entryDN, MonitorProvider monitorProvider) |
| | | { |
| | | |
| | | HashMap<ObjectClass,String> monitorClasses = |
| | | new LinkedHashMap<ObjectClass,String>(3); |
| | | monitorClasses.putAll(monitorObjectClasses); |
| | |
| | | private Attribute createAttribute(String name, String lowerName, |
| | | String value) |
| | | { |
| | | |
| | | AttributeType type = DirectoryServer.getAttributeType(lowerName); |
| | | if (type == null) |
| | | { |
| | |
| | | public void addEntry(Entry entry, AddOperation addOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_MONITOR_ADD_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(entry.getDN())); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void deleteEntry(DN entryDN, DeleteOperation deleteOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_MONITOR_DELETE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(entryDN)); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void replaceEntry(Entry entry, ModifyOperation modifyOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_MONITOR_MODIFY_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(entry.getDN()), |
| | | String.valueOf(configEntryDN)); |
| | |
| | | ModifyDNOperation modifyDNOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_MONITOR_MODIFY_DN_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(currentDN)); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void search(SearchOperation searchOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Get the base entry for the search, if possible. If it doesn't exist, |
| | | // then this will throw an exception. |
| | | DN baseDN = searchOperation.getBaseDN(); |
| | |
| | | */ |
| | | public HashSet<String> getSupportedControls() |
| | | { |
| | | |
| | | return supportedControls; |
| | | } |
| | | |
| | |
| | | */ |
| | | public HashSet<String> getSupportedFeatures() |
| | | { |
| | | |
| | | return supportedFeatures; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsLDIFExport() |
| | | { |
| | | |
| | | // We can export all the monitor entries as a point-in-time snapshot. |
| | | return true; |
| | | } |
| | |
| | | LDIFExportConfig exportConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Create the LDIF writer. |
| | | LDIFWriter ldifWriter; |
| | | try |
| | |
| | | */ |
| | | public boolean supportsLDIFImport() |
| | | { |
| | | |
| | | // This backend does not support LDIF imports. |
| | | return false; |
| | | } |
| | |
| | | LDIFImportConfig importConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not support LDIF imports. |
| | | int msgID = MSGID_MONITOR_IMPORT_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public boolean supportsBackup() |
| | | { |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | public boolean supportsBackup(BackupConfig backupConfig, |
| | | StringBuilder unsupportedReason) |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | public void createBackup(ConfigEntry configEntry, BackupConfig backupConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | int msgID = MSGID_MONITOR_BACKUP_AND_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | String backupID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | int msgID = MSGID_MONITOR_BACKUP_AND_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public boolean supportsRestore() |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | RestoreConfig restoreConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | int msgID = MSGID_MONITOR_BACKUP_AND_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | // There are no configurable attributes that will be explicitly advertised. |
| | | return new LinkedList<ConfigAttribute>(); |
| | | } |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // We'll pretty much accept anything here as long as it isn't one of our |
| | | // private attributes. |
| | | return true; |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public void initializeBackend(ConfigEntry configEntry, DN[] baseDNs) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // Make sure that a configuration entry was provided. If not, then we will |
| | | // not be able to complete initialization. |
| | | if (configEntry == null) |
| | |
| | | */ |
| | | public void finalizeBackend() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | } |
| | | |
| | |
| | | */ |
| | | private boolean isDSEConfigAttribute(Attribute attribute) |
| | | { |
| | | |
| | | AttributeType attrType = attribute.getAttributeType(); |
| | | if (attrType.hasName(ATTR_ROOT_DSE_SUBORDINATE_BASE_DN.toLowerCase()) || |
| | | attrType.hasName(ATTR_ROOTDSE_SHOW_ALL_ATTRIBUTES.toLowerCase()) || |
| | |
| | | */ |
| | | public DN[] getBaseDNs() |
| | | { |
| | | |
| | | return baseDNs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public synchronized long getEntryCount() |
| | | { |
| | | |
| | | // There is always just a single entry in this backend. |
| | | return 1; |
| | | } |
| | |
| | | */ |
| | | public boolean isLocal() |
| | | { |
| | | |
| | | // For the purposes of this method, this is a local backend. |
| | | return true; |
| | | } |
| | |
| | | public Entry getEntry(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // If the requested entry was the root DSE, then create and return it. |
| | | if ((entryDN == null) || entryDN.isNullDN()) |
| | | { |
| | |
| | | */ |
| | | public Entry getRootDSE() |
| | | { |
| | | |
| | | HashMap<AttributeType,List<Attribute>> dseUserAttrs = |
| | | new HashMap<AttributeType,List<Attribute>>(); |
| | | |
| | |
| | | private Attribute createAttribute(String name, String lowerName, |
| | | String value) |
| | | { |
| | | |
| | | AttributeType type = DirectoryServer.getAttributeType(lowerName); |
| | | if (type == null) |
| | | { |
| | |
| | | private Attribute createDNAttribute(String name, String lowerName, |
| | | Collection<DN> values) |
| | | { |
| | | |
| | | AttributeType type = DirectoryServer.getAttributeType(lowerName); |
| | | if (type == null) |
| | | { |
| | |
| | | private Attribute createAttribute(String name, String lowerName, |
| | | Collection<String> values) |
| | | { |
| | | |
| | | AttributeType type = DirectoryServer.getAttributeType(lowerName); |
| | | if (type == null) |
| | | { |
| | |
| | | public boolean entryExists(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // If the specified DN was the null DN, then it exists. |
| | | if (entryDN.isNullDN()) |
| | | { |
| | |
| | | public void addEntry(Entry entry, AddOperation addOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_ROOTDSE_ADD_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(entry.getDN())); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void deleteEntry(DN entryDN, DeleteOperation deleteOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_ROOTDSE_DELETE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(entryDN)); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void replaceEntry(Entry entry, ModifyOperation modifyOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_ROOTDSE_MODIFY_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(entry.getDN()), |
| | | String.valueOf(configEntryDN)); |
| | |
| | | ModifyDNOperation modifyDNOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_ROOTDSE_MODIFY_DN_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(currentDN)); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void search(SearchOperation searchOperation) |
| | | throws DirectoryException, CancelledOperationException |
| | | { |
| | | |
| | | DN baseDN = searchOperation.getBaseDN(); |
| | | if (! baseDN.isNullDN()) |
| | | { |
| | |
| | | */ |
| | | public HashSet<String> getSupportedControls() |
| | | { |
| | | |
| | | return supportedControls; |
| | | } |
| | | |
| | |
| | | */ |
| | | public HashSet<String> getSupportedFeatures() |
| | | { |
| | | |
| | | return supportedFeatures; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsLDIFExport() |
| | | { |
| | | |
| | | // We will only export the DSE entry itself. |
| | | return true; |
| | | } |
| | |
| | | LDIFExportConfig exportConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Create the LDIF writer. |
| | | LDIFWriter ldifWriter; |
| | | try |
| | |
| | | */ |
| | | public boolean supportsLDIFImport() |
| | | { |
| | | |
| | | // This backend does not support LDIF imports. |
| | | return false; |
| | | } |
| | |
| | | LDIFImportConfig importConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not support LDIF imports. |
| | | int msgID = MSGID_ROOTDSE_IMPORT_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public boolean supportsBackup() |
| | | { |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | public boolean supportsBackup(BackupConfig backupConfig, |
| | | StringBuilder unsupportedReason) |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | public void createBackup(ConfigEntry configEntry, BackupConfig backupConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | int msgID = MSGID_ROOTDSE_BACKUP_AND_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | String backupID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | int msgID = MSGID_ROOTDSE_BACKUP_AND_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public boolean supportsRestore() |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | RestoreConfig restoreConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | int msgID = MSGID_ROOTDSE_BACKUP_AND_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | String description = getMessage(MSGID_ROOTDSE_SUBORDINATE_BASE_DESCRIPTION); |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | boolean configIsAcceptable = true; |
| | | |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public void initializeBackend(ConfigEntry configEntry, DN[] baseDNs) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // Make sure that a configuration entry was provided. If not, then we will |
| | | // not be able to complete initialization. |
| | | if (configEntry == null) |
| | |
| | | */ |
| | | public void finalizeBackend() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | |
| | | for (DN baseDN : baseDNs) |
| | |
| | | */ |
| | | private boolean isSchemaConfigAttribute(Attribute attribute) |
| | | { |
| | | |
| | | AttributeType attrType = attribute.getAttributeType(); |
| | | if (attrType.hasName(ATTR_SCHEMA_ENTRY_DN.toLowerCase()) || |
| | | attrType.hasName(ATTR_BACKEND_ENABLED.toLowerCase()) || |
| | |
| | | */ |
| | | public DN[] getBaseDNs() |
| | | { |
| | | |
| | | return baseDNs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getEntryCount() |
| | | { |
| | | |
| | | // There is always only a single entry in this backend. |
| | | return 1; |
| | | } |
| | |
| | | */ |
| | | public boolean isLocal() |
| | | { |
| | | |
| | | // For the purposes of this method, this is a local backend. |
| | | return true; |
| | | } |
| | |
| | | public Entry getEntry(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // If the requested entry was one of the schema entries, then create and |
| | | // return it. |
| | | DN[] dnArray = baseDNs; |
| | |
| | | */ |
| | | public Entry getSchemaEntry(DN entryDN) |
| | | { |
| | | |
| | | LinkedHashMap<AttributeType,List<Attribute>> userAttrs = |
| | | new LinkedHashMap<AttributeType,List<Attribute>>(); |
| | | |
| | |
| | | public boolean entryExists(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // The specified DN must be one of the specified schema DNs. |
| | | DN[] baseArray = baseDNs; |
| | | for (DN baseDN : baseArray) |
| | |
| | | public void addEntry(Entry entry, AddOperation addOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_SCHEMA_ADD_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(entry.getDN())); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void deleteEntry(DN entryDN, DeleteOperation deleteOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_SCHEMA_DELETE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(entryDN)); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void replaceEntry(Entry entry, ModifyOperation modifyOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Make sure that the authenticated user has the necessary UPDATE_SCHEMA |
| | | // privilege. |
| | | ClientConnection clientConnection = modifyOperation.getClientConnection(); |
| | |
| | | Set<String> modifiedSchemaFiles) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // First, see if the specified attribute type already exists. We'll check |
| | | // the OID and all of the names, which means that it's possible there could |
| | | // be more than one match (although if there is, then we'll refuse the |
| | |
| | | Set<String> modifiedSchemaFiles) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // See if the specified attribute type is actually defined in the server |
| | | // schema. If not, then fail. |
| | | AttributeType removeType = schema.getAttributeType(attributeType.getOID()); |
| | |
| | | Set<String> modifiedSchemaFiles) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // First, see if the specified objectclass already exists. We'll check the |
| | | // OID and all of the names, which means that it's possible there could be |
| | | // more than one match (although if there is, then we'll refuse the |
| | |
| | | Set<String> modifiedSchemaFiles) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // See if the specified objectclass is actually defined in the server |
| | | // schema. If not, then fail. |
| | | ObjectClass removeClass = schema.getObjectClass(objectClass.getOID()); |
| | |
| | | Set<String> modifiedSchemaFiles) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // First, see if the specified name form already exists. We'll check the |
| | | // OID and all of the names, which means that it's possible there could be |
| | | // more than one match (although if there is, then we'll refuse the |
| | |
| | | Set<String> modifiedSchemaFiles) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // See if the specified name form is actually defined in the server schema. |
| | | // If not, then fail. |
| | | NameForm removeNF = schema.getNameForm(nameForm.getOID()); |
| | |
| | | Set<String> modifiedSchemaFiles) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // First, see if the specified DIT content rule already exists. We'll check |
| | | // all of the names, which means that it's possible there could be more than |
| | | // one match (although if there is, then we'll refuse the operation). |
| | |
| | | Set<String> modifiedSchemaFiles) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // See if the specified DIT content rule is actually defined in the server |
| | | // schema. If not, then fail. |
| | | DITContentRule removeDCR = |
| | |
| | | Set<String> modifiedSchemaFiles) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // First, see if the specified DIT structure rule already exists. We'll |
| | | // check the rule ID and all of the names, which means that it's possible |
| | | // there could be more than one match (although if there is, then we'll |
| | |
| | | Set<String> modifiedSchemaFiles) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // See if the specified DIT structure rule is actually defined in the server |
| | | // schema. If not, then fail. |
| | | DITStructureRule removeDSR = |
| | |
| | | Set<String> modifiedSchemaFiles) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // First, see if the specified matching rule use already exists. We'll |
| | | // check all of the names, which means that it's possible that there could |
| | | // be more than one match (although if there is, then we'll refuse the |
| | |
| | | Set<String> modifiedSchemaFiles) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // See if the specified DIT content rule is actually defined in the server |
| | | // schema. If not, then fail. |
| | | MatchingRuleUse removeMRU = |
| | |
| | | */ |
| | | private Entry createEmptySchemaEntry() |
| | | { |
| | | |
| | | LinkedHashMap<ObjectClass,String> objectClasses = |
| | | new LinkedHashMap<ObjectClass,String>(); |
| | | objectClasses.put(DirectoryServer.getTopObjectClass(), OC_TOP); |
| | |
| | | private File writeTempSchemaFile(Schema schema, String schemaFile) |
| | | throws DirectoryException, IOException, LDIFException |
| | | { |
| | | |
| | | |
| | | // Start with an empty schema entry. |
| | | Entry schemaEntry = createEmptySchemaEntry(); |
| | | |
| | |
| | | int depth) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | if (depth > 20) |
| | | { |
| | | int msgID = MSGID_SCHEMA_MODIFY_CIRCULAR_REFERENCE_AT; |
| | |
| | | int depth) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | if (depth > 20) |
| | | { |
| | | int msgID = MSGID_SCHEMA_MODIFY_CIRCULAR_REFERENCE_OC; |
| | |
| | | HashSet<DITStructureRule> addedDSRs, int depth) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | if (depth > 20) |
| | | { |
| | | int msgID = MSGID_SCHEMA_MODIFY_CIRCULAR_REFERENCE_DSR; |
| | |
| | | private void installSchemaFiles(HashMap<String,File> tempSchemaFiles) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Create lists that will hold the three types of files we'll be dealing |
| | | // with (the temporary files that will be installed, the installed schema |
| | | // files, and the previously-installed schema files). |
| | |
| | | private void copyFile(File from, File to) |
| | | throws IOException |
| | | { |
| | | |
| | | byte[] buffer = new byte[4096]; |
| | | FileInputStream inputStream = null; |
| | | FileOutputStream outputStream = null; |
| | |
| | | */ |
| | | private void cleanUpTempSchemaFiles(HashMap<String,File> tempSchemaFiles) |
| | | { |
| | | |
| | | if ((tempSchemaFiles == null) || tempSchemaFiles.isEmpty()) |
| | | { |
| | | return; |
| | |
| | | ModifyDNOperation modifyDNOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_SCHEMA_MODIFY_DN_NOT_SUPPORTED; |
| | | String message = getMessage(msgID, String.valueOf(currentDN)); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void search(SearchOperation searchOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | DN baseDN = searchOperation.getBaseDN(); |
| | | |
| | | boolean found = false; |
| | |
| | | */ |
| | | public HashSet<String> getSupportedControls() |
| | | { |
| | | |
| | | return supportedControls; |
| | | } |
| | | |
| | |
| | | */ |
| | | public HashSet<String> getSupportedFeatures() |
| | | { |
| | | |
| | | return supportedFeatures; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsLDIFExport() |
| | | { |
| | | |
| | | // We will only export the DSE entry itself. |
| | | return true; |
| | | } |
| | |
| | | LDIFExportConfig exportConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Create the LDIF writer. |
| | | LDIFWriter ldifWriter; |
| | | try |
| | |
| | | */ |
| | | public boolean supportsLDIFImport() |
| | | { |
| | | |
| | | // This backend does not support LDIF imports. |
| | | // FIXME -- Should we support them? |
| | | return false; |
| | |
| | | LDIFImportConfig importConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not support LDIF imports. |
| | | int msgID = MSGID_SCHEMA_IMPORT_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public boolean supportsBackup() |
| | | { |
| | | |
| | | // We do support an online backup mechanism for the schema. |
| | | return true; |
| | | } |
| | |
| | | public boolean supportsBackup(BackupConfig backupConfig, |
| | | StringBuilder unsupportedReason) |
| | | { |
| | | |
| | | |
| | | // We should support online backup for the schema in any form. This |
| | | // implementation does not support incremental backups, but in this case |
| | | // even if we're asked to do an incremental we'll just do a full backup |
| | |
| | | public void createBackup(ConfigEntry configEntry, BackupConfig backupConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Get the properties to use for the backup. We don't care whether or not |
| | | // it's incremental, so there's no need to get that. |
| | | String backupID = backupConfig.getBackupID(); |
| | |
| | | String backupID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | int msgID = MSGID_SCHEMA_BACKUP_AND_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public boolean supportsRestore() |
| | | { |
| | | |
| | | |
| | | // We will provide a restore, but only for offline operations. |
| | | return true; |
| | | } |
| | |
| | | RestoreConfig restoreConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // First, make sure that the requested backup exists. |
| | | BackupDirectory backupDirectory = restoreConfig.getBackupDirectory(); |
| | | String backupPath = backupDirectory.getPath(); |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | String description = getMessage(MSGID_SCHEMA_DESCRIPTION_ENTRY_DN); |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | boolean configIsAcceptable = true; |
| | | |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | */ |
| | | boolean showAllAttributes() |
| | | { |
| | | |
| | | return showAllAttributes; |
| | | } |
| | | |
| | |
| | | */ |
| | | void setShowAllAttributes(boolean showAllAttributes) |
| | | { |
| | | |
| | | this.showAllAttributes = showAllAttributes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN getComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getClassName() |
| | | { |
| | | |
| | | return CLASS_NAME; |
| | | } |
| | | |
| | |
| | | */ |
| | | public LinkedHashMap<String,String> getAlerts() |
| | | { |
| | | |
| | | LinkedHashMap<String,String> alerts = new LinkedHashMap<String,String>(); |
| | | |
| | | alerts.put(ALERT_TYPE_CANNOT_COPY_SCHEMA_FILES, |
| | |
| | | */ |
| | | private void readerBegin() |
| | | { |
| | | |
| | | threadTotalCount.getAndIncrement(); |
| | | } |
| | | |
| | |
| | | */ |
| | | private void readerEnd() |
| | | { |
| | | |
| | | threadTotalCount.getAndDecrement(); |
| | | } |
| | | |
| | |
| | | */ |
| | | private void writerBegin() |
| | | { |
| | | |
| | | threadTotalCount.getAndIncrement(); |
| | | threadWriteCount.getAndIncrement(); |
| | | } |
| | |
| | | */ |
| | | private void writerEnd() |
| | | { |
| | | |
| | | threadWriteCount.getAndDecrement(); |
| | | threadTotalCount.getAndDecrement(); |
| | | } |
| | |
| | | */ |
| | | private void waitUntilQuiescent() |
| | | { |
| | | |
| | | while (threadTotalCount.get() > 0) |
| | | { |
| | | // Still have threads in the database so sleep a little |
| | |
| | | */ |
| | | public static String getContainerName(DN dn) |
| | | { |
| | | |
| | | String normStr = dn.toNormalizedString(); |
| | | StringBuilder builder = new StringBuilder(normStr.length()); |
| | | for (int i = 0; i < normStr.length(); i++) |
| | |
| | | public void initializeBackend(ConfigEntry configEntry, DN[] baseDNs) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | configDN = configEntry.getDN(); |
| | | |
| | | // Initialize a config object |
| | |
| | | */ |
| | | public void finalizeBackend() |
| | | { |
| | | |
| | | // Deregister our configurable components. |
| | | // TODO: configurableEnv is always null and will not be deregistered. |
| | | if (configurableEnv != null) |
| | |
| | | */ |
| | | public boolean isLocal() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsLDIFExport() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsLDIFImport() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsBackup() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | public boolean supportsBackup(BackupConfig backupConfig, |
| | | StringBuilder unsupportedReason) |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsRestore() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | */ |
| | | public HashSet<String> getSupportedFeatures() |
| | | { |
| | | |
| | | return new HashSet<String>(); //NYI |
| | | } |
| | | |
| | |
| | | */ |
| | | public HashSet<String> getSupportedControls() |
| | | { |
| | | |
| | | return supportedControls; |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN[] getBaseDNs() |
| | | { |
| | | |
| | | return config.getBaseDNs(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getEntryCount() |
| | | { |
| | | |
| | | if (rootContainer != null) |
| | | { |
| | | try |
| | |
| | | */ |
| | | public Entry getEntry(DN entryDN) throws DirectoryException |
| | | { |
| | | |
| | | readerBegin(); |
| | | try |
| | | { |
| | |
| | | public void addEntry(Entry entry, AddOperation addOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | writerBegin(); |
| | | try |
| | | { |
| | |
| | | public void deleteEntry(DN entryDN, DeleteOperation deleteOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | writerBegin(); |
| | | try |
| | | { |
| | |
| | | public void replaceEntry(Entry entry, ModifyOperation modifyOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | writerBegin(); |
| | | try |
| | | { |
| | |
| | | ModifyDNOperation modifyDNOperation) |
| | | throws DirectoryException, CancelledOperationException |
| | | { |
| | | |
| | | writerBegin(); |
| | | try |
| | | { |
| | |
| | | public void search(SearchOperation searchOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | readerBegin(); |
| | | try |
| | | { |
| | |
| | | LDIFExportConfig exportConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | // Initialize a config object. |
| | | config = new Config(); |
| | | |
| | |
| | | LDIFImportConfig importConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | // Initialize a config object. |
| | | config = new Config(); |
| | | |
| | |
| | | DN[] baseDNs, Entry statEntry) |
| | | throws InitializationException, ConfigException, DirectoryException |
| | | { |
| | | |
| | | // Initialize a config object. |
| | | config = new Config(); |
| | | config.initializeConfig(configEntry, baseDNs); |
| | |
| | | public void createBackup(ConfigEntry configEntry, BackupConfig backupConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | BackupManager backupManager = |
| | | new BackupManager(getBackendID()); |
| | | backupManager.createBackup(configEntry, backupConfig); |
| | |
| | | public void removeBackup(BackupDirectory backupDirectory, String backupID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | BackupManager backupManager = |
| | | new BackupManager(getBackendID()); |
| | | backupManager.removeBackup(backupDirectory, backupID); |
| | |
| | | RestoreConfig restoreConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | BackupManager backupManager = |
| | | new BackupManager(getBackendID()); |
| | | backupManager.restoreBackup(configEntry, restoreConfig); |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | return configAttrs; |
| | | } |
| | | |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | DN[] baseDNs = null; |
| | | boolean acceptable = true; |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | ConfigChangeResult ccr; |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public void createBackup(ConfigEntry configEntry, BackupConfig backupConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Parse our backend configuration. |
| | | Config config = new Config(); |
| | | try |
| | |
| | | Set<String> includeFiles) |
| | | throws DirectoryException,IOException |
| | | { |
| | | |
| | | |
| | | BackupDirectory backupDir = restoreConfig.getBackupDirectory(); |
| | | boolean verifyOnly = restoreConfig.verifyOnly(); |
| | | |
| | |
| | | */ |
| | | public void listDatabases(List<Database> dbList) |
| | | { |
| | | |
| | | // There may be more than one handle open for a given database |
| | | // so we eliminate duplicates here. |
| | | HashSet<String> set = new HashSet<String>(); |
| | |
| | | */ |
| | | public String getContainerName() |
| | | { |
| | | |
| | | String normStr = baseDN.toNormalizedString(); |
| | | StringBuilder builder = new StringBuilder(normStr.length()); |
| | | for (int i = 0; i < normStr.length(); i++) |
| | |
| | | */ |
| | | public int getMessageID() |
| | | { |
| | | |
| | | return messageID; |
| | | } |
| | | |
| | |
| | | static public byte[] decodeDatabaseEntry(byte[] bytes) |
| | | throws ASN1Exception,DataFormatException |
| | | { |
| | | |
| | | // FIXME: This array copy could be very costly on performance. We need to |
| | | // FIXME: find a faster way to implement this versioning feature. |
| | | // Remove version number from the encoded bytes |
| | |
| | | static public Entry entryFromDatabase(byte[] bytes) |
| | | throws DirectoryException,ASN1Exception,LDAPException,DataFormatException |
| | | { |
| | | |
| | | byte[] uncompressedBytes = decodeDatabaseEntry(bytes); |
| | | return decodeDirectoryServerEntry(uncompressedBytes); |
| | | } |
| | |
| | | static private Entry decodeDirectoryServerEntry(byte[] bytes) |
| | | throws DirectoryException,ASN1Exception,LDAPException |
| | | { |
| | | |
| | | HashMap<ObjectClass, String> objectClasses; |
| | | HashMap<AttributeType, List<Attribute>> userAttributes = |
| | | new HashMap<AttributeType, List<Attribute>>(); |
| | |
| | | */ |
| | | static public byte[] encodeDatabaseEntry(byte[] bytes, DataConfig dataConfig) |
| | | { |
| | | |
| | | int uncompressedSize = 0; |
| | | |
| | | // Do optional compression. |
| | |
| | | */ |
| | | static public byte[] entryToDatabase(Entry entry, DataConfig dataConfig) |
| | | { |
| | | |
| | | byte[] uncompressedBytes = encodeDirectoryServerEntry(entry); |
| | | return encodeDatabaseEntry(uncompressedBytes, dataConfig); |
| | | } |
| | |
| | | */ |
| | | static public byte[] entryToDatabase(Entry entry) |
| | | { |
| | | |
| | | return entryToDatabase(entry, new DataConfig()); |
| | | } |
| | | |
| | |
| | | */ |
| | | static private byte[] encodeDirectoryServerEntry(Entry entry) |
| | | { |
| | | |
| | | // Encode the DN (LDAPDN). |
| | | ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(4); |
| | | elements.add(new ASN1OctetString(entry.getDN().toString())); |
| | |
| | | boolean isLocking, |
| | | boolean runCheckPointer) throws DatabaseException |
| | | { |
| | | |
| | | EnvironmentConfig envConfig; |
| | | if(config.getEnvironmentConfig() != null) |
| | | { |
| | |
| | | */ |
| | | public void preload() |
| | | { |
| | | |
| | | long timeLimit = config.getPreloadTimeLimit(); |
| | | |
| | | if (timeLimit > 0) |
| | |
| | | private void cleanDatabase() |
| | | throws DatabaseException |
| | | { |
| | | |
| | | int msgID; |
| | | String message; |
| | | |
| | |
| | | public void verifyBackend(RootContainer rootContainer, Entry statEntry) throws |
| | | DatabaseException, JebException |
| | | { |
| | | |
| | | this.rootContainer = rootContainer; |
| | | EntryContainer entryContainer = |
| | | rootContainer.getEntryContainer(verifyConfig.getBaseDN()); |
| | |
| | | */ |
| | | class ProgressTask extends TimerTask |
| | | { |
| | | |
| | | /** |
| | | * The number of records that had been processed at the time of the |
| | | * previous progress report. |
| | |
| | | public RecurringTask(TaskScheduler taskScheduler, Entry recurringTaskEntry) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | this.taskScheduler = taskScheduler; |
| | | this.recurringTaskEntry = recurringTaskEntry; |
| | | this.recurringTaskEntryDN = recurringTaskEntry.getDN(); |
| | |
| | | */ |
| | | public String getRecurringTaskID() |
| | | { |
| | | |
| | | return recurringTaskID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN getRecurringTaskEntryDN() |
| | | { |
| | | |
| | | return recurringTaskEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public Entry getRecurringTaskEntry() |
| | | { |
| | | |
| | | return recurringTaskEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getTaskClassName() |
| | | { |
| | | |
| | | return taskClassName; |
| | | } |
| | | |
| | |
| | | */ |
| | | public Task scheduleNextIteration() |
| | | { |
| | | |
| | | // NYI |
| | | return null; |
| | | } |
| | |
| | | Entry taskEntry) |
| | | throws InitializationException |
| | | { |
| | | |
| | | this.taskScheduler = taskScheduler; |
| | | this.taskEntry = taskEntry; |
| | | this.taskEntryDN = taskEntry.getDN(); |
| | |
| | | private String getAttributeValue(String attributeName, boolean isRequired) |
| | | throws InitializationException |
| | | { |
| | | |
| | | List<Attribute> attrList = |
| | | taskEntry.getAttribute(attributeName.toLowerCase()); |
| | | if ((attrList == null) || attrList.isEmpty()) |
| | |
| | | private LinkedList<String> getAttributeValues(String attributeName) |
| | | throws InitializationException |
| | | { |
| | | |
| | | LinkedList<String> valueStrings = new LinkedList<String>(); |
| | | |
| | | List<Attribute> attrList = |
| | |
| | | */ |
| | | public final DN getTaskEntryDN() |
| | | { |
| | | |
| | | return taskEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Entry getTaskEntry() |
| | | { |
| | | |
| | | return taskEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Operation getOperation() |
| | | { |
| | | |
| | | return operation; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setOperation(Operation operation) |
| | | { |
| | | |
| | | this.operation = operation; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final String getTaskID() |
| | | { |
| | | |
| | | return taskID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final String getRecurringTaskID() |
| | | { |
| | | |
| | | return recurringTaskID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final TaskState getTaskState() |
| | | { |
| | | |
| | | return taskState; |
| | | } |
| | | |
| | |
| | | */ |
| | | void setTaskState(TaskState taskState) |
| | | { |
| | | |
| | | Lock lock = taskScheduler.writeLockEntry(taskEntryDN); |
| | | |
| | | try |
| | |
| | | */ |
| | | public final long getScheduledStartTime() |
| | | { |
| | | |
| | | return scheduledStartTime; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final long getActualStartTime() |
| | | { |
| | | |
| | | return actualStartTime; |
| | | } |
| | | |
| | |
| | | */ |
| | | private void setActualStartTime(long actualStartTime) |
| | | { |
| | | |
| | | Lock lock = taskScheduler.writeLockEntry(taskEntryDN); |
| | | |
| | | try |
| | |
| | | */ |
| | | public final long getCompletionTime() |
| | | { |
| | | |
| | | return completionTime; |
| | | } |
| | | |
| | |
| | | */ |
| | | private void setCompletionTime(long completionTime) |
| | | { |
| | | |
| | | Lock lock = taskScheduler.writeLockEntry(taskEntryDN); |
| | | |
| | | try |
| | |
| | | */ |
| | | public final LinkedList<String> getDependencyIDs() |
| | | { |
| | | |
| | | return dependencyIDs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final FailedDependencyAction getFailedDependencyAction() |
| | | { |
| | | |
| | | return failedDependencyAction; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final LinkedList<String> getNotifyOnCompletionAddresses() |
| | | { |
| | | |
| | | return notifyOnCompletion; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final LinkedList<String> getNotifyOnErrorAddresses() |
| | | { |
| | | |
| | | return notifyOnError; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final LinkedList<String> getLogMessages() |
| | | { |
| | | |
| | | return logMessages; |
| | | } |
| | | |
| | |
| | | void addLogMessage(ErrorLogSeverity severity, int messageID, |
| | | String messageString) |
| | | { |
| | | |
| | | Lock lock = taskScheduler.writeLockEntry(taskEntryDN); |
| | | |
| | | try |
| | |
| | | */ |
| | | public final int compareTo(Task task) |
| | | { |
| | | |
| | | if (completionTime > 0) |
| | | { |
| | | if (task.completionTime > 0) |
| | |
| | | */ |
| | | public final TaskState execute() |
| | | { |
| | | |
| | | setActualStartTime(TimeThread.getTime()); |
| | | setTaskState(TaskState.RUNNING); |
| | | taskScheduler.writeState(); |
| | |
| | | public void initializeTask() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | // No action is performed by default. |
| | | } |
| | | |
| | |
| | | */ |
| | | public void interruptTask(TaskState interruptState, String interruptReason) |
| | | { |
| | | |
| | | // No action is performed by default. |
| | | } |
| | | } |
| | |
| | | public void initializeBackend(ConfigEntry configEntry, DN[] baseDNs) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // Make sure that a configuration entry was provided. If not, then we will |
| | | // not be able to complete the initialization. |
| | | if (configEntry == null) |
| | |
| | | */ |
| | | public void finalizeBackend() |
| | | { |
| | | |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | |
| | | |
| | |
| | | */ |
| | | public DN[] getBaseDNs() |
| | | { |
| | | |
| | | return baseDNs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getEntryCount() |
| | | { |
| | | |
| | | if (taskScheduler != null) |
| | | { |
| | | return taskScheduler.getEntryCount(); |
| | |
| | | */ |
| | | public boolean isLocal() |
| | | { |
| | | |
| | | // For the purposes of this method, this is a local backend. |
| | | return true; |
| | | } |
| | |
| | | public Entry getEntry(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | if (entryDN == null) |
| | | { |
| | | return null; |
| | |
| | | public boolean entryExists(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | if (entryDN == null) |
| | | { |
| | | return false; |
| | |
| | | public void addEntry(Entry entry, AddOperation addOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Get the DN for the entry and then get its parent. |
| | | DN entryDN = entry.getDN(); |
| | | DN parentDN = entryDN.getParentDNInSuffix(); |
| | |
| | | public void deleteEntry(DN entryDN, DeleteOperation deleteOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Get the parent for the provided entry DN. It must be either the |
| | | // scheduled or recurring task parent DN. |
| | | DN parentDN = entryDN.getParentDNInSuffix(); |
| | |
| | | public void replaceEntry(Entry entry, ModifyOperation modifyOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | // FIXME -- We need to support this. |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | "Modify operations are not yet supported in " + |
| | |
| | | ModifyDNOperation modifyDNOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | int msgID = MSGID_TASKBE_MODIFY_DN_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void search(SearchOperation searchOperation) |
| | | throws DirectoryException, CancelledOperationException |
| | | { |
| | | |
| | | |
| | | // Look at the base DN and scope for the search operation to decide which |
| | | // entries we need to look at. |
| | | boolean searchRoot = false; |
| | |
| | | */ |
| | | public HashSet<String> getSupportedControls() |
| | | { |
| | | |
| | | return supportedControls; |
| | | } |
| | | |
| | |
| | | */ |
| | | public HashSet<String> getSupportedFeatures() |
| | | { |
| | | |
| | | return supportedFeatures; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsLDIFExport() |
| | | { |
| | | |
| | | // LDIF exports are supported. |
| | | return true; |
| | | } |
| | |
| | | LDIFExportConfig exportConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // FIXME -- Implement support for exporting to LDIF. |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsLDIFImport() |
| | | { |
| | | |
| | | // This backend does not support LDIF imports. |
| | | return false; |
| | | } |
| | |
| | | LDIFImportConfig importConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not support LDIF imports. |
| | | int msgID = MSGID_TASKBE_IMPORT_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public boolean supportsBackup() |
| | | { |
| | | |
| | | // This backend does provide a backup/restore mechanism. |
| | | return true; |
| | | } |
| | |
| | | public boolean supportsBackup(BackupConfig backupConfig, |
| | | StringBuilder unsupportedReason) |
| | | { |
| | | |
| | | |
| | | // This backend does provide a backup/restore mechanism. |
| | | return true; |
| | | } |
| | |
| | | public void createBackup(ConfigEntry configEntry, BackupConfig backupConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // NYI -- Create the backup. |
| | | } |
| | | |
| | |
| | | String backupID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // NYI -- Remove the backup. |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsRestore() |
| | | { |
| | | |
| | | |
| | | // This backend does provide a backup/restore mechanism. |
| | | return true; |
| | | } |
| | |
| | | RestoreConfig restoreConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // NYI -- Restore the backup. |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | String description = getMessage(MSGID_TASKBE_DESCRIPTION_BACKING_FILE); |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | boolean configIsAcceptable = true; |
| | | |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | */ |
| | | public DN getConfigEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getTaskBackingFile() |
| | | { |
| | | |
| | | File f = getFileForPath(taskBackingFile); |
| | | return f.getPath(); |
| | | } |
| | |
| | | */ |
| | | public long getRetentionTime() |
| | | { |
| | | |
| | | return retentionTime; |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN getTaskRootDN() |
| | | { |
| | | |
| | | return taskRootDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN getRecurringTasksParentDN() |
| | | { |
| | | |
| | | return recurringTaskParentDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN getScheduledTasksParentDN() |
| | | { |
| | | |
| | | return scheduledTaskParentDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public Task getScheduledTask(DN taskEntryDN) |
| | | { |
| | | |
| | | return taskScheduler.getScheduledTask(taskEntryDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public RecurringTask getRecurringTask(DN taskEntryDN) |
| | | { |
| | | |
| | | return taskScheduler.getRecurringTask(taskEntryDN); |
| | | } |
| | | } |
| | |
| | | boolean scheduleIteration) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | schedulerLock.lock(); |
| | | |
| | | try |
| | |
| | | public RecurringTask removeRecurringTask(String recurringTaskID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | schedulerLock.lock(); |
| | | |
| | | try |
| | |
| | | public void scheduleTask(Task task, boolean writeState) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | schedulerLock.lock(); |
| | | |
| | | |
| | |
| | | */ |
| | | public Task cancelTask(String taskID) |
| | | { |
| | | |
| | | schedulerLock.lock(); |
| | | |
| | | try |
| | |
| | | public Task removePendingTask(String taskID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | schedulerLock.lock(); |
| | | |
| | | try |
| | |
| | | public Task removeCompletedTask(String taskID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | schedulerLock.lock(); |
| | | |
| | | try |
| | |
| | | */ |
| | | public boolean threadDone(TaskThread taskThread, Task completedTask) |
| | | { |
| | | |
| | | schedulerLock.lock(); |
| | | |
| | | try |
| | |
| | | */ |
| | | public void addCompletedTask(Task completedTask) |
| | | { |
| | | |
| | | // The scheduler lock is reentrant, so even if we already hold it, we can |
| | | // acquire it again. |
| | | schedulerLock.lock(); |
| | |
| | | */ |
| | | public void stopScheduler() |
| | | { |
| | | |
| | | stopRequested = true; |
| | | |
| | | try |
| | |
| | | public void interruptRunningTasks(TaskState interruptState, |
| | | String interruptReason, boolean waitForStop) |
| | | { |
| | | |
| | | |
| | | // Grab a copy of the running threads so that we can operate on them without |
| | | // holding the lock. |
| | | LinkedList<TaskThread> threadList = new LinkedList<TaskThread>(); |
| | |
| | | */ |
| | | public void run() |
| | | { |
| | | |
| | | isRunning = true; |
| | | schedulerThread = currentThread(); |
| | | |
| | |
| | | */ |
| | | private TaskState shouldStart(Task task) |
| | | { |
| | | |
| | | if (! isRunning) |
| | | { |
| | | return TaskState.UNSCHEDULED; |
| | |
| | | private void initializeTasksFromBackingFile() |
| | | throws InitializationException |
| | | { |
| | | |
| | | String backingFilePath = taskBackend.getTaskBackingFile(); |
| | | |
| | | try |
| | |
| | | private void createNewTaskBackingFile() |
| | | throws InitializationException |
| | | { |
| | | |
| | | String backingFile = taskBackend.getTaskBackingFile(); |
| | | LDIFExportConfig exportConfig = |
| | | new LDIFExportConfig(backingFile, ExistingFileBehavior.OVERWRITE); |
| | |
| | | */ |
| | | public void writeState() |
| | | { |
| | | |
| | | |
| | | String backingFilePath = taskBackend.getTaskBackingFile(); |
| | | String tmpFilePath = backingFilePath + ".tmp"; |
| | | LDIFExportConfig exportConfig = |
| | |
| | | */ |
| | | public long getEntryCount() |
| | | { |
| | | |
| | | schedulerLock.lock(); |
| | | |
| | | try |
| | |
| | | */ |
| | | public Entry getTaskRootEntry() |
| | | { |
| | | |
| | | return taskRootEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public Entry getScheduledTaskParentEntry() |
| | | { |
| | | |
| | | return scheduledTaskParentEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public Entry getRecurringTaskParentEntry() |
| | | { |
| | | |
| | | return recurringTaskParentEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public Task getScheduledTask(String taskID) |
| | | { |
| | | |
| | | schedulerLock.lock(); |
| | | |
| | | try |
| | |
| | | */ |
| | | public Task getScheduledTask(DN taskEntryDN) |
| | | { |
| | | |
| | | schedulerLock.lock(); |
| | | |
| | | try |
| | |
| | | */ |
| | | Lock writeLockEntry(DN entryDN) |
| | | { |
| | | |
| | | Lock lock = LockManager.lockWrite(entryDN); |
| | | while (lock == null) |
| | | { |
| | |
| | | Lock readLockEntry(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | Lock lock = LockManager.lockRead(entryDN); |
| | | for (int i=0; ((lock == null) && (i < 4)); i++) |
| | | { |
| | |
| | | */ |
| | | void unlockEntry(DN entryDN, Lock lock) |
| | | { |
| | | |
| | | LockManager.unlock(entryDN, lock); |
| | | } |
| | | |
| | |
| | | */ |
| | | public Entry getScheduledTaskEntry(DN scheduledTaskEntryDN) |
| | | { |
| | | |
| | | |
| | | schedulerLock.lock(); |
| | | |
| | | try |
| | |
| | | public boolean searchScheduledTasks(SearchOperation searchOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | SearchFilter filter = searchOperation.getFilter(); |
| | | |
| | | schedulerLock.lock(); |
| | |
| | | */ |
| | | public RecurringTask getRecurringTask(String recurringTaskID) |
| | | { |
| | | |
| | | schedulerLock.lock(); |
| | | |
| | | try |
| | |
| | | */ |
| | | public RecurringTask getRecurringTask(DN recurringTaskEntryDN) |
| | | { |
| | | |
| | | schedulerLock.lock(); |
| | | |
| | | try |
| | |
| | | */ |
| | | public Entry getRecurringTaskEntry(DN recurringTaskEntryDN) |
| | | { |
| | | |
| | | |
| | | schedulerLock.lock(); |
| | | |
| | | try |
| | |
| | | public boolean searchRecurringTasks(SearchOperation searchOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | SearchFilter filter = searchOperation.getFilter(); |
| | | |
| | | schedulerLock.lock(); |
| | |
| | | public Task entryToScheduledTask(Entry entry, Operation operation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Get the name of the class that implements the task logic. |
| | | AttributeType attrType = |
| | | DirectoryServer.getAttributeType(ATTR_TASK_CLASS.toLowerCase()); |
| | |
| | | public RecurringTask entryToRecurringTask(Entry entry) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return new RecurringTask(this, entry); |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN getComponentEntryDN() |
| | | { |
| | | |
| | | return taskBackend.getConfigEntryDN(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getClassName() |
| | | { |
| | | |
| | | return CLASS_NAME; |
| | | } |
| | | |
| | |
| | | */ |
| | | public LinkedHashMap<String,String> getAlerts() |
| | | { |
| | | |
| | | LinkedHashMap<String,String> alerts = new LinkedHashMap<String,String>(); |
| | | |
| | | alerts.put(ALERT_TYPE_CANNOT_FIND_RECURRING_TASK, |
| | |
| | | */ |
| | | public static boolean isPending(TaskState taskState) |
| | | { |
| | | |
| | | |
| | | switch (taskState) |
| | | { |
| | | case UNSCHEDULED: |
| | |
| | | */ |
| | | public static boolean isRunning(TaskState taskState) |
| | | { |
| | | |
| | | |
| | | switch (taskState) |
| | | { |
| | | case RUNNING: |
| | |
| | | */ |
| | | public static boolean isDone(TaskState taskState) |
| | | { |
| | | |
| | | |
| | | switch (taskState) |
| | | { |
| | | case UNSCHEDULED: |
| | |
| | | */ |
| | | public static boolean isSuccessful(TaskState taskState) |
| | | { |
| | | |
| | | |
| | | switch (taskState) |
| | | { |
| | | case WAITING_ON_START_TIME: |
| | |
| | | */ |
| | | public Task getTask() |
| | | { |
| | | |
| | | return task; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setTask(Task task) |
| | | { |
| | | |
| | | this.task = task; |
| | | |
| | | synchronized (notifyLock) |
| | |
| | | public void interruptTask(TaskState interruptState, String interruptReason, |
| | | boolean exitThread) |
| | | { |
| | | |
| | | if (task != null) |
| | | { |
| | | try |
| | |
| | | */ |
| | | public void run() |
| | | { |
| | | |
| | | while (! exitRequested) |
| | | { |
| | | if (task == null) |
| | |
| | | */ |
| | | public String getDataType() |
| | | { |
| | | |
| | | return "Boolean"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public AttributeSyntax getSyntax() |
| | | { |
| | | |
| | | return DirectoryServer.getDefaultBooleanSyntax(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean activeValue() |
| | | { |
| | | |
| | | return activeValue; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean pendingValue() |
| | | { |
| | | |
| | | if (hasPendingValues()) |
| | | { |
| | | return pendingValue; |
| | |
| | | */ |
| | | public void setValue(boolean booleanValue) |
| | | { |
| | | |
| | | if (requiresAdminAction()) |
| | | { |
| | | pendingValue = booleanValue; |
| | |
| | | */ |
| | | private static LinkedHashSet<AttributeValue> getValueSet(boolean booleanValue) |
| | | { |
| | | |
| | | LinkedHashSet<AttributeValue> valueSet = |
| | | new LinkedHashSet<AttributeValue>(1); |
| | | if (booleanValue) |
| | |
| | | */ |
| | | public void applyPendingValues() |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return; |
| | |
| | | public boolean valueIsAcceptable(AttributeValue value, |
| | | StringBuilder rejectReason) |
| | | { |
| | | |
| | | String stringValue = value.getStringValue(); |
| | | if (stringValue.equalsIgnoreCase(CONFIG_VALUE_TRUE) || |
| | | stringValue.equalsIgnoreCase(CONFIG_VALUE_FALSE)) |
| | |
| | | boolean allowFailures) |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((valueStrings == null) || valueStrings.isEmpty()) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_IS_REQUIRED; |
| | |
| | | */ |
| | | public List<String> activeValuesToStrings() |
| | | { |
| | | |
| | | ArrayList<String> valueStrings = new ArrayList<String>(1); |
| | | valueStrings.add(String.valueOf(activeValue)); |
| | | |
| | |
| | | */ |
| | | public List<String> pendingValuesToStrings() |
| | | { |
| | | |
| | | if (hasPendingValues()) |
| | | { |
| | | ArrayList<String> valueStrings = new ArrayList<String>(1); |
| | |
| | | public ConfigAttribute getConfigAttribute(List<Attribute> attributeList) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | boolean activeValue = false; |
| | | boolean pendingValue = false; |
| | | boolean activeValueSet = false; |
| | |
| | | */ |
| | | public javax.management.Attribute toJMXAttribute() |
| | | { |
| | | |
| | | return new javax.management.Attribute(getName(), activeValue); |
| | | } |
| | | |
| | |
| | | */ |
| | | public void toJMXAttribute(AttributeList attributeList) |
| | | { |
| | | |
| | | attributeList.add(new javax.management.Attribute(getName(), activeValue)); |
| | | |
| | | if (requiresAdminAction() && (pendingValue != activeValue)) |
| | |
| | | */ |
| | | public void toJMXAttributeInfo(List<MBeanAttributeInfo> attributeInfoList) |
| | | { |
| | | |
| | | attributeInfoList.add(new MBeanAttributeInfo(getName(), |
| | | Boolean.class.getName(), |
| | | getDescription(), true, true, |
| | |
| | | */ |
| | | public MBeanParameterInfo toJMXParameterInfo() |
| | | { |
| | | |
| | | return new MBeanParameterInfo(getName(), Boolean.TYPE.getName(), |
| | | getDescription()); |
| | | } |
| | |
| | | public void setValue(javax.management.Attribute jmxAttribute) |
| | | throws ConfigException |
| | | { |
| | | |
| | | Object value = jmxAttribute.getValue(); |
| | | if (value instanceof Boolean) |
| | | { |
| | |
| | | */ |
| | | public ConfigAttribute duplicate() |
| | | { |
| | | |
| | | return new BooleanConfigAttribute(getName(), getDescription(), |
| | | requiresAdminAction(), activeValue, |
| | | pendingValue); |
| | |
| | | protected ConfigAttribute(String name, String description, boolean isRequired, |
| | | boolean isMultiValued, boolean requiresAdminAction) |
| | | { |
| | | |
| | | |
| | | this.name = name; |
| | | this.description = description; |
| | | this.isRequired = isRequired; |
| | |
| | | boolean isMultiValued, boolean requiresAdminAction, |
| | | LinkedHashSet<AttributeValue> activeValues) |
| | | { |
| | | |
| | | |
| | | this.name = name; |
| | | this.description = description; |
| | | this.isRequired = isRequired; |
| | |
| | | boolean hasPendingValues, |
| | | LinkedHashSet<AttributeValue> pendingValues) |
| | | { |
| | | |
| | | |
| | | this.name = name; |
| | | this.description = description; |
| | | this.isRequired = isRequired; |
| | |
| | | */ |
| | | public String getName() |
| | | { |
| | | |
| | | return name; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getDescription() |
| | | { |
| | | |
| | | return description; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isRequired() |
| | | { |
| | | |
| | | return isRequired; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isMultiValued() |
| | | { |
| | | |
| | | return isMultiValued; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean requiresAdminAction() |
| | | { |
| | | |
| | | return requiresAdminAction; |
| | | } |
| | | |
| | |
| | | */ |
| | | public LinkedHashSet<AttributeValue> getActiveValues() |
| | | { |
| | | |
| | | return activeValues; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean hasPendingValues() |
| | | { |
| | | |
| | | return hasPendingValues; |
| | | } |
| | | |
| | |
| | | */ |
| | | public LinkedHashSet<AttributeValue> getPendingValues() |
| | | { |
| | | |
| | | if (requiresAdminAction) |
| | | { |
| | | return pendingValues; |
| | |
| | | protected void setValues(LinkedHashSet<AttributeValue> values) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // If no values are provided, then check to see if this is a required |
| | | // attribute. If it is, then reject the change. |
| | | if ((values == null) || values.isEmpty()) |
| | |
| | | */ |
| | | protected void setActiveValues(LinkedHashSet<AttributeValue> values) |
| | | { |
| | | |
| | | activeValues = values; |
| | | } |
| | | |
| | |
| | | */ |
| | | protected void setPendingValues(LinkedHashSet<AttributeValue> values) |
| | | { |
| | | |
| | | pendingValues = values; |
| | | hasPendingValues = true; |
| | | } |
| | |
| | | protected void addValues(List<AttributeValue> values) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // If there are no values provided, then do nothing. |
| | | if (values == null) |
| | | { |
| | |
| | | protected void removeValues(List<AttributeValue> values) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // Create a temporary set of values that we will use for this change. It |
| | | // may not actually be applied if an error occurs for some reason. |
| | | LinkedHashSet<AttributeValue> tempValues; |
| | |
| | | protected void removeAllValues() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if (isRequired) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_IS_REQUIRED; |
| | |
| | | */ |
| | | public void setInitialValues(LinkedHashSet<AttributeValue> values) |
| | | { |
| | | |
| | | if (values == null) |
| | | { |
| | | values = new LinkedHashSet<AttributeValue>(); |
| | |
| | | */ |
| | | public void applyPendingValues() |
| | | { |
| | | |
| | | if (hasPendingValues) |
| | | { |
| | | activeValues = pendingValues; |
| | |
| | | */ |
| | | public ConfigEntry(Entry entry, ConfigEntry parent) |
| | | { |
| | | |
| | | this.entry = entry; |
| | | this.parent = parent; |
| | | |
| | |
| | | */ |
| | | public Entry getEntry() |
| | | { |
| | | |
| | | return entry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setEntry(Entry entry) |
| | | { |
| | | |
| | | entryLock.lock(); |
| | | |
| | | try |
| | |
| | | */ |
| | | public DN getDN() |
| | | { |
| | | |
| | | return entry.getDN(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean hasObjectClass(String name) |
| | | { |
| | | |
| | | ObjectClass oc = DirectoryServer.getObjectClass(name.toLowerCase()); |
| | | if (oc == null) |
| | | { |
| | |
| | | public ConfigAttribute getConfigAttribute(ConfigAttribute stub) |
| | | throws ConfigException |
| | | { |
| | | |
| | | String attrName = stub.getName(); |
| | | AttributeType attrType = |
| | | DirectoryServer.getAttributeType(attrName.toLowerCase()); |
| | |
| | | */ |
| | | public void putConfigAttribute(ConfigAttribute attribute) |
| | | { |
| | | |
| | | String name = attribute.getName(); |
| | | AttributeType attrType = |
| | | DirectoryServer.getAttributeType(name.toLowerCase()); |
| | |
| | | */ |
| | | public boolean removeConfigAttribute(String lowerName) |
| | | { |
| | | |
| | | for (AttributeType t : entry.getUserAttributes().keySet()) |
| | | { |
| | | if (t.hasNameOrOID(lowerName)) |
| | |
| | | */ |
| | | public ConfigEntry getParent() |
| | | { |
| | | |
| | | return parent; |
| | | } |
| | | |
| | |
| | | */ |
| | | public ConcurrentHashMap<DN,ConfigEntry> getChildren() |
| | | { |
| | | |
| | | return children; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean hasChildren() |
| | | { |
| | | |
| | | return (! children.isEmpty()); |
| | | } |
| | | |
| | |
| | | public void addChild(ConfigEntry childEntry) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | ConfigEntry conflictingChild; |
| | | |
| | | entryLock.lock(); |
| | |
| | | public ConfigEntry removeChild(DN childDN) |
| | | throws ConfigException |
| | | { |
| | | |
| | | entryLock.lock(); |
| | | |
| | | try |
| | |
| | | */ |
| | | public ConfigEntry duplicate() |
| | | { |
| | | |
| | | return new ConfigEntry(entry.duplicate(), parent); |
| | | } |
| | | |
| | |
| | | */ |
| | | public CopyOnWriteArrayList<ConfigChangeListener> getChangeListeners() |
| | | { |
| | | |
| | | return changeListeners; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void registerChangeListener(ConfigChangeListener listener) |
| | | { |
| | | |
| | | changeListeners.add(listener); |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean deregisterChangeListener(ConfigChangeListener listener) |
| | | { |
| | | |
| | | return changeListeners.remove(listener); |
| | | } |
| | | |
| | |
| | | */ |
| | | public CopyOnWriteArrayList<ConfigAddListener> getAddListeners() |
| | | { |
| | | |
| | | return addListeners; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void registerAddListener(ConfigAddListener listener) |
| | | { |
| | | |
| | | addListeners.addIfAbsent(listener); |
| | | } |
| | | |
| | |
| | | */ |
| | | public void deregisterAddListener(ConfigAddListener listener) |
| | | { |
| | | |
| | | addListeners.remove(listener); |
| | | } |
| | | |
| | |
| | | */ |
| | | public CopyOnWriteArrayList<ConfigDeleteListener> getDeleteListeners() |
| | | { |
| | | |
| | | return deleteListeners; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void registerDeleteListener(ConfigDeleteListener listener) |
| | | { |
| | | |
| | | deleteListeners.addIfAbsent(listener); |
| | | } |
| | | |
| | |
| | | */ |
| | | public void deregisterDeleteListener(ConfigDeleteListener listener) |
| | | { |
| | | |
| | | deleteListeners.remove(listener); |
| | | } |
| | | } |
| | |
| | | */ |
| | | public int getMessageID() |
| | | { |
| | | |
| | | return messageID; |
| | | } |
| | | } |
| | |
| | | */ |
| | | public String getDataType() |
| | | { |
| | | |
| | | return "DN"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public AttributeSyntax getSyntax() |
| | | { |
| | | |
| | | return DirectoryServer.getDefaultStringSyntax(); |
| | | } |
| | | |
| | |
| | | public DN activeValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((activeValues == null) || activeValues.isEmpty()) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_NO_STRING_VALUE; |
| | |
| | | */ |
| | | public List<DN> activeValues() |
| | | { |
| | | |
| | | return activeValues; |
| | | } |
| | | |
| | |
| | | public DN pendingValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return activeValue(); |
| | |
| | | */ |
| | | public List<DN> pendingValues() |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return activeValues; |
| | |
| | | public void setValue(DN value) |
| | | throws ConfigException |
| | | { |
| | | |
| | | if (value == null) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_DN_NULL; |
| | |
| | | public void setValues(List<DN> values) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // First check if the set is empty and if that is allowed. |
| | | if ((values == null) || (values.isEmpty())) |
| | | { |
| | |
| | | */ |
| | | private static LinkedHashSet<AttributeValue> getValueSet(DN value) |
| | | { |
| | | |
| | | LinkedHashSet<AttributeValue> valueSet; |
| | | if (value == null) |
| | | { |
| | |
| | | */ |
| | | private static LinkedHashSet<AttributeValue> getValueSet(List<DN> values) |
| | | { |
| | | |
| | | if (values == null) |
| | | { |
| | | return null; |
| | |
| | | */ |
| | | public void applyPendingValues() |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return; |
| | |
| | | public boolean valueIsAcceptable(AttributeValue value, |
| | | StringBuilder rejectReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the value is not null. |
| | | if (value == null) |
| | | { |
| | |
| | | boolean allowFailures) |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((valueStrings == null) || valueStrings.isEmpty()) |
| | | { |
| | | if (isRequired()) |
| | |
| | | */ |
| | | public List<String> activeValuesToStrings() |
| | | { |
| | | |
| | | ArrayList<String> valueStrings = new ArrayList<String>(activeValues.size()); |
| | | for (DN dn : activeValues) |
| | | { |
| | |
| | | */ |
| | | public List<String> pendingValuesToStrings() |
| | | { |
| | | |
| | | if (hasPendingValues()) |
| | | { |
| | | ArrayList<String> valueStrings = |
| | |
| | | public ConfigAttribute getConfigAttribute(List<Attribute> attributeList) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | ArrayList<DN> activeValues = null; |
| | | ArrayList<DN> pendingValues = null; |
| | | |
| | |
| | | */ |
| | | private javax.management.Attribute _toJMXAttribute(boolean pending) |
| | | { |
| | | |
| | | List<DN> requestedValues ; |
| | | String name ; |
| | | if (pending) |
| | |
| | | */ |
| | | public void toJMXAttribute(AttributeList attributeList) |
| | | { |
| | | |
| | | if (activeValues.size() > 0) |
| | | { |
| | | if (isMultiValued()) |
| | |
| | | */ |
| | | public void toJMXAttributeInfo(List<MBeanAttributeInfo> attributeInfoList) |
| | | { |
| | | |
| | | |
| | | if (isMultiValued()) |
| | | { |
| | | attributeInfoList.add(new MBeanAttributeInfo(getName(), |
| | |
| | | */ |
| | | public MBeanParameterInfo toJMXParameterInfo() |
| | | { |
| | | |
| | | if (isMultiValued()) |
| | | { |
| | | return new MBeanParameterInfo(getName(), JMX_TYPE_STRING_ARRAY, |
| | |
| | | public void setValue(javax.management.Attribute jmxAttribute) |
| | | throws ConfigException |
| | | { |
| | | |
| | | Object value = jmxAttribute.getValue(); |
| | | if (value == null) |
| | | { |
| | |
| | | */ |
| | | public ConfigAttribute duplicate() |
| | | { |
| | | |
| | | return new DNConfigAttribute(getName(), getDescription(), isRequired(), |
| | | isMultiValued(), requiresAdminAction(), |
| | | activeValues, pendingValues); |
| | |
| | | */ |
| | | public String getDataType() |
| | | { |
| | | |
| | | return "Integer"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public AttributeSyntax getSyntax() |
| | | { |
| | | |
| | | return DirectoryServer.getDefaultIntegerSyntax(); |
| | | } |
| | | |
| | |
| | | public long activeValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((activeValues == null) || activeValues.isEmpty()) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_NO_INT_VALUE; |
| | |
| | | public int activeIntValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((activeValues == null) || activeValues.isEmpty()) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_NO_INT_VALUE; |
| | |
| | | */ |
| | | public List<Long> activeValues() |
| | | { |
| | | |
| | | return activeValues; |
| | | } |
| | | |
| | |
| | | public long pendingValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return activeValue(); |
| | |
| | | public int pendingIntValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return activeIntValue(); |
| | |
| | | */ |
| | | public List<Long> pendingValues() |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return activeValues; |
| | |
| | | */ |
| | | public boolean hasLowerBound() |
| | | { |
| | | |
| | | return hasLowerBound; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getLowerBound() |
| | | { |
| | | |
| | | return lowerBound; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean hasUpperBound() |
| | | { |
| | | |
| | | return hasUpperBound; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getUpperBound() |
| | | { |
| | | |
| | | return upperBound; |
| | | } |
| | | |
| | |
| | | public void setValue(long value) |
| | | throws ConfigException |
| | | { |
| | | |
| | | if (hasLowerBound && (value < lowerBound)) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_INT_BELOW_LOWER_BOUND; |
| | |
| | | public void setValues(List<Long> values) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // First check if the set is empty and if that is allowed. |
| | | if ((values == null) || (values.isEmpty())) |
| | | { |
| | |
| | | */ |
| | | private static LinkedHashSet<AttributeValue> getValueSet(long value) |
| | | { |
| | | |
| | | LinkedHashSet<AttributeValue> valueSet = |
| | | new LinkedHashSet<AttributeValue>(1); |
| | | |
| | |
| | | */ |
| | | private static LinkedHashSet<AttributeValue> getValueSet(List<Long> values) |
| | | { |
| | | |
| | | if (values == null) |
| | | { |
| | | return null; |
| | |
| | | */ |
| | | public void applyPendingValues() |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return; |
| | |
| | | public boolean valueIsAcceptable(AttributeValue value, |
| | | StringBuilder rejectReason) |
| | | { |
| | | |
| | | |
| | | // First, make sure we can represent it as a long. |
| | | String stringValue = value.getStringValue(); |
| | | long longValue; |
| | |
| | | boolean allowFailures) |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((valueStrings == null) || valueStrings.isEmpty()) |
| | | { |
| | | if (isRequired()) |
| | |
| | | */ |
| | | public List<String> activeValuesToStrings() |
| | | { |
| | | |
| | | ArrayList<String> valueStrings = |
| | | new ArrayList<String>(activeValues.size()); |
| | | for (long l : activeValues) |
| | |
| | | */ |
| | | public List<String> pendingValuesToStrings() |
| | | { |
| | | |
| | | if (hasPendingValues()) |
| | | { |
| | | ArrayList<String> valueStrings = |
| | |
| | | public ConfigAttribute getConfigAttribute(List<Attribute> attributeList) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | ArrayList<Long> activeValues = null; |
| | | ArrayList<Long> pendingValues = null; |
| | | |
| | |
| | | */ |
| | | public javax.management.Attribute toJMXAttributePending() |
| | | { |
| | | |
| | | return _toJMXAttribute(true); |
| | | } |
| | | |
| | |
| | | */ |
| | | public void toJMXAttribute(AttributeList attributeList) |
| | | { |
| | | |
| | | if (activeValues.size() > 0) |
| | | { |
| | | if (isMultiValued()) |
| | |
| | | */ |
| | | public void toJMXAttributeInfo(List<MBeanAttributeInfo> attributeInfoList) |
| | | { |
| | | |
| | | |
| | | if (isMultiValued()) |
| | | { |
| | | attributeInfoList.add(new MBeanAttributeInfo(getName(), |
| | |
| | | */ |
| | | public MBeanParameterInfo toJMXParameterInfo() |
| | | { |
| | | |
| | | if (isMultiValued()) |
| | | { |
| | | return new MBeanParameterInfo(getName(), JMX_TYPE_LONG_ARRAY, |
| | |
| | | public void setValue(javax.management.Attribute jmxAttribute) |
| | | throws ConfigException |
| | | { |
| | | |
| | | Object value = jmxAttribute.getValue(); |
| | | if (value instanceof Long) |
| | | { |
| | |
| | | */ |
| | | public ConfigAttribute duplicate() |
| | | { |
| | | |
| | | return new IntegerConfigAttribute(getName(), getDescription(), isRequired(), |
| | | isMultiValued(), requiresAdminAction(), |
| | | hasLowerBound, lowerBound, hasUpperBound, |
| | |
| | | */ |
| | | public String getDataType() |
| | | { |
| | | |
| | | return "IntegerWithUnit"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public AttributeSyntax getSyntax() |
| | | { |
| | | |
| | | return DirectoryServer.getDefaultStringSyntax(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public long activeIntValue() |
| | | { |
| | | |
| | | return activeIntValue; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String activeUnit() |
| | | { |
| | | |
| | | return activeUnit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long activeCalculatedValue() |
| | | { |
| | | |
| | | return activeCalculatedValue; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long pendingIntValue() |
| | | { |
| | | |
| | | if (hasPendingValues()) |
| | | { |
| | | return pendingIntValue; |
| | |
| | | */ |
| | | public String pendingUnit() |
| | | { |
| | | |
| | | if (hasPendingValues()) |
| | | { |
| | | return pendingUnit; |
| | |
| | | */ |
| | | public long pendingCalculatedValue() |
| | | { |
| | | |
| | | if (hasPendingValues()) |
| | | { |
| | | return pendingCalculatedValue; |
| | |
| | | */ |
| | | public HashMap<String,Double> getUnits() |
| | | { |
| | | |
| | | return units; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean hasLowerBound() |
| | | { |
| | | |
| | | return hasLowerBound; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getLowerBound() |
| | | { |
| | | |
| | | return lowerBound; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean hasUpperBound() |
| | | { |
| | | |
| | | return hasUpperBound; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getUpperBound() |
| | | { |
| | | |
| | | return upperBound; |
| | | } |
| | | |
| | |
| | | public void setValue(long intValue, String unit) |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((unit == null) || (! units.containsKey(unit))) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_INVALID_UNIT; |
| | |
| | | public void setValue(String value) |
| | | throws ConfigException |
| | | { |
| | | |
| | | int spacePos = value.indexOf(' '); |
| | | if (spacePos <= 0) |
| | | { |
| | |
| | | private static LinkedHashSet<AttributeValue> getValueSet(long intValue, |
| | | String unit) |
| | | { |
| | | |
| | | if (unit == null) |
| | | { |
| | | return null; |
| | |
| | | */ |
| | | public void applyPendingValues() |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return; |
| | |
| | | public boolean valueIsAcceptable(AttributeValue value, |
| | | StringBuilder rejectReason) |
| | | { |
| | | |
| | | |
| | | // Get a string representation of the value and convert it to lowercase. |
| | | String lowerValue = value.getStringValue().toLowerCase(); |
| | | |
| | |
| | | public boolean valueIsAcceptable(String lowerValue, |
| | | StringBuilder rejectReason) |
| | | { |
| | | |
| | | |
| | | // Find the first space in the value, since it should separate the integer |
| | | // from the unit. |
| | | int spacePos = lowerValue.indexOf(' '); |
| | |
| | | stringsToValues(List<String> valueStrings, boolean allowFailures) |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((valueStrings == null) || valueStrings.isEmpty()) |
| | | { |
| | | if (isRequired()) |
| | |
| | | */ |
| | | public List<String> activeValuesToStrings() |
| | | { |
| | | |
| | | ArrayList<String> valueStrings = new ArrayList<String>(1); |
| | | valueStrings.add(activeIntValue + " " + activeUnit); |
| | | |
| | |
| | | */ |
| | | public List<String> pendingValuesToStrings() |
| | | { |
| | | |
| | | if (hasPendingValues()) |
| | | { |
| | | ArrayList<String> valueStrings = new ArrayList<String>(1); |
| | |
| | | public ConfigAttribute getConfigAttribute(List<Attribute> attributeList) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | long activeIntValue = 0; |
| | | long pendingIntValue = 0; |
| | | String activeUnit = null; |
| | |
| | | */ |
| | | public javax.management.Attribute toJMXAttribute() |
| | | { |
| | | |
| | | return new javax.management.Attribute(getName(), |
| | | activeIntValue + " " + activeUnit); |
| | | } |
| | |
| | | */ |
| | | public void toJMXAttribute(AttributeList attributeList) |
| | | { |
| | | |
| | | String activeValue = activeIntValue + " " + activeUnit; |
| | | attributeList.add(new javax.management.Attribute(getName(), activeValue)); |
| | | |
| | |
| | | */ |
| | | public void toJMXAttributeInfo(List<MBeanAttributeInfo> attributeInfoList) |
| | | { |
| | | |
| | | attributeInfoList.add(new MBeanAttributeInfo(getName(), |
| | | String.class.getName(), |
| | | getDescription(), true, true, |
| | |
| | | */ |
| | | public MBeanParameterInfo toJMXParameterInfo() |
| | | { |
| | | |
| | | return new MBeanParameterInfo(getName(), String.class.getName(), |
| | | getDescription()); |
| | | } |
| | |
| | | public void setValue(javax.management.Attribute jmxAttribute) |
| | | throws ConfigException |
| | | { |
| | | |
| | | Object value = jmxAttribute.getValue(); |
| | | if (value instanceof String) |
| | | { |
| | |
| | | */ |
| | | public ConfigAttribute duplicate() |
| | | { |
| | | |
| | | return new IntegerWithUnitConfigAttribute(getName(), getDescription(), |
| | | requiresAdminAction(), units, |
| | | hasLowerBound, lowerBound, |
| | |
| | | */ |
| | | public ObjectName getObjectName() |
| | | { |
| | | |
| | | return objectName; |
| | | } |
| | | |
| | |
| | | */ |
| | | public CopyOnWriteArrayList<AlertGenerator> getAlertGenerators() |
| | | { |
| | | |
| | | return alertGenerators; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void addAlertGenerator(AlertGenerator generator) |
| | | { |
| | | |
| | | synchronized (alertGenerators) |
| | | { |
| | | if (! alertGenerators.contains(generator)) |
| | |
| | | */ |
| | | public boolean removeAlertGenerator(AlertGenerator generator) |
| | | { |
| | | |
| | | synchronized (alertGenerators) |
| | | { |
| | | return alertGenerators.remove(generator); |
| | |
| | | */ |
| | | public CopyOnWriteArrayList<ConfigurableComponent> getConfigurableComponents() |
| | | { |
| | | |
| | | return configurableComponents; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void addConfigurableComponent(ConfigurableComponent component) |
| | | { |
| | | |
| | | synchronized (configurableComponents) |
| | | { |
| | | if (! configurableComponents.contains(component)) |
| | |
| | | */ |
| | | public boolean removeConfigurableComponent(ConfigurableComponent component) |
| | | { |
| | | |
| | | synchronized (configurableComponents) |
| | | { |
| | | return configurableComponents.remove(component); |
| | |
| | | */ |
| | | public CopyOnWriteArrayList<InvokableComponent> getInvokableComponents() |
| | | { |
| | | |
| | | return invokableComponents; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void addInvokableComponent(InvokableComponent component) |
| | | { |
| | | |
| | | synchronized (invokableComponents) |
| | | { |
| | | if (! invokableComponents.contains(component)) |
| | |
| | | */ |
| | | public boolean removeInvokableComponent(InvokableComponent component) |
| | | { |
| | | |
| | | synchronized (invokableComponents) |
| | | { |
| | | return invokableComponents.remove(component); |
| | |
| | | */ |
| | | public CopyOnWriteArrayList<MonitorProvider> getMonitorProviders() |
| | | { |
| | | |
| | | return monitorProviders; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void addMonitorProvider(MonitorProvider component) |
| | | { |
| | | |
| | | synchronized (monitorProviders) |
| | | { |
| | | if (! monitorProviders.contains(component)) |
| | |
| | | */ |
| | | public boolean removeMonitorProvider(MonitorProvider component) |
| | | { |
| | | |
| | | synchronized (monitorProviders) |
| | | { |
| | | return monitorProviders.remove(component); |
| | |
| | | */ |
| | | private ConfigAttribute getConfigAttribute(String name) |
| | | { |
| | | |
| | | for (ConfigurableComponent component : configurableComponents) |
| | | { |
| | | for (ConfigAttribute attr : component.getConfigurationAttributes()) |
| | |
| | | */ |
| | | private Attribute getJmxAttribute(String name) |
| | | { |
| | | |
| | | String attributeName ; |
| | | String pendingString = ";" + OPTION_PENDING_VALUES ; |
| | | boolean pending = false ; |
| | |
| | | public Attribute getAttribute(String attributeName) |
| | | throws AttributeNotFoundException |
| | | { |
| | | |
| | | // |
| | | // Get the jmx Client connection |
| | | JmxClientConnection jmxClientConnection = getClientConnection(); |
| | |
| | | javax.management.Attribute attribute, ConfigEntry configEntry) |
| | | throws AttributeNotFoundException, InvalidAttributeValueException |
| | | { |
| | | |
| | | String name = attribute.getName() ; |
| | | // |
| | | // Get a duplicated version of the config attribute |
| | |
| | | public void setAttribute(javax.management.Attribute attribute) |
| | | throws AttributeNotFoundException, InvalidAttributeValueException |
| | | { |
| | | |
| | | ConfigEntry configEntry; |
| | | ConfigEntry newConfigEntry ; |
| | | |
| | |
| | | */ |
| | | public AttributeList setAttributes(AttributeList attributes) |
| | | { |
| | | |
| | | AttributeList setAttrs = new AttributeList(); |
| | | |
| | | // |
| | |
| | | public Object invoke(String actionName, Object[] params, String[] signature) |
| | | throws MBeanException |
| | | { |
| | | |
| | | for (InvokableComponent component : invokableComponents) |
| | | { |
| | | for (InvokableMethod method : component.getOperationSignatures()) |
| | |
| | | */ |
| | | public String getDataType() |
| | | { |
| | | |
| | | return "MultiChoice"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public AttributeSyntax getSyntax() |
| | | { |
| | | |
| | | return DirectoryServer.getDefaultStringSyntax(); |
| | | } |
| | | |
| | |
| | | public String activeValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((activeValues == null) || activeValues.isEmpty()) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_NO_STRING_VALUE; |
| | |
| | | */ |
| | | public List<String> activeValues() |
| | | { |
| | | |
| | | return activeValues; |
| | | } |
| | | |
| | |
| | | public String pendingValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return activeValue(); |
| | |
| | | */ |
| | | public List<String> pendingValues() |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return activeValues; |
| | |
| | | */ |
| | | public Set<String> allowedValues() |
| | | { |
| | | |
| | | return allowedValues; |
| | | } |
| | | |
| | |
| | | public void setValue(String value) |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((value == null) || (value.length() == 0)) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_EMPTY_STRING_VALUE; |
| | |
| | | public void setValues(List<String> values) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // First check if the set is empty and if that is allowed. |
| | | if ((values == null) || (values.isEmpty())) |
| | | { |
| | |
| | | */ |
| | | private static LinkedHashSet<AttributeValue> getValueSet(String value) |
| | | { |
| | | |
| | | LinkedHashSet<AttributeValue> valueSet = |
| | | new LinkedHashSet<AttributeValue>(1); |
| | | |
| | |
| | | */ |
| | | private static LinkedHashSet<AttributeValue> getValueSet(List<String> values) |
| | | { |
| | | |
| | | if (values == null) |
| | | { |
| | | return null; |
| | |
| | | */ |
| | | public void applyPendingValues() |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return; |
| | |
| | | public boolean valueIsAcceptable(AttributeValue value, |
| | | StringBuilder rejectReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the value is non-empty. |
| | | String stringValue; |
| | | if ((value == null) || |
| | |
| | | boolean allowFailures) |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((valueStrings == null) || valueStrings.isEmpty()) |
| | | { |
| | | if (isRequired()) |
| | |
| | | */ |
| | | public List<String> activeValuesToStrings() |
| | | { |
| | | |
| | | return activeValues; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<String> pendingValuesToStrings() |
| | | { |
| | | |
| | | if (hasPendingValues()) |
| | | { |
| | | return pendingValues; |
| | |
| | | public ConfigAttribute getConfigAttribute(List<Attribute> attributeList) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | ArrayList<String> activeValues = null; |
| | | ArrayList<String> pendingValues = null; |
| | | |
| | |
| | | */ |
| | | private javax.management.Attribute _toJMXAttribute(boolean pending) |
| | | { |
| | | |
| | | List<String> requestedValues ; |
| | | String name ; |
| | | if (pending) |
| | |
| | | */ |
| | | public javax.management.Attribute toJMXAttributePending() |
| | | { |
| | | |
| | | return _toJMXAttribute(true) ; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void toJMXAttribute(AttributeList attributeList) |
| | | { |
| | | |
| | | if (activeValues.size() > 0) |
| | | { |
| | | if (isMultiValued()) |
| | |
| | | */ |
| | | public void toJMXAttributeInfo(List<MBeanAttributeInfo> attributeInfoList) |
| | | { |
| | | |
| | | |
| | | if (isMultiValued()) |
| | | { |
| | | attributeInfoList.add(new MBeanAttributeInfo(getName(), |
| | |
| | | */ |
| | | public MBeanParameterInfo toJMXParameterInfo() |
| | | { |
| | | |
| | | if (isMultiValued()) |
| | | { |
| | | return new MBeanParameterInfo(getName(), JMX_TYPE_STRING_ARRAY, |
| | |
| | | public void setValue(javax.management.Attribute jmxAttribute) |
| | | throws ConfigException |
| | | { |
| | | |
| | | Object value = jmxAttribute.getValue(); |
| | | if (value instanceof String) |
| | | { |
| | |
| | | */ |
| | | public ConfigAttribute duplicate() |
| | | { |
| | | |
| | | return new MultiChoiceConfigAttribute(getName(), getDescription(), |
| | | isRequired(), isMultiValued(), |
| | | requiresAdminAction(), allowedValues, |
| | |
| | | */ |
| | | public String getDataType() |
| | | { |
| | | |
| | | return "ReadOnly"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public AttributeSyntax getSyntax() |
| | | { |
| | | |
| | | return DirectoryServer.getDefaultStringSyntax(); |
| | | } |
| | | |
| | |
| | | public String activeValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((values == null) || values.isEmpty()) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_NO_STRING_VALUE; |
| | |
| | | */ |
| | | public List<String> activeValues() |
| | | { |
| | | |
| | | return values; |
| | | } |
| | | |
| | |
| | | public String pendingValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | return activeValue(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<String> pendingValues() |
| | | { |
| | | |
| | | return activeValues(); |
| | | } |
| | | |
| | |
| | | public void setValue(String value) |
| | | throws ConfigException |
| | | { |
| | | |
| | | int msgID = MSGID_CONFIG_ATTR_READ_ONLY; |
| | | String message = getMessage(msgID, getName()); |
| | | throw new ConfigException(msgID, message); |
| | |
| | | public void setValues(List<String> values) |
| | | throws ConfigException |
| | | { |
| | | |
| | | int msgID = MSGID_CONFIG_ATTR_READ_ONLY; |
| | | String message = getMessage(msgID, getName()); |
| | | throw new ConfigException(msgID, message); |
| | |
| | | */ |
| | | private static LinkedHashSet<AttributeValue> getValueSet(String value) |
| | | { |
| | | |
| | | LinkedHashSet<AttributeValue> valueSet = |
| | | new LinkedHashSet<AttributeValue>(1); |
| | | |
| | |
| | | */ |
| | | private static LinkedHashSet<AttributeValue> getValueSet(List<String> values) |
| | | { |
| | | |
| | | if (values == null) |
| | | { |
| | | return null; |
| | |
| | | public boolean valueIsAcceptable(AttributeValue value, |
| | | StringBuilder rejectReason) |
| | | { |
| | | |
| | | rejectReason.append(getMessage(MSGID_CONFIG_ATTR_READ_ONLY, getName())); |
| | | return false; |
| | | } |
| | |
| | | boolean allowFailures) |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((valueStrings == null) || valueStrings.isEmpty()) |
| | | { |
| | | return new LinkedHashSet<AttributeValue>(); |
| | |
| | | */ |
| | | public List<String> activeValuesToStrings() |
| | | { |
| | | |
| | | return values; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<String> pendingValuesToStrings() |
| | | { |
| | | |
| | | return activeValuesToStrings(); |
| | | } |
| | | |
| | |
| | | public ConfigAttribute getConfigAttribute(List<Attribute> attributeList) |
| | | throws ConfigException |
| | | { |
| | | |
| | | // The attribute won't be present in the entry, so we'll just return a |
| | | // reference to this attribute. |
| | | return duplicate(); |
| | |
| | | */ |
| | | public javax.management.Attribute toJMXAttribute() |
| | | { |
| | | |
| | | if (isMultiValued()) |
| | | { |
| | | String[] valueArray = new String[values.size()]; |
| | |
| | | */ |
| | | public void toJMXAttribute(AttributeList attributeList) |
| | | { |
| | | |
| | | javax.management.Attribute jmxAttr = toJMXAttribute(); |
| | | attributeList.add(jmxAttr); |
| | | } |
| | |
| | | */ |
| | | public void toJMXAttributeInfo(List<MBeanAttributeInfo> attributeInfoList) |
| | | { |
| | | |
| | | |
| | | if (isMultiValued()) |
| | | { |
| | | attributeInfoList.add(new MBeanAttributeInfo(getName(), |
| | |
| | | */ |
| | | public MBeanParameterInfo toJMXParameterInfo() |
| | | { |
| | | |
| | | if (isMultiValued()) |
| | | { |
| | | return new MBeanParameterInfo(getName(), JMX_TYPE_STRING_ARRAY, |
| | |
| | | public void setValue(javax.management.Attribute jmxAttribute) |
| | | throws ConfigException |
| | | { |
| | | |
| | | int msgID = MSGID_CONFIG_ATTR_READ_ONLY; |
| | | String message = getMessage(msgID, getName()); |
| | | throw new ConfigException(msgID, message); |
| | |
| | | */ |
| | | public ConfigAttribute duplicate() |
| | | { |
| | | |
| | | return new ReadOnlyConfigAttribute(getName(), getDescription(), |
| | | activeValues()); |
| | | } |
| | |
| | | */ |
| | | public String getDataType() |
| | | { |
| | | |
| | | return "String"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public AttributeSyntax getSyntax() |
| | | { |
| | | |
| | | return DirectoryServer.getDefaultStringSyntax(); |
| | | } |
| | | |
| | |
| | | public String activeValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((activeValues == null) || activeValues.isEmpty()) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_NO_STRING_VALUE; |
| | |
| | | */ |
| | | public List<String> activeValues() |
| | | { |
| | | |
| | | return activeValues; |
| | | } |
| | | |
| | |
| | | public String pendingValue() |
| | | throws ConfigException |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return activeValue(); |
| | |
| | | */ |
| | | public List<String> pendingValues() |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return activeValues; |
| | |
| | | public void setValue(String value) |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((value == null) || (value.length() == 0)) |
| | | { |
| | | int msgID = MSGID_CONFIG_ATTR_EMPTY_STRING_VALUE; |
| | |
| | | public void setValues(List<String> values) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // First check if the set is empty and if that is allowed. |
| | | if ((values == null) || (values.isEmpty())) |
| | | { |
| | |
| | | */ |
| | | private static LinkedHashSet<AttributeValue> getValueSet(String value) |
| | | { |
| | | |
| | | LinkedHashSet<AttributeValue> valueSet = |
| | | new LinkedHashSet<AttributeValue>(1); |
| | | |
| | |
| | | */ |
| | | private static LinkedHashSet<AttributeValue> getValueSet(List<String> values) |
| | | { |
| | | |
| | | if (values == null) |
| | | { |
| | | return null; |
| | |
| | | */ |
| | | public void applyPendingValues() |
| | | { |
| | | |
| | | if (! hasPendingValues()) |
| | | { |
| | | return; |
| | |
| | | public boolean valueIsAcceptable(AttributeValue value, |
| | | StringBuilder rejectReason) |
| | | { |
| | | |
| | | |
| | | // The only requirement is that the value is not null or empty. |
| | | if ((value == null) || (value.getStringValue().length() == 0)) |
| | | { |
| | |
| | | boolean allowFailures) |
| | | throws ConfigException |
| | | { |
| | | |
| | | if ((valueStrings == null) || valueStrings.isEmpty()) |
| | | { |
| | | if (isRequired()) |
| | |
| | | */ |
| | | public List<String> activeValuesToStrings() |
| | | { |
| | | |
| | | return activeValues; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<String> pendingValuesToStrings() |
| | | { |
| | | |
| | | if (hasPendingValues()) |
| | | { |
| | | return pendingValues; |
| | |
| | | public ConfigAttribute getConfigAttribute(List<Attribute> attributeList) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | ArrayList<String> activeValues = null; |
| | | ArrayList<String> pendingValues = null; |
| | | |
| | |
| | | */ |
| | | public void toJMXAttribute(AttributeList attributeList) |
| | | { |
| | | |
| | | if (activeValues.size() > 0) |
| | | { |
| | | if (isMultiValued()) |
| | |
| | | */ |
| | | public void toJMXAttributeInfo(List<MBeanAttributeInfo> attributeInfoList) |
| | | { |
| | | |
| | | |
| | | if (isMultiValued()) |
| | | { |
| | | attributeInfoList.add(new MBeanAttributeInfo(getName(), |
| | |
| | | */ |
| | | public MBeanParameterInfo toJMXParameterInfo() |
| | | { |
| | | |
| | | if (isMultiValued()) |
| | | { |
| | | return new MBeanParameterInfo(getName(), JMX_TYPE_STRING_ARRAY, |
| | |
| | | public void setValue(javax.management.Attribute jmxAttribute) |
| | | throws ConfigException |
| | | { |
| | | |
| | | Object value = jmxAttribute.getValue(); |
| | | if (value instanceof String) |
| | | { |
| | |
| | | */ |
| | | public ConfigAttribute duplicate() |
| | | { |
| | | |
| | | return new StringConfigAttribute(getName(), getDescription(), isRequired(), |
| | | isMultiValued(), requiresAdminAction(), |
| | | activeValues, pendingValues); |
| | |
| | | public static AccountUsableRequestControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | if (control.hasValue()) |
| | | { |
| | | int msgID = MSGID_ACCTUSABLEREQ_CONTROL_HAS_VALUE; |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("AccountUsableRequestControl()"); |
| | | } |
| | | } |
| | |
| | | */ |
| | | private static ASN1OctetString encodeValue(int secondsBeforeExpiration) |
| | | { |
| | | |
| | | |
| | | ASN1Integer sbeInteger = new ASN1Integer(TYPE_SECONDS_BEFORE_EXPIRATION, |
| | | secondsBeforeExpiration); |
| | | |
| | |
| | | boolean isLocked, |
| | | int secondsBeforeUnlock) |
| | | { |
| | | |
| | | |
| | | ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(5); |
| | | |
| | | if (isInactive) |
| | |
| | | public static AccountUsableResponseControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | |
| | | ASN1OctetString controlValue = control.getValue(); |
| | | if (controlValue == null) |
| | | { |
| | |
| | | */ |
| | | public boolean isUsable() |
| | | { |
| | | |
| | | return isUsable; |
| | | } |
| | | |
| | |
| | | */ |
| | | public int getSecondsBeforeExpiration() |
| | | { |
| | | |
| | | return secondsBeforeExpiration; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isInactive() |
| | | { |
| | | |
| | | return isInactive; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isReset() |
| | | { |
| | | |
| | | return isReset; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isExpired() |
| | | { |
| | | |
| | | return isExpired; |
| | | } |
| | | |
| | |
| | | */ |
| | | public int getRemainingGraceLogins() |
| | | { |
| | | |
| | | return remainingGraceLogins; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isLocked() |
| | | { |
| | | |
| | | return isLocked; |
| | | } |
| | | |
| | |
| | | */ |
| | | public int getSecondsBeforeUnlock() |
| | | { |
| | | |
| | | return secondsBeforeUnlock; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("AccountUsableResponseControl(isUsable="); |
| | | buffer.append(isUsable); |
| | | |
| | |
| | | */ |
| | | private static ASN1OctetString encodeValue(String authorizationID) |
| | | { |
| | | |
| | | |
| | | return new ASN1OctetString(authorizationID); |
| | | } |
| | | |
| | |
| | | */ |
| | | private static ASN1OctetString encodeValue(DN authorizationDN) |
| | | { |
| | | |
| | | |
| | | if (authorizationDN == null) |
| | | { |
| | | return new ASN1OctetString("dn:"); |
| | |
| | | Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | |
| | | if (! control.hasValue()) |
| | | { |
| | | int msgID = MSGID_AUTHZIDRESP_NO_CONTROL_VALUE; |
| | |
| | | */ |
| | | public String getAuthorizationID() |
| | | { |
| | | |
| | | return authorizationID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setAuthorizationID(String authorizationID) |
| | | { |
| | | |
| | | this.authorizationID = authorizationID; |
| | | setValue(encodeValue(authorizationID)); |
| | | } |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("AuthorizationIdentityResponseControl(authzID=\""); |
| | | buffer.append(authorizationID); |
| | | buffer.append("\")"); |
| | |
| | | changeType, |
| | | DN previousDN, long changeNumber) |
| | | { |
| | | |
| | | |
| | | ArrayList<ASN1Element> elements = |
| | | new ArrayList<ASN1Element>(3); |
| | | elements.add(new ASN1Enumerated(changeType.intValue())); |
| | |
| | | public static EntryChangeNotificationControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | |
| | | if (! control.hasValue()) |
| | | { |
| | | int msgID = MSGID_ECN_NO_CONTROL_VALUE; |
| | |
| | | */ |
| | | public PersistentSearchChangeType getChangeType() |
| | | { |
| | | |
| | | return changeType; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setChangeType(PersistentSearchChangeType changeType) |
| | | { |
| | | |
| | | this.changeType = changeType; |
| | | |
| | | setValue(encodeValue(changeType, previousDN, changeNumber)); |
| | |
| | | */ |
| | | public DN getPreviousDN() |
| | | { |
| | | |
| | | return previousDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setPreviousDN(DN previousDN) |
| | | { |
| | | |
| | | this.previousDN = previousDN; |
| | | |
| | | setValue(encodeValue(changeType, previousDN, changeNumber)); |
| | |
| | | */ |
| | | public long getChangeNumber() |
| | | { |
| | | |
| | | return changeNumber; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setChangeNumber(long changeNumber) |
| | | { |
| | | |
| | | this.changeNumber = changeNumber; |
| | | |
| | | setValue(encodeValue(changeType, previousDN, changeNumber)); |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("EntryChangeNotificationControl(changeType="); |
| | | buffer.append(changeType.toString()); |
| | | |
| | |
| | | public static LDAPAssertionRequestControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | if (! control.hasValue()) |
| | | { |
| | | int msgID = MSGID_LDAPASSERT_NO_CONTROL_VALUE; |
| | |
| | | */ |
| | | public LDAPFilter getRawFilter() |
| | | { |
| | | |
| | | return rawFilter; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setRawFilter(LDAPFilter rawFilter) |
| | | { |
| | | |
| | | this.rawFilter = rawFilter; |
| | | this.filter = null; |
| | | |
| | |
| | | public SearchFilter getSearchFilter() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | if (filter == null) |
| | | { |
| | | filter = rawFilter.toSearchFilter(); |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("LDAPAssertionRequestControl(criticality="); |
| | | buffer.append(isCritical()); |
| | | buffer.append(",filter=\""); |
| | |
| | | public static LDAPPostReadRequestControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | if (! control.hasValue()) |
| | | { |
| | | int msgID = MSGID_POSTREADREQ_NO_CONTROL_VALUE; |
| | |
| | | private static ASN1OctetString encodeAttributes(LinkedHashSet<String> |
| | | rawAttributes) |
| | | { |
| | | |
| | | if (rawAttributes == null) |
| | | { |
| | | return new ASN1OctetString(new ASN1Sequence().encode()); |
| | |
| | | */ |
| | | public LinkedHashSet<String> getRawAttributes() |
| | | { |
| | | |
| | | return rawAttributes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setRawAttributes(LinkedHashSet<String> rawAttributes) |
| | | { |
| | | |
| | | if (rawAttributes == null) |
| | | { |
| | | this.rawAttributes = new LinkedHashSet<String>(); |
| | |
| | | */ |
| | | public LinkedHashSet<AttributeType> getRequestedAttributes() |
| | | { |
| | | |
| | | if (requestedAttributes == null) |
| | | { |
| | | returnAllOperationalAttrs = false; |
| | |
| | | */ |
| | | public boolean returnAllUserAttributes() |
| | | { |
| | | |
| | | if (requestedAttributes == null) |
| | | { |
| | | getRequestedAttributes(); |
| | |
| | | */ |
| | | public boolean returnAllOperationalAttributes() |
| | | { |
| | | |
| | | if (requestedAttributes == null) |
| | | { |
| | | getRequestedAttributes(); |
| | |
| | | */ |
| | | public boolean allowsAttribute(AttributeType attrType) |
| | | { |
| | | |
| | | if (requestedAttributes == null) |
| | | { |
| | | getRequestedAttributes(); |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("LDAPPostReadRequestControl(criticality="); |
| | | buffer.append(isCritical()); |
| | | buffer.append(",attrs=\""); |
| | |
| | | public static LDAPPostReadResponseControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | if (! control.hasValue()) |
| | | { |
| | | int msgID = MSGID_POSTREADRESP_NO_CONTROL_VALUE; |
| | |
| | | */ |
| | | private static ASN1OctetString encodeEntry(SearchResultEntry searchEntry) |
| | | { |
| | | |
| | | |
| | | SearchResultEntryProtocolOp protocolOp = |
| | | new SearchResultEntryProtocolOp(searchEntry); |
| | | return new ASN1OctetString(protocolOp.encode().encode()); |
| | |
| | | */ |
| | | public SearchResultEntry getSearchEntry() |
| | | { |
| | | |
| | | return searchEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setSearchEntry(SearchResultEntry searchEntry) |
| | | { |
| | | |
| | | this.searchEntry = searchEntry; |
| | | setValue(encodeEntry(searchEntry)); |
| | | } |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("LDAPPostReadResponseControl(criticality="); |
| | | buffer.append(isCritical()); |
| | | buffer.append(",entry="); |
| | |
| | | public static LDAPPreReadRequestControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | if (! control.hasValue()) |
| | | { |
| | | int msgID = MSGID_PREREADREQ_NO_CONTROL_VALUE; |
| | |
| | | private static ASN1OctetString encodeAttributes(LinkedHashSet<String> |
| | | rawAttributes) |
| | | { |
| | | |
| | | if (rawAttributes == null) |
| | | { |
| | | return new ASN1OctetString(new ASN1Sequence().encode()); |
| | |
| | | */ |
| | | public LinkedHashSet<String> getRawAttributes() |
| | | { |
| | | |
| | | return rawAttributes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setRawAttributes(LinkedHashSet<String> rawAttributes) |
| | | { |
| | | |
| | | if (rawAttributes == null) |
| | | { |
| | | this.rawAttributes = new LinkedHashSet<String>(); |
| | |
| | | */ |
| | | public LinkedHashSet<AttributeType> getRequestedAttributes() |
| | | { |
| | | |
| | | if (requestedAttributes == null) |
| | | { |
| | | returnAllOperationalAttrs = false; |
| | |
| | | */ |
| | | public boolean returnAllUserAttributes() |
| | | { |
| | | |
| | | if (requestedAttributes == null) |
| | | { |
| | | getRequestedAttributes(); |
| | |
| | | */ |
| | | public boolean returnAllOperationalAttributes() |
| | | { |
| | | |
| | | if (requestedAttributes == null) |
| | | { |
| | | getRequestedAttributes(); |
| | |
| | | */ |
| | | public boolean allowsAttribute(AttributeType attrType) |
| | | { |
| | | |
| | | if (requestedAttributes == null) |
| | | { |
| | | getRequestedAttributes(); |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("LDAPPreReadRequestControl(criticality="); |
| | | buffer.append(isCritical()); |
| | | buffer.append(",attrs=\""); |
| | |
| | | public static LDAPPreReadResponseControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | if (! control.hasValue()) |
| | | { |
| | | int msgID = MSGID_PREREADRESP_NO_CONTROL_VALUE; |
| | |
| | | */ |
| | | private static ASN1OctetString encodeEntry(SearchResultEntry searchEntry) |
| | | { |
| | | |
| | | |
| | | SearchResultEntryProtocolOp protocolOp = |
| | | new SearchResultEntryProtocolOp(searchEntry); |
| | | return new ASN1OctetString(protocolOp.encode().encode()); |
| | |
| | | */ |
| | | public SearchResultEntry getSearchEntry() |
| | | { |
| | | |
| | | return searchEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setSearchEntry(SearchResultEntry searchEntry) |
| | | { |
| | | |
| | | this.searchEntry = searchEntry; |
| | | setValue(encodeEntry(searchEntry)); |
| | | } |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("LDAPPreReadResponseControl(criticality="); |
| | | buffer.append(isCritical()); |
| | | buffer.append(",entry="); |
| | |
| | | private static ASN1OctetString |
| | | encodeValue(ArrayList<MatchedValuesFilter> filters) |
| | | { |
| | | |
| | | |
| | | ArrayList<ASN1Element> elements = |
| | | new ArrayList<ASN1Element>(filters.size()); |
| | | for (MatchedValuesFilter f : filters) |
| | |
| | | public static MatchedValuesControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | |
| | | if (! control.hasValue()) |
| | | { |
| | | int msgID = MSGID_MATCHEDVALUES_NO_CONTROL_VALUE; |
| | |
| | | */ |
| | | public ArrayList<MatchedValuesFilter> getFilters() |
| | | { |
| | | |
| | | return filters; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean valueMatches(AttributeType type, AttributeValue value) |
| | | { |
| | | |
| | | for (MatchedValuesFilter f : filters) |
| | | { |
| | | try |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | if (filters.size() == 1) |
| | | { |
| | | buffer.append("MatchedValuesControl(filter=\""); |
| | |
| | | List<ASN1OctetString> subAny, |
| | | ASN1OctetString subFinal, String matchingRuleID) |
| | | { |
| | | |
| | | |
| | | this.matchType = matchType; |
| | | this.rawAttributeType = rawAttributeType; |
| | | this.rawAssertionValue = rawAssertionValue; |
| | |
| | | String rawAttributeType, |
| | | ASN1OctetString rawAssertionValue) |
| | | { |
| | | |
| | | Validator.ensureNotNull(rawAttributeType,rawAssertionValue); |
| | | |
| | | return new MatchedValuesFilter(EQUALITY_MATCH_TYPE, rawAttributeType, |
| | |
| | | AttributeType attributeType, |
| | | AttributeValue assertionValue) |
| | | { |
| | | |
| | | |
| | | Validator.ensureNotNull(attributeType, assertionValue); |
| | | String rawAttributeType = attributeType.getNameOrOID(); |
| | | ASN1OctetString rawAssertionValue = assertionValue.getValue() |
| | |
| | | List<ASN1OctetString> subAny, |
| | | ASN1OctetString subFinal) |
| | | { |
| | | |
| | | |
| | | Validator.ensureNotNull(rawAttributeType); |
| | | return new MatchedValuesFilter(SUBSTRINGS_TYPE, rawAttributeType, null, |
| | | subInitial, subAny, subFinal, null); |
| | |
| | | List<ASN1OctetString> subAny, |
| | | ASN1OctetString subFinal) |
| | | { |
| | | |
| | | |
| | | Validator.ensureNotNull(attributeType); |
| | | String rawAttributeType = attributeType.getNameOrOID(); |
| | | |
| | |
| | | String rawAttributeType, |
| | | ASN1OctetString rawAssertionValue) |
| | | { |
| | | |
| | | Validator.ensureNotNull(rawAttributeType, rawAssertionValue); |
| | | |
| | | return new MatchedValuesFilter(GREATER_OR_EQUAL_TYPE, rawAttributeType, |
| | |
| | | AttributeType attributeType, |
| | | AttributeValue assertionValue) |
| | | { |
| | | |
| | | Validator.ensureNotNull(attributeType, assertionValue); |
| | | |
| | | String rawAttributeType = attributeType.getNameOrOID(); |
| | |
| | | String rawAttributeType, |
| | | ASN1OctetString rawAssertionValue) |
| | | { |
| | | |
| | | |
| | | Validator.ensureNotNull(rawAttributeType, rawAssertionValue); |
| | | return new MatchedValuesFilter(LESS_OR_EQUAL_TYPE, rawAttributeType, |
| | | rawAssertionValue, null, null, null, null); |
| | |
| | | AttributeType attributeType, |
| | | AttributeValue assertionValue) |
| | | { |
| | | |
| | | Validator.ensureNotNull(attributeType, assertionValue); |
| | | |
| | | String rawAttributeType = attributeType.getNameOrOID(); |
| | |
| | | */ |
| | | public static MatchedValuesFilter createPresentFilter(String rawAttributeType) |
| | | { |
| | | |
| | | Validator.ensureNotNull(rawAttributeType) ; |
| | | return new MatchedValuesFilter(PRESENT_TYPE, rawAttributeType, null, null, |
| | | null, null, null); |
| | |
| | | public static MatchedValuesFilter createPresentFilter( |
| | | AttributeType attributeType) |
| | | { |
| | | |
| | | Validator.ensureNotNull(attributeType); |
| | | String rawAttributeType = attributeType.getNameOrOID(); |
| | | |
| | |
| | | String rawAttributeType, |
| | | ASN1OctetString rawAssertionValue) |
| | | { |
| | | |
| | | Validator.ensureNotNull(rawAttributeType,rawAssertionValue); |
| | | |
| | | return new MatchedValuesFilter(APPROXIMATE_MATCH_TYPE, rawAttributeType, |
| | |
| | | AttributeType attributeType, |
| | | AttributeValue assertionValue) |
| | | { |
| | | |
| | | |
| | | Validator.ensureNotNull(attributeType,assertionValue); |
| | | String rawAttributeType = attributeType.getNameOrOID(); |
| | | ASN1OctetString rawAssertionValue = |
| | |
| | | String matchingRuleID, |
| | | ASN1OctetString rawAssertionValue) |
| | | { |
| | | |
| | | Validator |
| | | .ensureNotNull(rawAttributeType, matchingRuleID, rawAssertionValue); |
| | | return new MatchedValuesFilter(EXTENSIBLE_MATCH_TYPE, rawAttributeType, |
| | |
| | | MatchingRule matchingRule, |
| | | AttributeValue assertionValue) |
| | | { |
| | | |
| | | |
| | | Validator.ensureNotNull(attributeType, matchingRule, assertionValue); |
| | | String rawAttributeType = attributeType.getNameOrOID(); |
| | | String matchingRuleID = matchingRule.getOID(); |
| | |
| | | public static MatchedValuesFilter createFromLDAPFilter(LDAPFilter filter) |
| | | throws LDAPException |
| | | { |
| | | |
| | | switch (filter.getFilterType()) |
| | | { |
| | | case AND: |
| | |
| | | */ |
| | | public ASN1Element encode() |
| | | { |
| | | |
| | | |
| | | switch (matchType) |
| | | { |
| | | case EQUALITY_MATCH_TYPE: |
| | |
| | | public static MatchedValuesFilter decode(ASN1Element element) |
| | | throws LDAPException |
| | | { |
| | | |
| | | |
| | | switch (element.getType()) |
| | | { |
| | | case EQUALITY_MATCH_TYPE: |
| | |
| | | */ |
| | | public byte getMatchType() |
| | | { |
| | | |
| | | return matchType; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getRawAttributeType() |
| | | { |
| | | |
| | | return rawAttributeType; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setRawAttributeType(String rawAttributeType) |
| | | { |
| | | |
| | | this.rawAttributeType = rawAttributeType; |
| | | |
| | | decoded = false; |
| | |
| | | */ |
| | | public AttributeType getAttributeType() |
| | | { |
| | | |
| | | if (attributeType == null) |
| | | { |
| | | if (rawAttributeType != null) |
| | |
| | | */ |
| | | public void setAttributeType(AttributeType attributeType) |
| | | { |
| | | |
| | | this.attributeType = attributeType; |
| | | |
| | | if (attributeType == null) |
| | |
| | | */ |
| | | public ASN1OctetString getRawAssertionValue() |
| | | { |
| | | |
| | | return rawAssertionValue; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setRawAssertionValue(ASN1OctetString rawAssertionValue) |
| | | { |
| | | |
| | | this.rawAssertionValue = rawAssertionValue; |
| | | |
| | | decoded = false; |
| | |
| | | */ |
| | | public AttributeValue getAssertionValue() |
| | | { |
| | | |
| | | if (assertionValue == null) |
| | | { |
| | | if (rawAssertionValue != null) |
| | |
| | | */ |
| | | public void setAssertionValue(AttributeValue assertionValue) |
| | | { |
| | | |
| | | this.assertionValue = assertionValue; |
| | | |
| | | if (assertionValue == null) |
| | |
| | | */ |
| | | public ASN1OctetString getSubInitialElement() |
| | | { |
| | | |
| | | return subInitial; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setSubInitialElement(ASN1OctetString subInitial) |
| | | { |
| | | |
| | | this.subInitial = subInitial; |
| | | |
| | | decoded = false; |
| | |
| | | */ |
| | | public ASN1OctetString getNormalizedSubInitialElement() |
| | | { |
| | | |
| | | if (normalizedSubInitial == null) |
| | | { |
| | | if ((subInitial != null) && (getSubstringMatchingRule() != null)) |
| | |
| | | */ |
| | | public List<ASN1OctetString> getSubAnyElements() |
| | | { |
| | | |
| | | return subAny; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setSubAnyElements(List<ASN1OctetString> subAny) |
| | | { |
| | | |
| | | this.subAny = subAny; |
| | | |
| | | decoded = false; |
| | |
| | | */ |
| | | public List<ASN1OctetString> getNormalizedSubAnyElements() |
| | | { |
| | | |
| | | if (normalizedSubAny == null) |
| | | { |
| | | if ((subAny == null) || (subAny.isEmpty())) |
| | |
| | | */ |
| | | public ASN1OctetString getSubFinalElement() |
| | | { |
| | | |
| | | return subFinal; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setSubFinalElement(ASN1OctetString subFinal) |
| | | { |
| | | |
| | | this.subFinal = subFinal; |
| | | |
| | | decoded = false; |
| | |
| | | */ |
| | | public ASN1OctetString getNormalizedSubFinalElement() |
| | | { |
| | | |
| | | if (normalizedSubFinal == null) |
| | | { |
| | | if ((subFinal != null) && (getSubstringMatchingRule() != null)) |
| | |
| | | */ |
| | | public String getMatchingRuleID() |
| | | { |
| | | |
| | | return matchingRuleID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setMatchingRuleID(String matchingRuleID) |
| | | { |
| | | |
| | | this.matchingRuleID = matchingRuleID; |
| | | |
| | | decoded = false; |
| | |
| | | */ |
| | | public MatchingRule getMatchingRule() |
| | | { |
| | | |
| | | if (matchingRule == null) |
| | | { |
| | | if (matchingRuleID != null) |
| | |
| | | */ |
| | | public void setMatchingRule(MatchingRule matchingRule) |
| | | { |
| | | |
| | | this.matchingRule = matchingRule; |
| | | |
| | | if (matchingRule == null) |
| | |
| | | */ |
| | | public ApproximateMatchingRule getApproximateMatchingRule() |
| | | { |
| | | |
| | | if (approximateMatchingRule == null) |
| | | { |
| | | AttributeType attrType = getAttributeType(); |
| | |
| | | */ |
| | | public EqualityMatchingRule getEqualityMatchingRule() |
| | | { |
| | | |
| | | if (equalityMatchingRule == null) |
| | | { |
| | | AttributeType attrType = getAttributeType(); |
| | |
| | | */ |
| | | public OrderingMatchingRule getOrderingMatchingRule() |
| | | { |
| | | |
| | | if (orderingMatchingRule == null) |
| | | { |
| | | AttributeType attrType = getAttributeType(); |
| | |
| | | */ |
| | | public SubstringMatchingRule getSubstringMatchingRule() |
| | | { |
| | | |
| | | if (substringMatchingRule == null) |
| | | { |
| | | AttributeType attrType = getAttributeType(); |
| | |
| | | */ |
| | | public boolean valueMatches(AttributeType type, AttributeValue value) |
| | | { |
| | | |
| | | |
| | | fullyDecode(); |
| | | |
| | | switch (matchType) |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | switch (matchType) |
| | | { |
| | | case EQUALITY_MATCH_TYPE: |
| | |
| | | */ |
| | | public ASN1OctetString encode() |
| | | { |
| | | |
| | | ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(2); |
| | | elements.add(new ASN1Integer(size)); |
| | | elements.add(cookie); |
| | |
| | | public static PasswordExpiredControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | if (control.hasValue()) |
| | | { |
| | | int msgID = MSGID_PWEXPIRED_CONTROL_HAS_VALUE; |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("PasswordExpiredControl()"); |
| | | } |
| | | } |
| | |
| | | public static PasswordExpiringControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | if (! control.hasValue()) |
| | | { |
| | | int msgID = MSGID_PWEXPIRING_NO_CONTROL_VALUE; |
| | |
| | | */ |
| | | public int getSecondsUntilExpiration() |
| | | { |
| | | |
| | | return secondsUntilExpiration; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("PasswordExpiringControl(secondsUntilExpiration="); |
| | | buffer.append(secondsUntilExpiration); |
| | | buffer.append(")"); |
| | |
| | | public static PasswordPolicyRequestControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | if (control.hasValue()) |
| | | { |
| | | int msgID = MSGID_PWPOLICYREQ_CONTROL_HAS_VALUE; |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | |
| | | buffer.append("PasswordPolicyRequestControl()"); |
| | | } |
| | | } |
| | |
| | | int warningValue, |
| | | PasswordPolicyErrorType errorType) |
| | | { |
| | | |
| | | ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(2); |
| | | |
| | | if (warningType != null) |
| | |
| | | public static PasswordPolicyResponseControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | |
| | | ASN1OctetString controlValue = control.getValue(); |
| | | if (controlValue == null) |
| | | { |
| | |
| | | */ |
| | | public PasswordPolicyWarningType getWarningType() |
| | | { |
| | | |
| | | return warningType; |
| | | } |
| | | |
| | |
| | | */ |
| | | public int getWarningValue() |
| | | { |
| | | |
| | | return warningValue; |
| | | } |
| | | |
| | |
| | | */ |
| | | public PasswordPolicyErrorType getErrorType() |
| | | { |
| | | |
| | | return errorType; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("PasswordPolicyResponseControl("); |
| | | |
| | | if (warningType != null) |
| | |
| | | boolean changesOnly, |
| | | boolean returnECs) |
| | | { |
| | | |
| | | |
| | | ArrayList<ASN1Element> elements = |
| | | new ArrayList<ASN1Element>(3); |
| | | elements.add(new ASN1Integer( |
| | |
| | | public static PersistentSearchControl decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | |
| | | if (! control.hasValue()) |
| | | { |
| | | int msgID = MSGID_PSEARCH_NO_CONTROL_VALUE; |
| | |
| | | */ |
| | | public Set<PersistentSearchChangeType> getChangeTypes() |
| | | { |
| | | |
| | | return changeTypes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setChangeTypes(Set<PersistentSearchChangeType> changeTypes) |
| | | { |
| | | |
| | | this.changeTypes = changeTypes; |
| | | |
| | | setValue(encodeValue(changeTypes, changesOnly, returnECs)); |
| | |
| | | */ |
| | | public boolean getChangesOnly() |
| | | { |
| | | |
| | | return changesOnly; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setChangesOnly(boolean changesOnly) |
| | | { |
| | | |
| | | this.changesOnly = changesOnly; |
| | | |
| | | setValue(encodeValue(changeTypes, changesOnly, returnECs)); |
| | |
| | | */ |
| | | public boolean getReturnECs() |
| | | { |
| | | |
| | | return returnECs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setReturnECs(boolean returnECs) |
| | | { |
| | | |
| | | this.returnECs = returnECs; |
| | | |
| | | setValue(encodeValue(changeTypes, changesOnly, returnECs)); |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("PersistentSearchControl(changeTypes=\""); |
| | | PersistentSearchChangeType.changeTypesToString(changeTypes, buffer); |
| | | buffer.append("\",changesOnly="); |
| | |
| | | */ |
| | | private static ASN1OctetString encodeValue(ASN1OctetString rawAuthorizationDN) |
| | | { |
| | | |
| | | ensureNotNull(rawAuthorizationDN); |
| | | |
| | | ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(1); |
| | |
| | | public static ProxiedAuthV1Control decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | ensureNotNull(control); |
| | | |
| | | if (! control.isCritical()) |
| | |
| | | */ |
| | | public ASN1OctetString getRawAuthorizationDN() |
| | | { |
| | | |
| | | return rawAuthorizationDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setRawAuthorizationDN(ASN1OctetString rawAuthorizationDN) |
| | | { |
| | | |
| | | this.rawAuthorizationDN = rawAuthorizationDN; |
| | | |
| | | setValue(encodeValue(rawAuthorizationDN)); |
| | |
| | | public DN getAuthorizationDN() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | if (authorizationDN == null) |
| | | { |
| | | authorizationDN = DN.decode(rawAuthorizationDN); |
| | |
| | | */ |
| | | public void setAuthorizationDN(DN authorizationDN) |
| | | { |
| | | |
| | | ensureNotNull(authorizationDN); |
| | | |
| | | this.authorizationDN = authorizationDN; |
| | |
| | | public Entry getAuthorizationEntry() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | DN authzDN = getAuthorizationDN(); |
| | | if (authzDN.isNullDN()) |
| | | { |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("ProxiedAuthorizationV1Control(authorizationDN=\""); |
| | | rawAuthorizationDN.toString(buffer); |
| | | buffer.append("\")"); |
| | |
| | | public static ProxiedAuthV2Control decodeControl(Control control) |
| | | throws LDAPException |
| | | { |
| | | |
| | | ensureNotNull(control); |
| | | |
| | | if (! control.isCritical()) |
| | |
| | | */ |
| | | public ASN1OctetString getAuthorizationID() |
| | | { |
| | | |
| | | return authorizationID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setAuthorizationID(ASN1OctetString authorizationID) |
| | | { |
| | | |
| | | if (authorizationID == null) |
| | | { |
| | | this.authorizationID = new ASN1OctetString(); |
| | |
| | | public Entry getAuthorizationEntry() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Check for a zero-length value, which would be for an anonymous user. |
| | | if (authorizationID.value().length == 0) |
| | | { |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("ProxiedAuthorizationV2Control(authzID=\""); |
| | | authorizationID.toString(buffer); |
| | | buffer.append("\")"); |
| | |
| | | */ |
| | | public final int getIDToAbandon() |
| | | { |
| | | |
| | | return idToAbandon; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStartTime() |
| | | { |
| | | |
| | | return processingStartTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStopTime() |
| | | { |
| | | |
| | | return processingStopTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingTime() |
| | | { |
| | | |
| | | return (processingStopTime - processingStartTime); |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final OperationType getOperationType() |
| | | { |
| | | |
| | | // Note that no debugging will be done in this method because it is a likely |
| | | // candidate for being called by the logging subsystem. |
| | | |
| | |
| | | @Override() |
| | | public final String[][] getRequestLogElements() |
| | | { |
| | | |
| | | // Note that no debugging will be done in this method because it is a likely |
| | | // candidate for being called by the logging subsystem. |
| | | |
| | |
| | | @Override() |
| | | public final List<Control> getResponseControls() |
| | | { |
| | | |
| | | // An abandon operation can never have a response, so just return an empty |
| | | // list. |
| | | return NO_RESPONSE_CONTROLS; |
| | |
| | | @Override() |
| | | public final void run() |
| | | { |
| | | |
| | | setResultCode(ResultCode.UNDEFINED); |
| | | |
| | | |
| | |
| | | @Override() |
| | | public final CancelResult cancel(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | cancelRequest.addResponseMessage(getMessage(MSGID_CANNOT_CANCEL_ABANDON)); |
| | | return CancelResult.CANNOT_CANCEL; |
| | | } |
| | |
| | | @Override() |
| | | public final CancelRequest getCancelRequest() |
| | | { |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | boolean setCancelRequest(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | // Abandon operations cannot be canceled. |
| | | return false; |
| | | } |
| | |
| | | @Override() |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("AbandonOperation(connID="); |
| | | buffer.append(clientConnection.getConnectionID()); |
| | | buffer.append(", opID="); |
| | |
| | | */ |
| | | public DN getComponentEntryDN() |
| | | { |
| | | |
| | | return currentConfiguration.getConfigEntry().getDN(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getClassName() |
| | | { |
| | | |
| | | return CLASS_NAME; |
| | | } |
| | | |
| | |
| | | */ |
| | | public LinkedHashMap<String,String> getAlerts() |
| | | { |
| | | |
| | | LinkedHashMap<String,String> alerts = new LinkedHashMap<String,String>(); |
| | | |
| | | alerts.put(ALERT_TYPE_ACCESS_CONTROL_DISABLED, |
| | |
| | | */ |
| | | public AccountStatusNotificationHandlerConfigManager() |
| | | { |
| | | |
| | | configHandler = DirectoryServer.getConfigHandler(); |
| | | notificationHandlers = |
| | | new ConcurrentHashMap<DN,AccountStatusNotificationHandler>(); |
| | |
| | | public void initializeNotificationHandlers() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the configuration base entry. |
| | | ConfigEntry baseEntry; |
| | | try |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for an account |
| | | // status notification handler. |
| | | if (! configEntry.hasObjectClass(OC_ACCT_NOTIFICATION_HANDLER)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that no entry already exists with the specified DN. |
| | | DN configEntryDN = configEntry.getDN(); |
| | | if (notificationHandlers.containsKey(configEntryDN)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | */ |
| | | public final ByteString getRawEntryDN() |
| | | { |
| | | |
| | | return rawEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setRawEntryDN(ByteString rawEntryDN) |
| | | { |
| | | |
| | | this.rawEntryDN = rawEntryDN; |
| | | |
| | | entryDN = null; |
| | |
| | | */ |
| | | public final DN getEntryDN() |
| | | { |
| | | |
| | | return entryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final List<LDAPAttribute> getRawAttributes() |
| | | { |
| | | |
| | | return rawAttributes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void addRawAttribute(LDAPAttribute rawAttribute) |
| | | { |
| | | |
| | | rawAttributes.add(rawAttribute); |
| | | |
| | | objectClasses = null; |
| | |
| | | */ |
| | | public final void setRawAttributes(List<LDAPAttribute> rawAttributes) |
| | | { |
| | | |
| | | this.rawAttributes = rawAttributes; |
| | | |
| | | objectClasses = null; |
| | |
| | | */ |
| | | public final Map<ObjectClass,String> getObjectClasses() |
| | | { |
| | | |
| | | return objectClasses; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void addObjectClass(ObjectClass objectClass, String name) |
| | | { |
| | | |
| | | objectClasses.put(objectClass, name); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void removeObjectClass(ObjectClass objectClass) |
| | | { |
| | | |
| | | objectClasses.remove(objectClass); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Map<AttributeType,List<Attribute>> getUserAttributes() |
| | | { |
| | | |
| | | return userAttributes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Map<AttributeType,List<Attribute>> getOperationalAttributes() |
| | | { |
| | | |
| | | return operationalAttributes; |
| | | } |
| | | |
| | |
| | | public final void setAttribute(AttributeType attributeType, |
| | | List<Attribute> attributeList) |
| | | { |
| | | |
| | | if (attributeType.isOperational()) |
| | | { |
| | | if ((attributeList == null) || (attributeList.isEmpty())) |
| | |
| | | */ |
| | | public final void removeAttribute(AttributeType attributeType) |
| | | { |
| | | |
| | | if (attributeType.isOperational()) |
| | | { |
| | | operationalAttributes.remove(attributeType); |
| | |
| | | */ |
| | | public final Entry getEntryToAdd() |
| | | { |
| | | |
| | | return entry; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStartTime() |
| | | { |
| | | |
| | | return processingStartTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStopTime() |
| | | { |
| | | |
| | | return processingStopTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingTime() |
| | | { |
| | | |
| | | return (processingStopTime - processingStartTime); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final long getChangeNumber() |
| | | { |
| | | |
| | | return changeNumber; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setChangeNumber(long changeNumber) |
| | | { |
| | | |
| | | this.changeNumber = changeNumber; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final ArrayList<Control> getResponseControls() |
| | | { |
| | | |
| | | return responseControls; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final void run() |
| | | { |
| | | |
| | | |
| | | // Start the processing timer. |
| | | processingStartTime = System.currentTimeMillis(); |
| | | setResultCode(ResultCode.UNDEFINED); |
| | |
| | | */ |
| | | private final void addObjectClassChain(ObjectClass objectClass) |
| | | { |
| | | |
| | | if (! objectClasses.containsKey(objectClass)) |
| | | { |
| | | objectClasses.put(objectClass, objectClass.getNameOrOID()); |
| | |
| | | Entry userEntry) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // See if a password was specified. |
| | | AttributeType passwordAttribute = passwordPolicy.getPasswordAttribute(); |
| | | List<Attribute> attrList = userEntry.getAttribute(passwordAttribute); |
| | |
| | | @Override() |
| | | public final CancelResult cancel(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | |
| | | CancelResult cancelResult = getCancelResult(); |
| | |
| | | @Override() |
| | | public final CancelRequest getCancelRequest() |
| | | { |
| | | |
| | | return cancelRequest; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | boolean setCancelRequest(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("AddOperation(connID="); |
| | | buffer.append(clientConnection.getConnectionID()); |
| | | buffer.append(", opID="); |
| | |
| | | */ |
| | | public AuthenticatedUsers() |
| | | { |
| | | |
| | | userMap = new ConcurrentHashMap<DN,CopyOnWriteArraySet<ClientConnection>>(); |
| | | |
| | | DirectoryServer.registerChangeNotificationListener(this); |
| | |
| | | */ |
| | | public synchronized void put(DN userDN, ClientConnection clientConnection) |
| | | { |
| | | |
| | | CopyOnWriteArraySet<ClientConnection> connectionSet = userMap.get(userDN); |
| | | if (connectionSet == null) |
| | | { |
| | |
| | | */ |
| | | public synchronized void remove(DN userDN, ClientConnection clientConnection) |
| | | { |
| | | |
| | | CopyOnWriteArraySet<ClientConnection> connectionSet = userMap.get(userDN); |
| | | if (connectionSet != null) |
| | | { |
| | |
| | | */ |
| | | public BackendConfigManager() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | public void initializeBackendConfig() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | registeredBackends = new ConcurrentHashMap<DN,Backend>(); |
| | | |
| | | |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | DN backendDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | DN backendDN = configEntry.getDN(); |
| | | Backend backend = registeredBackends.get(backendDN); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | DN backendDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN backendDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | DN backendDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN backendDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | */ |
| | | public final AuthenticationType getAuthenticationType() |
| | | { |
| | | |
| | | return authType; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final ByteString getRawBindDN() |
| | | { |
| | | |
| | | return rawBindDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setRawBindDN(ByteString rawBindDN) |
| | | { |
| | | |
| | | if (rawBindDN == null) |
| | | { |
| | | this.rawBindDN = new ASN1OctetString(); |
| | |
| | | */ |
| | | public final DN getBindDN() |
| | | { |
| | | |
| | | return bindDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final ByteString getSimplePassword() |
| | | { |
| | | |
| | | return simplePassword; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setSimplePassword(ByteString simplePassword) |
| | | { |
| | | |
| | | if (simplePassword == null) |
| | | { |
| | | this.simplePassword = new ASN1OctetString(); |
| | |
| | | */ |
| | | public final String getSASLMechanism() |
| | | { |
| | | |
| | | return saslMechanism; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final ASN1OctetString getSASLCredentials() |
| | | { |
| | | |
| | | return saslCredentials; |
| | | } |
| | | |
| | |
| | | public final void setSASLCredentials(String saslMechanism, |
| | | ASN1OctetString saslCredentials) |
| | | { |
| | | |
| | | this.saslMechanism = saslMechanism; |
| | | this.saslCredentials = saslCredentials; |
| | | |
| | |
| | | */ |
| | | public final ASN1OctetString getServerSASLCredentials() |
| | | { |
| | | |
| | | return serverSASLCredentials; |
| | | } |
| | | |
| | |
| | | public final void setServerSASLCredentials(ASN1OctetString |
| | | serverSASLCredentials) |
| | | { |
| | | |
| | | this.serverSASLCredentials = serverSASLCredentials; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Entry getSASLAuthUserEntry() |
| | | { |
| | | |
| | | return saslAuthUserEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setSASLAuthUserEntry(Entry saslAuthUserEntry) |
| | | { |
| | | |
| | | this.saslAuthUserEntry = saslAuthUserEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final String getAuthFailureReason() |
| | | { |
| | | |
| | | return authFailureReason; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final int getAuthFailureID() |
| | | { |
| | | |
| | | return authFailureID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setAuthFailureReason(int id, String reason) |
| | | { |
| | | |
| | | if (id < 0) |
| | | { |
| | | authFailureID = 0; |
| | |
| | | */ |
| | | public final DN getUserEntryDN() |
| | | { |
| | | |
| | | return userEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final AuthenticationInfo getAuthenticationInfo() |
| | | { |
| | | |
| | | return authInfo; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setAuthenticationInfo(AuthenticationInfo authInfo) |
| | | { |
| | | |
| | | this.authInfo = authInfo; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStartTime() |
| | | { |
| | | |
| | | return processingStartTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStopTime() |
| | | { |
| | | |
| | | return processingStopTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingTime() |
| | | { |
| | | |
| | | return (processingStopTime - processingStartTime); |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final List<Control> getResponseControls() |
| | | { |
| | | |
| | | return responseControls; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final void run() |
| | | { |
| | | |
| | | |
| | | // Start the processing timer and initially set the result to indicate that |
| | | // the result is unknown. |
| | | processingStartTime = System.currentTimeMillis(); |
| | |
| | | @Override() |
| | | public final CancelResult cancel(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | cancelRequest.addResponseMessage(getMessage(MSGID_CANNOT_CANCEL_BIND)); |
| | | return CancelResult.CANNOT_CANCEL; |
| | | } |
| | |
| | | @Override() |
| | | public final CancelRequest getCancelRequest() |
| | | { |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | boolean setCancelRequest(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | // Bind operations cannot be canceled. |
| | | return false; |
| | | } |
| | |
| | | @Override() |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("BindOperation(connID="); |
| | | buffer.append(clientConnection.getConnectionID()); |
| | | buffer.append(", opID="); |
| | |
| | | */ |
| | | public CertificateMapperConfigManager() |
| | | { |
| | | |
| | | configHandler = DirectoryServer.getConfigHandler(); |
| | | mappers = new ConcurrentHashMap<DN,CertificateMapper>(); |
| | | } |
| | |
| | | public void initializeCertificateMappers() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the configuration base entry. |
| | | ConfigEntry baseEntry; |
| | | try |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for a certificate |
| | | // mapper. |
| | | if (! configEntry.hasObjectClass(OC_CERTIFICATE_MAPPER)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that no entry already exists with the specified DN. |
| | | DN configEntryDN = configEntry.getDN(); |
| | | if (mappers.containsKey(configEntryDN)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | */ |
| | | public final ByteString getRawEntryDN() |
| | | { |
| | | |
| | | return rawEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setRawEntryDN(ByteString rawEntryDN) |
| | | { |
| | | |
| | | this.rawEntryDN = rawEntryDN; |
| | | |
| | | entryDN = null; |
| | |
| | | */ |
| | | public final DN getEntryDN() |
| | | { |
| | | |
| | | return entryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final String getRawAttributeType() |
| | | { |
| | | |
| | | return rawAttributeType; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setRawAttributeType(String rawAttributeType) |
| | | { |
| | | |
| | | this.rawAttributeType = rawAttributeType; |
| | | |
| | | attributeType = null; |
| | |
| | | */ |
| | | public final AttributeType getAttributeType() |
| | | { |
| | | |
| | | return attributeType; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final ByteString getAssertionValue() |
| | | { |
| | | |
| | | return assertionValue; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setAssertionValue(ByteString assertionValue) |
| | | { |
| | | |
| | | this.assertionValue = assertionValue; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Entry getEntryToCompare() |
| | | { |
| | | |
| | | return entry; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStartTime() |
| | | { |
| | | |
| | | return processingStartTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStopTime() |
| | | { |
| | | |
| | | return processingStopTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingTime() |
| | | { |
| | | |
| | | return (processingStopTime - processingStartTime); |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final List<Control> getResponseControls() |
| | | { |
| | | |
| | | return responseControls; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final void run() |
| | | { |
| | | |
| | | setResultCode(ResultCode.UNDEFINED); |
| | | |
| | | |
| | |
| | | @Override() |
| | | public final CancelResult cancel(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | |
| | | CancelResult cancelResult = getCancelResult(); |
| | |
| | | @Override() |
| | | public final CancelRequest getCancelRequest() |
| | | { |
| | | |
| | | return cancelRequest; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | boolean setCancelRequest(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("CompareOperation(connID="); |
| | | buffer.append(clientConnection.getConnectionID()); |
| | | buffer.append(", opID="); |
| | |
| | | */ |
| | | public ConnectionHandlerConfigManager() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | public void initializeConnectionHandlerConfig() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | connectionHandlers = new ConcurrentHashMap<DN,ConnectionHandler>(); |
| | | |
| | | |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | DN connectionHandlerDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | DN connectionHandlerDN = configEntry.getDN(); |
| | | ConnectionHandler connectionHandler = |
| | | connectionHandlers.get(connectionHandlerDN); |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | DN connectionHandlerDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | */ |
| | | public CoreConfigManager() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | public void initializeCoreConfig() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // Get the configuration root entry, since all the attributes we care about |
| | | // should be contained in it. |
| | | ConfigEntry configRoot = |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | LinkedList<ConfigAttribute> attrs = new LinkedList<ConfigAttribute>(); |
| | | |
| | | ConfigEntry configEntry; |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // Start out assuming that the configuration is valid. |
| | | boolean configIsAcceptable = true; |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | ArrayList<String> resultMessages = new ArrayList<String>(); |
| | | boolean adminActionRequired = false; |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | |
| | | */ |
| | | public final ByteString getRawEntryDN() |
| | | { |
| | | |
| | | return rawEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setRawEntryDN(ByteString rawEntryDN) |
| | | { |
| | | |
| | | this.rawEntryDN = rawEntryDN; |
| | | |
| | | entryDN = null; |
| | |
| | | */ |
| | | public final DN getEntryDN() |
| | | { |
| | | |
| | | return entryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Entry getEntryToDelete() |
| | | { |
| | | |
| | | return entry; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStartTime() |
| | | { |
| | | |
| | | return processingStartTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStopTime() |
| | | { |
| | | |
| | | return processingStopTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingTime() |
| | | { |
| | | |
| | | return (processingStopTime - processingStartTime); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final long getChangeNumber() |
| | | { |
| | | |
| | | return changeNumber; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setChangeNumber(long changeNumber) |
| | | { |
| | | |
| | | this.changeNumber = changeNumber; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final List<Control> getResponseControls() |
| | | { |
| | | |
| | | return responseControls; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final void run() |
| | | { |
| | | |
| | | setResultCode(ResultCode.UNDEFINED); |
| | | |
| | | |
| | |
| | | @Override() |
| | | public final CancelResult cancel(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | |
| | | CancelResult cancelResult = getCancelResult(); |
| | |
| | | @Override() |
| | | public final CancelRequest getCancelRequest() |
| | | { |
| | | |
| | | return cancelRequest; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | boolean setCancelRequest(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("DeleteOperation(connID="); |
| | | buffer.append(clientConnection.getConnectionID()); |
| | | buffer.append(", opID="); |
| | |
| | | public static void initializeJMX() |
| | | throws InitializationException |
| | | { |
| | | |
| | | try |
| | | { |
| | | // FIXME -- Should we use the plaform Mbean Server or |
| | |
| | | */ |
| | | public static String getConfigFile() |
| | | { |
| | | |
| | | return directoryServer.configFile; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static AuthenticatedUsers getAuthenticatedUsers() |
| | | { |
| | | |
| | | return directoryServer.authenticatedUsers; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static CryptoManager getCryptoManager() |
| | | { |
| | | |
| | | return directoryServer.cryptoManager; |
| | | } |
| | | |
| | |
| | | public void initializeMailServerPropertySets() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | mailServerPropertySets = new CopyOnWriteArrayList<Properties>(); |
| | | |
| | | // FIXME -- Actually read the information from the config handler. |
| | |
| | | */ |
| | | public static CopyOnWriteArrayList<Properties> getMailServerPropertySets() |
| | | { |
| | | |
| | | return directoryServer.mailServerPropertySets; |
| | | } |
| | | |
| | |
| | | public void initializeSchema() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // Create the schema configuration manager, and initialize the schema from |
| | | // the configuration. |
| | | schemaConfigManager = new SchemaConfigManager(); |
| | |
| | | public static Set<BackendInitializationListener> |
| | | getBackendInitializationListeners() |
| | | { |
| | | |
| | | return directoryServer.backendInitializationListeners; |
| | | } |
| | | |
| | |
| | | public static void registerBackendInitializationListener( |
| | | BackendInitializationListener listener) |
| | | { |
| | | |
| | | directoryServer.backendInitializationListeners.add(listener); |
| | | } |
| | | |
| | |
| | | public static void deregisterBackendInitializationListener( |
| | | BackendInitializationListener listener) |
| | | { |
| | | |
| | | directoryServer.backendInitializationListeners.remove(listener); |
| | | } |
| | | |
| | |
| | | private void initializeBackends() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | backendConfigManager = new BackendConfigManager(); |
| | | backendConfigManager.initializeBackendConfig(); |
| | | |
| | |
| | | public void initializeGroupManager() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | groupManager = new GroupManager(); |
| | | groupManager.initializeGroupImplementations(); |
| | | |
| | |
| | | */ |
| | | public static GroupManager getGroupManager() |
| | | { |
| | | |
| | | return directoryServer.groupManager; |
| | | } |
| | | |
| | |
| | | private void initializeSupportedControls() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | supportedControls.add(OID_LDAP_ASSERTION); |
| | | supportedControls.add(OID_LDAP_READENTRY_PREREAD); |
| | | supportedControls.add(OID_LDAP_READENTRY_POSTREAD); |
| | |
| | | private void initializeSupportedFeatures() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | supportedFeatures.add(OID_ALL_OPERATIONAL_ATTRS_FEATURE); |
| | | supportedFeatures.add(OID_MODIFY_INCREMENT_FEATURE); |
| | | supportedFeatures.add(OID_TRUE_FALSE_FILTERS_FEATURE); |
| | |
| | | private void initializeIdentityMappers() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | identityMapperConfigManager = new IdentityMapperConfigManager(); |
| | | identityMapperConfigManager.initializeIdentityMappers(); |
| | | } |
| | |
| | | private void initializeExtendedOperations() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | extendedOperationConfigManager = new ExtendedOperationConfigManager(); |
| | | extendedOperationConfigManager.initializeExtendedOperationHandlers(); |
| | | } |
| | |
| | | private void initializeSASLMechanisms() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | saslConfigManager = new SASLConfigManager(); |
| | | saslConfigManager.initializeSASLMechanismHandlers(); |
| | | } |
| | |
| | | private void initializeConnectionHandlers() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | connectionHandlerConfigManager = new ConnectionHandlerConfigManager(); |
| | | connectionHandlerConfigManager.initializeConnectionHandlerConfig(); |
| | | } |
| | |
| | | public void initializePasswordPolicyComponents() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // Initialize all the password storage schemes. |
| | | storageSchemeConfigManager = new PasswordStorageSchemeConfigManager(); |
| | | storageSchemeConfigManager.initializePasswordStorageSchemes(); |
| | |
| | | */ |
| | | public static OperatingSystem getOperatingSystem() |
| | | { |
| | | |
| | | return directoryServer.operatingSystem; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static ThreadGroup getDirectoryThreadGroup() |
| | | { |
| | | |
| | | return directoryServer.directoryThreadGroup; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static ConfigHandler getConfigHandler() |
| | | { |
| | | |
| | | return directoryServer.configHandler; |
| | | } |
| | | |
| | |
| | | public void initializePlugins() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | pluginConfigManager.initializePluginConfig(null); |
| | | } |
| | | |
| | |
| | | public void initializePlugins(Set<PluginType> pluginTypes) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | pluginConfigManager = new PluginConfigManager(); |
| | | pluginConfigManager.initializePluginConfig(pluginTypes); |
| | | } |
| | |
| | | */ |
| | | public static PluginConfigManager getPluginConfigManager() |
| | | { |
| | | |
| | | return directoryServer.pluginConfigManager; |
| | | } |
| | | |
| | |
| | | public static ConfigEntry getConfigEntry(DN entryDN) |
| | | throws ConfigException |
| | | { |
| | | |
| | | return directoryServer.configHandler.getConfigEntry(entryDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static String getServerRoot() |
| | | { |
| | | |
| | | if (directoryServer.configHandler == null) |
| | | { |
| | | String serverRoot = System.getenv(ENV_VAR_INSTANCE_ROOT); |
| | |
| | | */ |
| | | public static long getStartTime() |
| | | { |
| | | |
| | | return directoryServer.startUpTime; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static String getStartTimeUTC() |
| | | { |
| | | |
| | | return directoryServer.startTimeUTC; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static Schema getSchema() |
| | | { |
| | | |
| | | return directoryServer.schema; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void setSchema(Schema schema) |
| | | { |
| | | |
| | | directoryServer.schema = schema; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static ConcurrentHashMap<String,MatchingRule> getMatchingRules() |
| | | { |
| | | |
| | | return directoryServer.schema.getMatchingRules(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static LinkedHashSet<AttributeValue> getMatchingRuleSet() |
| | | { |
| | | |
| | | return directoryServer.schema.getMatchingRuleSet(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static MatchingRule getMatchingRule(String lowerName) |
| | | { |
| | | |
| | | return directoryServer.schema.getMatchingRule(lowerName); |
| | | } |
| | | |
| | |
| | | boolean overwriteExisting) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | directoryServer.schema.registerMatchingRule(matchingRule, |
| | | overwriteExisting); |
| | | } |
| | |
| | | */ |
| | | public static void deregisterMatchingRule(MatchingRule matchingRule) |
| | | { |
| | | |
| | | directoryServer.schema.deregisterMatchingRule(matchingRule); |
| | | } |
| | | |
| | |
| | | public static ConcurrentHashMap<String,ApproximateMatchingRule> |
| | | getApproximateMatchingRules() |
| | | { |
| | | |
| | | return directoryServer.schema.getApproximateMatchingRules(); |
| | | } |
| | | |
| | |
| | | public static ApproximateMatchingRule |
| | | getApproximateMatchingRule(String lowerName) |
| | | { |
| | | |
| | | return directoryServer.schema.getApproximateMatchingRule(lowerName); |
| | | } |
| | | |
| | |
| | | boolean overwriteExisting) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | directoryServer.schema.registerApproximateMatchingRule(matchingRule, |
| | | overwriteExisting); |
| | | } |
| | |
| | | public static void deregisterApproximateMatchingRule(ApproximateMatchingRule |
| | | matchingRule) |
| | | { |
| | | |
| | | directoryServer.schema.deregisterApproximateMatchingRule(matchingRule); |
| | | } |
| | | |
| | |
| | | public static ConcurrentHashMap<String,EqualityMatchingRule> |
| | | getEqualityMatchingRules() |
| | | { |
| | | |
| | | return directoryServer.schema.getEqualityMatchingRules(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static EqualityMatchingRule getEqualityMatchingRule(String lowerName) |
| | | { |
| | | |
| | | return directoryServer.schema.getEqualityMatchingRule(lowerName); |
| | | } |
| | | |
| | |
| | | boolean overwriteExisting) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | directoryServer.schema.registerEqualityMatchingRule(matchingRule, |
| | | overwriteExisting); |
| | | } |
| | |
| | | public static void deregisterEqualityMatchingRule(EqualityMatchingRule |
| | | matchingRule) |
| | | { |
| | | |
| | | directoryServer.schema.deregisterEqualityMatchingRule(matchingRule); |
| | | } |
| | | |
| | |
| | | public static ConcurrentHashMap<String,OrderingMatchingRule> |
| | | getOrderingMatchingRules() |
| | | { |
| | | |
| | | return directoryServer.schema.getOrderingMatchingRules(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static OrderingMatchingRule getOrderingMatchingRule(String lowerName) |
| | | { |
| | | |
| | | return directoryServer.schema.getOrderingMatchingRule(lowerName); |
| | | } |
| | | |
| | |
| | | boolean overwriteExisting) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | directoryServer.schema.registerOrderingMatchingRule(matchingRule, |
| | | overwriteExisting); |
| | | } |
| | |
| | | public static void deregisterOrderingMatchingRule(OrderingMatchingRule |
| | | matchingRule) |
| | | { |
| | | |
| | | directoryServer.schema.deregisterOrderingMatchingRule(matchingRule); |
| | | } |
| | | |
| | |
| | | public static ConcurrentHashMap<String,SubstringMatchingRule> |
| | | getSubstringMatchingRules() |
| | | { |
| | | |
| | | return directoryServer.schema.getSubstringMatchingRules(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static SubstringMatchingRule getSubstringMatchingRule(String lowerName) |
| | | { |
| | | |
| | | return directoryServer.schema.getSubstringMatchingRule(lowerName); |
| | | } |
| | | |
| | |
| | | boolean overwriteExisting) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | directoryServer.schema.registerSubstringMatchingRule(matchingRule, |
| | | overwriteExisting); |
| | | } |
| | |
| | | public static void deregisterSubstringMatchingRule(SubstringMatchingRule |
| | | matchingRule) |
| | | { |
| | | |
| | | directoryServer.schema.deregisterSubstringMatchingRule(matchingRule); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static ConcurrentHashMap<String,ObjectClass> getObjectClasses() |
| | | { |
| | | |
| | | return directoryServer.schema.getObjectClasses(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static LinkedHashSet<AttributeValue> getObjectClassSet() |
| | | { |
| | | |
| | | return directoryServer.schema.getObjectClassSet(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static ObjectClass getObjectClass(String lowerName) |
| | | { |
| | | |
| | | return directoryServer.schema.getObjectClass(lowerName); |
| | | } |
| | | |
| | |
| | | public static ObjectClass getObjectClass(String lowerName, |
| | | boolean returnDefault) |
| | | { |
| | | |
| | | ObjectClass oc = directoryServer.schema.getObjectClass(lowerName); |
| | | if (returnDefault && (oc == null)) |
| | | { |
| | |
| | | boolean overwriteExisting) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | directoryServer.schema.registerObjectClass(objectClass, overwriteExisting); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void deregisterObjectClass(ObjectClass objectClass) |
| | | { |
| | | |
| | | directoryServer.schema.deregisterObjectClass(objectClass); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static ObjectClass getTopObjectClass() |
| | | { |
| | | |
| | | ObjectClass objectClass = |
| | | directoryServer.schema.getObjectClass(TOP_OBJECTCLASS_NAME); |
| | | if (objectClass == null) |
| | |
| | | */ |
| | | public static ObjectClass getDefaultObjectClass(String name) |
| | | { |
| | | |
| | | String lowerName = toLowerCase(name); |
| | | ObjectClass objectClass = directoryServer.schema.getObjectClass(lowerName); |
| | | if (objectClass == null) |
| | |
| | | */ |
| | | public static ObjectClass getDefaultAuxiliaryObjectClass(String name) |
| | | { |
| | | |
| | | String lowerName = toLowerCase(name); |
| | | ObjectClass objectClass = directoryServer.schema.getObjectClass(lowerName); |
| | | if (objectClass == null) |
| | |
| | | */ |
| | | public static ConcurrentHashMap<String,AttributeType> getAttributeTypes() |
| | | { |
| | | |
| | | return directoryServer.schema.getAttributeTypes(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static LinkedHashSet<AttributeValue> getAttributeTypeSet() |
| | | { |
| | | |
| | | return directoryServer.schema.getAttributeTypeSet(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static AttributeType getAttributeType(String lowerName) |
| | | { |
| | | |
| | | return directoryServer.schema.getAttributeType(lowerName); |
| | | } |
| | | |
| | |
| | | public static AttributeType getAttributeType(String lowerName, |
| | | boolean returnDefault) |
| | | { |
| | | |
| | | AttributeType type = directoryServer.schema.getAttributeType(lowerName); |
| | | if (returnDefault && (type == null)) |
| | | { |
| | |
| | | boolean overwriteExisting) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | directoryServer.schema.registerAttributeType(attributeType, |
| | | overwriteExisting); |
| | | } |
| | |
| | | */ |
| | | public static void deregisterAttributeType(AttributeType attributeType) |
| | | { |
| | | |
| | | directoryServer.schema.deregisterAttributeType(attributeType); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static AttributeType getObjectClassAttributeType() |
| | | { |
| | | |
| | | if (directoryServer.objectClassAttributeType == null) |
| | | { |
| | | directoryServer.objectClassAttributeType = |
| | |
| | | */ |
| | | public static AttributeType getDefaultAttributeType(String name) |
| | | { |
| | | |
| | | |
| | | return getDefaultAttributeType(name, getDefaultAttributeSyntax()); |
| | | } |
| | | |
| | |
| | | public static AttributeType getDefaultAttributeType(String name, |
| | | AttributeSyntax syntax) |
| | | { |
| | | |
| | | |
| | | String oid = toLowerCase(name) + "-oid"; |
| | | String definition = "( " + oid + " NAME '" + name + "' SYNTAX " + |
| | | syntax.getOID() + " )"; |
| | |
| | | */ |
| | | public static ConcurrentHashMap<String,AttributeSyntax> getAttributeSyntaxes() |
| | | { |
| | | |
| | | return directoryServer.schema.getSyntaxes(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static LinkedHashSet<AttributeValue> getAttributeSyntaxSet() |
| | | { |
| | | |
| | | return directoryServer.schema.getSyntaxSet(); |
| | | } |
| | | |
| | |
| | | public static AttributeSyntax getAttributeSyntax(String oid, |
| | | boolean allowDefault) |
| | | { |
| | | |
| | | AttributeSyntax syntax = directoryServer.schema.getSyntax(oid); |
| | | if ((syntax == null) && allowDefault) |
| | | { |
| | |
| | | boolean overwriteExisting) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | directoryServer.schema.registerSyntax(syntax, overwriteExisting); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void deregisterAttributeSyntax(AttributeSyntax syntax) |
| | | { |
| | | |
| | | directoryServer.schema.deregisterSyntax(syntax); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static AttributeSyntax getDefaultAttributeSyntax() |
| | | { |
| | | |
| | | return directoryServer.defaultSyntax; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static AttributeSyntax getDefaultBinarySyntax() |
| | | { |
| | | |
| | | return directoryServer.defaultBinarySyntax; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static AttributeSyntax getDefaultBooleanSyntax() |
| | | { |
| | | |
| | | return directoryServer.defaultBooleanSyntax; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static AttributeSyntax getDefaultDNSyntax() |
| | | { |
| | | |
| | | return directoryServer.defaultDNSyntax; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static AttributeSyntax getDefaultIntegerSyntax() |
| | | { |
| | | |
| | | return directoryServer.defaultIntegerSyntax; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static AttributeSyntax getDefaultStringSyntax() |
| | | { |
| | | |
| | | return directoryServer.defaultStringSyntax; |
| | | } |
| | | |
| | |
| | | public static ConcurrentHashMap<MatchingRule,MatchingRuleUse> |
| | | getMatchingRuleUses() |
| | | { |
| | | |
| | | return directoryServer.schema.getMatchingRuleUses(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static LinkedHashSet<AttributeValue> getMatchingRuleUseSet() |
| | | { |
| | | |
| | | return directoryServer.schema.getMatchingRuleUseSet(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static MatchingRuleUse getMatchingRuleUse(MatchingRule matchingRule) |
| | | { |
| | | |
| | | return directoryServer.schema.getMatchingRuleUse(matchingRule); |
| | | } |
| | | |
| | |
| | | boolean overwriteExisting) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | directoryServer.schema.registerMatchingRuleUse(matchingRuleUse, |
| | | overwriteExisting); |
| | | } |
| | |
| | | */ |
| | | public static void deregisterMatchingRuleUse(MatchingRuleUse matchingRuleUse) |
| | | { |
| | | |
| | | directoryServer.schema.deregisterMatchingRuleUse(matchingRuleUse); |
| | | } |
| | | |
| | |
| | | public static ConcurrentHashMap<ObjectClass,DITContentRule> |
| | | getDITContentRules() |
| | | { |
| | | |
| | | return directoryServer.schema.getDITContentRules(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static LinkedHashSet<AttributeValue> getDITContentRuleSet() |
| | | { |
| | | |
| | | return directoryServer.schema.getDITContentRuleSet(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static DITContentRule getDITContentRule(ObjectClass objectClass) |
| | | { |
| | | |
| | | return directoryServer.schema.getDITContentRule(objectClass); |
| | | } |
| | | |
| | |
| | | boolean overwriteExisting) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | directoryServer.schema.registerDITContentRule(ditContentRule, |
| | | overwriteExisting); |
| | | } |
| | |
| | | */ |
| | | public static void deregisterDITContentRule(DITContentRule ditContentRule) |
| | | { |
| | | |
| | | directoryServer.schema.deregisterDITContentRule(ditContentRule); |
| | | } |
| | | |
| | |
| | | public static ConcurrentHashMap<NameForm,DITStructureRule> |
| | | getDITStructureRules() |
| | | { |
| | | |
| | | return directoryServer.schema.getDITStructureRulesByNameForm(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static LinkedHashSet<AttributeValue> getDITStructureRuleSet() |
| | | { |
| | | |
| | | return directoryServer.schema.getDITStructureRuleSet(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static DITStructureRule getDITStructureRule(int ruleID) |
| | | { |
| | | |
| | | return directoryServer.schema.getDITStructureRule(ruleID); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static DITStructureRule getDITStructureRule(NameForm nameForm) |
| | | { |
| | | |
| | | return directoryServer.schema.getDITStructureRule(nameForm); |
| | | } |
| | | |
| | |
| | | boolean overwriteExisting) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | directoryServer.schema.registerDITStructureRule(ditStructureRule, |
| | | overwriteExisting); |
| | | } |
| | |
| | | public static void deregisterDITStructureRule(DITStructureRule |
| | | ditStructureRule) |
| | | { |
| | | |
| | | directoryServer.schema.deregisterDITStructureRule(ditStructureRule); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static ConcurrentHashMap<ObjectClass,NameForm> getNameForms() |
| | | { |
| | | |
| | | return directoryServer.schema.getNameFormsByObjectClass(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static LinkedHashSet<AttributeValue> getNameFormSet() |
| | | { |
| | | |
| | | return directoryServer.schema.getNameFormSet(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static NameForm getNameForm(ObjectClass objectClass) |
| | | { |
| | | |
| | | return directoryServer.schema.getNameForm(objectClass); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static NameForm getNameForm(String lowerName) |
| | | { |
| | | |
| | | return directoryServer.schema.getNameForm(lowerName); |
| | | } |
| | | |
| | |
| | | boolean overwriteExisting) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | directoryServer.schema.registerNameForm(nameForm, overwriteExisting); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void deregisterNameForm(NameForm nameForm) |
| | | { |
| | | |
| | | directoryServer.schema.deregisterNameForm(nameForm); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static MBeanServer getJMXMBeanServer() |
| | | { |
| | | |
| | | return directoryServer.mBeanServer; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static ConcurrentHashMap<DN,JMXMBean> getJMXMBeans() |
| | | { |
| | | |
| | | return directoryServer.mBeans; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static JMXMBean getJMXMBean(DN configEntryDN) |
| | | { |
| | | |
| | | return directoryServer.mBeans.get(configEntryDN); |
| | | } |
| | | |
| | |
| | | public static void registerConfigurableComponent(ConfigurableComponent |
| | | component) |
| | | { |
| | | |
| | | DN componentDN = component.getConfigurableComponentEntryDN(); |
| | | JMXMBean mBean = directoryServer.mBeans.get(componentDN); |
| | | if (mBean == null) |
| | |
| | | public static void deregisterConfigurableComponent(ConfigurableComponent |
| | | component) |
| | | { |
| | | |
| | | DN componentDN = component.getConfigurableComponentEntryDN(); |
| | | JMXMBean mBean = directoryServer.mBeans.get(componentDN); |
| | | if (mBean != null) |
| | |
| | | */ |
| | | public static void registerInvokableComponent(InvokableComponent component) |
| | | { |
| | | |
| | | DN componentDN = component.getInvokableComponentEntryDN(); |
| | | JMXMBean mBean = directoryServer.mBeans.get(componentDN); |
| | | if (mBean == null) |
| | |
| | | */ |
| | | public static void deregisterInvokableComponent(InvokableComponent component) |
| | | { |
| | | |
| | | DN componentDN = component.getInvokableComponentEntryDN(); |
| | | JMXMBean mBean = directoryServer.mBeans.get(componentDN); |
| | | if (mBean != null) |
| | |
| | | */ |
| | | public static void registerAlertGenerator(AlertGenerator alertGenerator) |
| | | { |
| | | |
| | | DN componentDN = alertGenerator.getComponentEntryDN(); |
| | | JMXMBean mBean = directoryServer.mBeans.get(componentDN); |
| | | if (mBean == null) |
| | |
| | | */ |
| | | public static void deregisterAlertGenerator(AlertGenerator alertGenerator) |
| | | { |
| | | |
| | | DN componentDN = alertGenerator.getComponentEntryDN(); |
| | | JMXMBean mBean = directoryServer.mBeans.get(componentDN); |
| | | if (mBean != null) |
| | |
| | | */ |
| | | public static CopyOnWriteArrayList<AlertHandler> getAlertHandlers() |
| | | { |
| | | |
| | | return directoryServer.alertHandlers; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void registerAlertHandler(AlertHandler alertHandler) |
| | | { |
| | | |
| | | directoryServer.alertHandlers.add(alertHandler); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void deregisterAlertHandler(AlertHandler alertHandler) |
| | | { |
| | | |
| | | directoryServer.alertHandlers.remove(alertHandler); |
| | | } |
| | | |
| | |
| | | String alertType, int alertID, |
| | | String alertMessage) |
| | | { |
| | | |
| | | |
| | | if ((directoryServer.alertHandlers == null) || |
| | | directoryServer.alertHandlers.isEmpty()) |
| | | { |
| | |
| | | public static ConcurrentHashMap<String,PasswordStorageScheme> |
| | | getPasswordStorageSchemes() |
| | | { |
| | | |
| | | return directoryServer.passwordStorageSchemes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static PasswordStorageScheme getPasswordStorageScheme(String lowerName) |
| | | { |
| | | |
| | | return directoryServer.passwordStorageSchemes.get(lowerName); |
| | | } |
| | | |
| | |
| | | public static ConcurrentHashMap<String,PasswordStorageScheme> |
| | | getAuthPasswordStorageSchemes() |
| | | { |
| | | |
| | | return directoryServer.authPasswordStorageSchemes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static PasswordStorageScheme getAuthPasswordStorageScheme(String name) |
| | | { |
| | | |
| | | return directoryServer.authPasswordStorageSchemes.get(name); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void registerPasswordStorageScheme(PasswordStorageScheme scheme) |
| | | { |
| | | |
| | | String name = toLowerCase(scheme.getStorageSchemeName()); |
| | | directoryServer.passwordStorageSchemes.put(name, scheme); |
| | | |
| | |
| | | */ |
| | | public static void deregisterPasswordStorageScheme(String lowerName) |
| | | { |
| | | |
| | | PasswordStorageScheme scheme = |
| | | directoryServer.passwordStorageSchemes.remove(lowerName); |
| | | |
| | |
| | | */ |
| | | public static ConcurrentHashMap<DN,PasswordValidator> getPasswordValidators() |
| | | { |
| | | |
| | | return directoryServer.passwordValidators; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static PasswordValidator getPasswordValidator(DN configEntryDN) |
| | | { |
| | | |
| | | return directoryServer.passwordValidators.get(configEntryDN); |
| | | } |
| | | |
| | |
| | | public static void registerPasswordValidator(DN configEntryDN, |
| | | PasswordValidator validator) |
| | | { |
| | | |
| | | directoryServer.passwordValidators.put(configEntryDN, validator); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void deregisterPasswordValidator(DN configEntryDN) |
| | | { |
| | | |
| | | directoryServer.passwordValidators.remove(configEntryDN); |
| | | } |
| | | |
| | |
| | | public static ConcurrentHashMap<DN,AccountStatusNotificationHandler> |
| | | getAccountStatusNotificationHandlers() |
| | | { |
| | | |
| | | return directoryServer.accountStatusNotificationHandlers; |
| | | } |
| | | |
| | |
| | | public static AccountStatusNotificationHandler |
| | | getAccountStatusNotificationHandler(DN handlerDN) |
| | | { |
| | | |
| | | return directoryServer.accountStatusNotificationHandlers.get(handlerDN); |
| | | } |
| | | |
| | |
| | | public static void registerAccountStatusNotificationHandler(DN handlerDN, |
| | | AccountStatusNotificationHandler handler) |
| | | { |
| | | |
| | | directoryServer.accountStatusNotificationHandlers.put(handlerDN, handler); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void deregisterAccountStatusNotificationHandler(DN handlerDN) |
| | | { |
| | | |
| | | directoryServer.accountStatusNotificationHandlers.remove(handlerDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static ConcurrentHashMap<DN,PasswordGenerator> getPasswordGenerators() |
| | | { |
| | | |
| | | return directoryServer.passwordGenerators; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static PasswordGenerator getPasswordGenerator(DN configEntryDN) |
| | | { |
| | | |
| | | return directoryServer.passwordGenerators.get(configEntryDN); |
| | | } |
| | | |
| | |
| | | public static void registerPasswordGenerator(DN configEntryDN, |
| | | PasswordGenerator generator) |
| | | { |
| | | |
| | | directoryServer.passwordGenerators.put(configEntryDN, generator); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void deregisterPasswordGenerator(DN configEntryDN) |
| | | { |
| | | |
| | | directoryServer.passwordGenerators.remove(configEntryDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static PasswordPolicy[] getPasswordPolicies() |
| | | { |
| | | |
| | | // The password policy objects are returned in an array to prevent the |
| | | // caller from modifying the map structure. |
| | | PasswordPolicyConfig[] values = directoryServer.passwordPolicies.values() |
| | |
| | | */ |
| | | public static DN getDefaultPasswordPolicyDN() |
| | | { |
| | | |
| | | return directoryServer.defaultPasswordPolicyDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void setDefaultPasswordPolicyDN(DN defaultPasswordPolicyDN) |
| | | { |
| | | |
| | | directoryServer.defaultPasswordPolicyDN = defaultPasswordPolicyDN; |
| | | directoryServer.defaultPasswordPolicyConfig = null; |
| | | } |
| | |
| | | */ |
| | | public static ConcurrentHashMap<String,MonitorProvider> getMonitorProviders() |
| | | { |
| | | |
| | | return directoryServer.monitorProviders; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static MonitorProvider getMonitorProvider(String lowerName) |
| | | { |
| | | |
| | | return directoryServer.monitorProviders.get(lowerName); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void registerMonitorProvider(MonitorProvider monitorProvider) |
| | | { |
| | | |
| | | String lowerName = toLowerCase(monitorProvider.getMonitorInstanceName()); |
| | | directoryServer.monitorProviders.put(lowerName, monitorProvider); |
| | | |
| | |
| | | */ |
| | | public static void deregisterMonitorProvider(String lowerName) |
| | | { |
| | | |
| | | MonitorProvider provider = |
| | | directoryServer.monitorProviders.remove(toLowerCase(lowerName)); |
| | | |
| | |
| | | */ |
| | | public static EntryCache getEntryCache() |
| | | { |
| | | |
| | | return directoryServer.entryCache; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void setEntryCache(EntryCache entryCache) |
| | | { |
| | | |
| | | synchronized (directoryServer) |
| | | { |
| | | directoryServer.entryCache = entryCache; |
| | |
| | | */ |
| | | public static Map<DN,KeyManagerProvider> getKeyManagerProviders() |
| | | { |
| | | |
| | | return directoryServer.keyManagerProviders; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static KeyManagerProvider getKeyManagerProvider(DN providerDN) |
| | | { |
| | | |
| | | return directoryServer.keyManagerProviders.get(providerDN); |
| | | } |
| | | |
| | |
| | | public static void registerKeyManagerProvider(DN providerDN, |
| | | KeyManagerProvider provider) |
| | | { |
| | | |
| | | directoryServer.keyManagerProviders.put(providerDN, provider); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void deregisterKeyManagerProvider(DN providerDN) |
| | | { |
| | | |
| | | directoryServer.keyManagerProviders.remove(providerDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static Map<DN,TrustManagerProvider> getTrustManagerProviders() |
| | | { |
| | | |
| | | return directoryServer.trustManagerProviders; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static TrustManagerProvider getTrustManagerProvider(DN providerDN) |
| | | { |
| | | |
| | | return directoryServer.trustManagerProviders.get(providerDN); |
| | | } |
| | | |
| | |
| | | public static void registerTrustManagerProvider(DN providerDN, |
| | | TrustManagerProvider provider) |
| | | { |
| | | |
| | | directoryServer.trustManagerProviders.put(providerDN, provider); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void deregisterTrustManagerProvider(DN providerDN) |
| | | { |
| | | |
| | | directoryServer.trustManagerProviders.remove(providerDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static Map<DN,CertificateMapper> getCertificateMappers() |
| | | { |
| | | |
| | | return directoryServer.certificateMappers; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static CertificateMapper getCertificateMapper(DN mapperDN) |
| | | { |
| | | |
| | | return directoryServer.certificateMappers.get(mapperDN); |
| | | } |
| | | |
| | |
| | | public static void registerCertificateMapper(DN mapperDN, |
| | | CertificateMapper mapper) |
| | | { |
| | | |
| | | directoryServer.certificateMappers.put(mapperDN, mapper); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void deregisterCertificateMapper(DN mapperDN) |
| | | { |
| | | |
| | | directoryServer.certificateMappers.remove(mapperDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static Set<Privilege> getRootPrivileges() |
| | | { |
| | | |
| | | return directoryServer.rootDNConfigManager.getRootPrivileges(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static CopyOnWriteArraySet<DN> getRootDNs() |
| | | { |
| | | |
| | | return directoryServer.rootDNs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static boolean isRootDN(DN userDN) |
| | | { |
| | | |
| | | return directoryServer.rootDNs.contains(userDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void registerRootDN(DN rootDN) |
| | | { |
| | | |
| | | directoryServer.rootDNs.add(rootDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void deregisterRootDN(DN rootDN) |
| | | { |
| | | |
| | | directoryServer.rootDNs.remove(rootDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static ConcurrentHashMap<DN,DN> getAlternateRootBindDNs() |
| | | { |
| | | |
| | | return directoryServer.alternateRootBindDNs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static DN getActualRootBindDN(DN alternateRootBindDN) |
| | | { |
| | | |
| | | return directoryServer.alternateRootBindDNs.get(alternateRootBindDN); |
| | | } |
| | | |
| | |
| | | DN alternateRootBindDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | DN existingRootEntryDN = |
| | | directoryServer.alternateRootBindDNs.putIfAbsent(alternateRootBindDN, |
| | | actualRootEntryDN); |
| | |
| | | */ |
| | | public static DN deregisterAlternateRootBindDN(DN alternateRootBindDN) |
| | | { |
| | | |
| | | return directoryServer.alternateRootBindDNs.remove(alternateRootBindDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static ResultCode getServerErrorResultCode() |
| | | { |
| | | |
| | | return directoryServer.serverErrorResultCode; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void setServerErrorResultCode(ResultCode serverErrorResultCode) |
| | | { |
| | | |
| | | directoryServer.serverErrorResultCode = serverErrorResultCode; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static boolean addMissingRDNAttributes() |
| | | { |
| | | |
| | | return directoryServer.addMissingRDNAttributes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void setAddMissingRDNAttributes(boolean addMissingRDNAttributes) |
| | | { |
| | | |
| | | directoryServer.addMissingRDNAttributes = addMissingRDNAttributes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static boolean allowAttributeNameExceptions() |
| | | { |
| | | |
| | | return directoryServer.allowAttributeNameExceptions; |
| | | } |
| | | |
| | |
| | | public static void setAllowAttributeNameExceptions( |
| | | boolean allowAttributeNameExceptions) |
| | | { |
| | | |
| | | directoryServer.allowAttributeNameExceptions = allowAttributeNameExceptions; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static boolean checkSchema() |
| | | { |
| | | |
| | | return directoryServer.checkSchema; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void setCheckSchema(boolean checkSchema) |
| | | { |
| | | |
| | | directoryServer.checkSchema = checkSchema; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static AcceptRejectWarn getSingleStructuralObjectClassPolicy() |
| | | { |
| | | |
| | | return directoryServer.singleStructuralClassPolicy; |
| | | } |
| | | |
| | |
| | | public static void setSingleStructuralObjectClassPolicy( |
| | | AcceptRejectWarn singleStructuralClassPolicy) |
| | | { |
| | | |
| | | directoryServer.singleStructuralClassPolicy = singleStructuralClassPolicy; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static AcceptRejectWarn getSyntaxEnforcementPolicy() |
| | | { |
| | | |
| | | return directoryServer.syntaxEnforcementPolicy; |
| | | } |
| | | |
| | |
| | | public static void setSyntaxEnforcementPolicy( |
| | | AcceptRejectWarn syntaxEnforcementPolicy) |
| | | { |
| | | |
| | | directoryServer.syntaxEnforcementPolicy = syntaxEnforcementPolicy; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static boolean notifyAbandonedOperations() |
| | | { |
| | | |
| | | return directoryServer.notifyAbandonedOperations; |
| | | } |
| | | |
| | |
| | | public static void setNotifyAbandonedOperations( |
| | | boolean notifyAbandonedOperations) |
| | | { |
| | | |
| | | directoryServer.notifyAbandonedOperations = notifyAbandonedOperations; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static Map<String,Backend> getBackends() |
| | | { |
| | | |
| | | return directoryServer.backends; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static Backend getBackend(String backendID) |
| | | { |
| | | |
| | | return directoryServer.backends.get(backendID); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static boolean hasBackend(String backendID) |
| | | { |
| | | |
| | | return directoryServer.backends.containsKey(backendID); |
| | | } |
| | | |
| | |
| | | public static void registerBackend(Backend backend) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | ensureNotNull(backend); |
| | | |
| | | String backendID = backend.getBackendID(); |
| | |
| | | */ |
| | | public static void deregisterBackend(Backend backend) |
| | | { |
| | | |
| | | ensureNotNull(backend); |
| | | |
| | | synchronized (directoryServer) |
| | |
| | | */ |
| | | public static Map<DN,Backend> getBaseDNs() |
| | | { |
| | | |
| | | return directoryServer.baseDNs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static Backend getBackendWithBaseDN(DN baseDN) |
| | | { |
| | | |
| | | return directoryServer.baseDNs.get(baseDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static Backend getBackend(DN entryDN) |
| | | { |
| | | |
| | | if (entryDN.isNullDN()) |
| | | { |
| | | return directoryServer.rootDSEBackend; |
| | |
| | | boolean isPrivate, boolean testOnly) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | ensureNotNull(baseDN, backend); |
| | | |
| | | synchronized (directoryServer) |
| | |
| | | public static void deregisterBaseDN(DN baseDN, boolean testOnly) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | ensureNotNull(baseDN); |
| | | |
| | | synchronized (directoryServer) |
| | |
| | | */ |
| | | public static Map<DN,Backend> getPublicNamingContexts() |
| | | { |
| | | |
| | | return directoryServer.publicNamingContexts; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static Map<DN,Backend> getPrivateNamingContexts() |
| | | { |
| | | |
| | | return directoryServer.privateNamingContexts; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static boolean isNamingContext(DN dn) |
| | | { |
| | | |
| | | return (directoryServer.publicNamingContexts.containsKey(dn) || |
| | | directoryServer.privateNamingContexts.containsKey(dn)); |
| | | } |
| | |
| | | */ |
| | | public static Entry getRootDSE() |
| | | { |
| | | |
| | | return directoryServer.rootDSEBackend.getRootDSE(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static RootDSEBackend getRootDSEBackend() |
| | | { |
| | | |
| | | return directoryServer.rootDSEBackend; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static DN getSchemaDN() |
| | | { |
| | | |
| | | return directoryServer.schemaDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void setSchemaDN(DN schemaDN) |
| | | { |
| | | |
| | | directoryServer.schemaDN = schemaDN; |
| | | } |
| | | |
| | |
| | | public static Entry getEntry(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // If the entry is the root DSE, then get and return that. |
| | | if (entryDN.isNullDN()) |
| | | { |
| | |
| | | public static boolean entryExists(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // If the entry is the root DSE, then it will always exist. |
| | | if (entryDN.isNullDN()) |
| | | { |
| | |
| | | */ |
| | | public static TreeSet<String> getSupportedControls() |
| | | { |
| | | |
| | | return directoryServer.supportedControls; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static boolean isSupportedControl(String controlOID) |
| | | { |
| | | |
| | | return directoryServer.supportedControls.contains(controlOID); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void registerSupportedControl(String controlOID) |
| | | { |
| | | |
| | | synchronized (directoryServer.supportedControls) |
| | | { |
| | | directoryServer.supportedControls.add(controlOID); |
| | |
| | | */ |
| | | public static void deregisterSupportedControl(String controlOID) |
| | | { |
| | | |
| | | synchronized (directoryServer.supportedControls) |
| | | { |
| | | directoryServer.supportedControls.remove(controlOID); |
| | |
| | | */ |
| | | public static TreeSet<String> getSupportedFeatures() |
| | | { |
| | | |
| | | return directoryServer.supportedFeatures; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static boolean isSupportedFeature(String featureOID) |
| | | { |
| | | |
| | | return directoryServer.supportedFeatures.contains(featureOID); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void registerSupportedFeature(String featureOID) |
| | | { |
| | | |
| | | synchronized (directoryServer.supportedFeatures) |
| | | { |
| | | directoryServer.supportedFeatures.add(featureOID); |
| | |
| | | */ |
| | | public static void deregisterSupportedFeature(String featureOID) |
| | | { |
| | | |
| | | synchronized (directoryServer.supportedFeatures) |
| | | { |
| | | directoryServer.supportedFeatures.remove(featureOID); |
| | |
| | | public static ConcurrentHashMap<String,ExtendedOperationHandler> |
| | | getSupportedExtensions() |
| | | { |
| | | |
| | | return directoryServer.extendedOperationHandlers; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static ExtendedOperationHandler getExtendedOperationHandler(String oid) |
| | | { |
| | | |
| | | return directoryServer.extendedOperationHandlers.get(oid); |
| | | } |
| | | |
| | |
| | | public static void registerSupportedExtension(String oid, |
| | | ExtendedOperationHandler handler) |
| | | { |
| | | |
| | | directoryServer.extendedOperationHandlers.put(toLowerCase(oid), handler); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void deregisterSupportedExtension(String oid) |
| | | { |
| | | |
| | | directoryServer.extendedOperationHandlers.remove(toLowerCase(oid)); |
| | | } |
| | | |
| | |
| | | public static ConcurrentHashMap<String,SASLMechanismHandler> |
| | | getSupportedSASLMechanisms() |
| | | { |
| | | |
| | | return directoryServer.saslMechanismHandlers; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static SASLMechanismHandler getSASLMechanismHandler(String name) |
| | | { |
| | | |
| | | return directoryServer.saslMechanismHandlers.get(name); |
| | | } |
| | | |
| | |
| | | public static void registerSASLMechanismHandler(String name, |
| | | SASLMechanismHandler handler) |
| | | { |
| | | |
| | | // FIXME -- Should we force this name to be lowercase? If so, then will |
| | | // that cause the lower name to be used in the root DSE? |
| | | directoryServer.saslMechanismHandlers.put(name, handler); |
| | |
| | | */ |
| | | public static void deregisterSASLMechanismHandler(String name) |
| | | { |
| | | |
| | | // FIXME -- Should we force this name to be lowercase? |
| | | directoryServer.saslMechanismHandlers.remove(name); |
| | | } |
| | |
| | | */ |
| | | public static ConcurrentHashMap<DN,IdentityMapper> getIdentityMappers() |
| | | { |
| | | |
| | | return directoryServer.identityMappers; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static IdentityMapper getIdentityMapper(DN configEntryDN) |
| | | { |
| | | |
| | | return directoryServer.identityMappers.get(configEntryDN); |
| | | } |
| | | |
| | |
| | | public static void registerIdentityMapper(DN configEntryDN, |
| | | IdentityMapper identityMapper) |
| | | { |
| | | |
| | | directoryServer.identityMappers.put(configEntryDN, identityMapper); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void deregisterIdentityMapper(DN configEntryDN) |
| | | { |
| | | |
| | | directoryServer.identityMappers.remove(configEntryDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static DN getProxiedAuthorizationIdentityMapperDN() |
| | | { |
| | | |
| | | return directoryServer.proxiedAuthorizationIdentityMapperDN; |
| | | } |
| | | |
| | |
| | | public static void setProxiedAuthorizationIdentityMapperDN( |
| | | DN proxiedAuthorizationIdentityMapperDN) |
| | | { |
| | | |
| | | directoryServer.proxiedAuthorizationIdentityMapperDN = |
| | | proxiedAuthorizationIdentityMapperDN; |
| | | } |
| | |
| | | */ |
| | | public static IdentityMapper getProxiedAuthorizationIdentityMapper() |
| | | { |
| | | |
| | | if (directoryServer.proxiedAuthorizationIdentityMapperDN == null) |
| | | { |
| | | return null; |
| | |
| | | */ |
| | | public static CopyOnWriteArrayList<ConnectionHandler> getConnectionHandlers() |
| | | { |
| | | |
| | | return directoryServer.connectionHandlers; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void registerConnectionHandler(ConnectionHandler handler) |
| | | { |
| | | |
| | | synchronized (directoryServer.connectionHandlers) |
| | | { |
| | | directoryServer.connectionHandlers.add(handler); |
| | |
| | | */ |
| | | public static void deregisterConnectionHandler(ConnectionHandler handler) |
| | | { |
| | | |
| | | synchronized (directoryServer.connectionHandlers) |
| | | { |
| | | directoryServer.connectionHandlers.remove(handler); |
| | |
| | | private void initializeWorkQueue() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | DN configEntryDN; |
| | | try |
| | | { |
| | |
| | | */ |
| | | public static WorkQueue getWorkQueue() |
| | | { |
| | | |
| | | return directoryServer.workQueue; |
| | | } |
| | | |
| | |
| | | public static void enqueueRequest(Operation operation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // See if a bind is already in progress on the associated connection. If so |
| | | // then reject the operation. |
| | | ClientConnection clientConnection = operation.getClientConnection(); |
| | |
| | | public static CopyOnWriteArrayList<ChangeNotificationListener> |
| | | getChangeNotificationListeners() |
| | | { |
| | | |
| | | return directoryServer.changeNotificationListeners; |
| | | } |
| | | |
| | |
| | | public static void registerChangeNotificationListener( |
| | | ChangeNotificationListener changeListener) |
| | | { |
| | | |
| | | directoryServer.changeNotificationListeners.add(changeListener); |
| | | } |
| | | |
| | |
| | | public static void deregisterChangeNotificationListener( |
| | | ChangeNotificationListener changeListener) |
| | | { |
| | | |
| | | directoryServer.changeNotificationListeners.remove(changeListener); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static CopyOnWriteArrayList<PersistentSearch> getPersistentSearches() |
| | | { |
| | | |
| | | return directoryServer.persistentSearches; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void registerPersistentSearch(PersistentSearch persistentSearch) |
| | | { |
| | | |
| | | directoryServer.persistentSearches.add(persistentSearch); |
| | | persistentSearch.getSearchOperation().getClientConnection(). |
| | | registerPersistentSearch(persistentSearch); |
| | |
| | | public static void deregisterPersistentSearch(PersistentSearch |
| | | persistentSearch) |
| | | { |
| | | |
| | | directoryServer.persistentSearches.remove(persistentSearch); |
| | | persistentSearch.getSearchOperation().getClientConnection(). |
| | | deregisterPersistentSearch(persistentSearch); |
| | |
| | | public static CopyOnWriteArrayList<SynchronizationProvider> |
| | | getSynchronizationProviders() |
| | | { |
| | | |
| | | return directoryServer.synchronizationProviders; |
| | | } |
| | | |
| | |
| | | public static void registerSynchronizationProvider(SynchronizationProvider |
| | | provider) |
| | | { |
| | | |
| | | directoryServer.synchronizationProviders.add(provider); |
| | | } |
| | | |
| | |
| | | public static void deregisterSynchronizationProvider(SynchronizationProvider |
| | | provider) |
| | | { |
| | | |
| | | directoryServer.synchronizationProviders.remove(provider); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void registerShutdownListener(ServerShutdownListener listener) |
| | | { |
| | | |
| | | directoryServer.shutdownListeners.add(listener); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void deregisterShutdownListener(ServerShutdownListener listener) |
| | | { |
| | | |
| | | directoryServer.shutdownListeners.remove(listener); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void shutDown(String className, String reason) |
| | | { |
| | | |
| | | synchronized (directoryServer) |
| | | { |
| | | if (directoryServer.shuttingDown) |
| | |
| | | */ |
| | | public static void restart(String className, String reason) |
| | | { |
| | | |
| | | try |
| | | { |
| | | String configClass = directoryServer.configClass; |
| | |
| | | */ |
| | | public static long getMaxAllowedConnections() |
| | | { |
| | | |
| | | return directoryServer.maxAllowedConnections; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void setMaxAllowedConnections(long maxAllowedConnections) |
| | | { |
| | | |
| | | if (maxAllowedConnections > 0) |
| | | { |
| | | directoryServer.maxAllowedConnections = maxAllowedConnections; |
| | |
| | | */ |
| | | public static long newConnectionAccepted(ClientConnection clientConnection) |
| | | { |
| | | |
| | | synchronized (directoryServer.establishedConnections) |
| | | { |
| | | if ((directoryServer.maxAllowedConnections > 0) && |
| | |
| | | */ |
| | | public static void connectionClosed(ClientConnection clientConnection) |
| | | { |
| | | |
| | | synchronized (directoryServer.establishedConnections) |
| | | { |
| | | directoryServer.establishedConnections.remove(clientConnection); |
| | |
| | | */ |
| | | public static long getCurrentConnections() |
| | | { |
| | | |
| | | return directoryServer.currentConnections; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static long getMaxConnections() |
| | | { |
| | | |
| | | return directoryServer.maxConnections; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static long getTotalConnections() |
| | | { |
| | | |
| | | return directoryServer.totalConnections; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static int getSizeLimit() |
| | | { |
| | | |
| | | return directoryServer.sizeLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void setSizeLimit(int sizeLimit) |
| | | { |
| | | |
| | | directoryServer.sizeLimit = sizeLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static int getLookthroughLimit() |
| | | { |
| | | |
| | | return directoryServer.lookthroughLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void setLookthroughLimit(int lookthroughLimit) |
| | | { |
| | | |
| | | directoryServer.lookthroughLimit = lookthroughLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static int getTimeLimit() |
| | | { |
| | | |
| | | return directoryServer.timeLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void setTimeLimit(int timeLimit) |
| | | { |
| | | |
| | | directoryServer.timeLimit = timeLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static WritabilityMode getWritabilityMode() |
| | | { |
| | | |
| | | return directoryServer.writabilityMode; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static void setWritabilityMode(WritabilityMode writabilityMode) |
| | | { |
| | | |
| | | directoryServer.writabilityMode = writabilityMode; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static boolean bindWithDNRequiresPassword() |
| | | { |
| | | |
| | | return directoryServer.bindWithDNRequiresPassword; |
| | | } |
| | | |
| | |
| | | public static void setBindWithDNRequiresPassword(boolean |
| | | bindWithDNRequiresPassword) |
| | | { |
| | | |
| | | directoryServer.bindWithDNRequiresPassword = bindWithDNRequiresPassword; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static boolean rejectUnauthenticatedRequests() |
| | | { |
| | | |
| | | return directoryServer.rejectUnauthenticatedRequests; |
| | | } |
| | | |
| | |
| | | public static void setRejectUnauthenticatedRequests(boolean |
| | | rejectUnauthenticatedRequests) |
| | | { |
| | | |
| | | directoryServer.rejectUnauthenticatedRequests = |
| | | rejectUnauthenticatedRequests; |
| | | } |
| | |
| | | */ |
| | | public DN getComponentEntryDN() |
| | | { |
| | | |
| | | try |
| | | { |
| | | if (configHandler == null) |
| | |
| | | */ |
| | | public String getClassName() |
| | | { |
| | | |
| | | return CLASS_NAME; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void uncaughtException(Thread thread, Throwable exception) |
| | | { |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, exception); |
| | |
| | | */ |
| | | public EntryCacheConfigManager() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | public void initializeEntryCache() |
| | | throws InitializationException |
| | | { |
| | | |
| | | |
| | | // First, install a default entry cache so that there will be one even if |
| | | // we encounter a problem later. |
| | | try |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // NYI |
| | | |
| | | |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // NYI |
| | | |
| | | |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // NYI |
| | | |
| | | |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | */ |
| | | public final String getRequestOID() |
| | | { |
| | | |
| | | return requestOID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setRequestOID(String requestOID) |
| | | { |
| | | |
| | | this.requestOID = requestOID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final ASN1OctetString getRequestValue() |
| | | { |
| | | |
| | | return requestValue; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setRequestValue(ASN1OctetString requestValue) |
| | | { |
| | | |
| | | this.requestValue = requestValue; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final String getResponseOID() |
| | | { |
| | | |
| | | return responseOID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setResponseOID(String responseOID) |
| | | { |
| | | |
| | | this.responseOID = responseOID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final ASN1OctetString getResponseValue() |
| | | { |
| | | |
| | | return responseValue; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setResponseValue(ASN1OctetString responseValue) |
| | | { |
| | | |
| | | this.responseValue = responseValue; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStartTime() |
| | | { |
| | | |
| | | return processingStartTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStopTime() |
| | | { |
| | | |
| | | return processingStopTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingTime() |
| | | { |
| | | |
| | | return (processingStopTime - processingStartTime); |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final List<Control> getResponseControls() |
| | | { |
| | | |
| | | return responseControls; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final void run() |
| | | { |
| | | |
| | | setResultCode(ResultCode.UNDEFINED); |
| | | |
| | | |
| | |
| | | */ |
| | | public final void sendExtendedResponse() |
| | | { |
| | | |
| | | if (! responseSent) |
| | | { |
| | | responseSent = true; |
| | |
| | | */ |
| | | public final void setResponseSent() |
| | | { |
| | | |
| | | this.responseSent = true; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final CancelResult cancel(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | |
| | | CancelResult cancelResult = getCancelResult(); |
| | |
| | | @Override() |
| | | public final CancelRequest getCancelRequest() |
| | | { |
| | | |
| | | return cancelRequest; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | boolean setCancelRequest(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("ExtendedOperation(connID="); |
| | | buffer.append(clientConnection.getConnectionID()); |
| | | buffer.append(", opID="); |
| | |
| | | */ |
| | | public ExtendedOperationConfigManager() |
| | | { |
| | | |
| | | configHandler = DirectoryServer.getConfigHandler(); |
| | | handlers = new ConcurrentHashMap<DN,ExtendedOperationHandler>(); |
| | | } |
| | |
| | | public void initializeExtendedOperationHandlers() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the configuration base entry. |
| | | ConfigEntry baseEntry; |
| | | try |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for an extended |
| | | // operation handler. |
| | | if (! configEntry.hasObjectClass(OC_EXTENDED_OPERATION_HANDLER)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that no entry already exists with the specified DN. |
| | | DN configEntryDN = configEntry.getDN(); |
| | | if (handlers.containsKey(configEntryDN)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | */ |
| | | public GroupManager() |
| | | { |
| | | |
| | | configHandler = DirectoryServer.getConfigHandler(); |
| | | groupImplementations = new ConcurrentHashMap<DN,Group>(); |
| | | groupInstances = new ConcurrentHashMap<DN,Group>(); |
| | |
| | | public void initializeGroupImplementations() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the configuration base entry. |
| | | ConfigEntry baseEntry; |
| | | try |
| | |
| | | */ |
| | | public void finalizeGroupManager() |
| | | { |
| | | |
| | | deregisterAllGroups(); |
| | | |
| | | for (Group groupImplementation : groupImplementations.values()) |
| | |
| | | */ |
| | | public Iterable<Group> getGroupImplementations() |
| | | { |
| | | |
| | | return groupImplementations.values(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public Iterable<Group> getGroupInstances() |
| | | { |
| | | |
| | | return groupInstances.values(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public Group getGroupInstance(DN entryDN) |
| | | { |
| | | |
| | | Group group = groupInstances.get(entryDN); |
| | | if (group == null) |
| | | { |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for an extended |
| | | // operation handler. |
| | | if (! configEntry.hasObjectClass(OC_GROUP_IMPLEMENTATION)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that no entry already exists with the specified DN. |
| | | DN configEntryDN = configEntry.getDN(); |
| | | if (groupImplementations.containsKey(configEntryDN)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | */ |
| | | public void performBackendInitializationProcessing(Backend backend) |
| | | { |
| | | |
| | | InternalClientConnection conn = |
| | | InternalClientConnection.getRootConnection(); |
| | | |
| | |
| | | */ |
| | | public void performBackendFinalizationProcessing(Backend backend) |
| | | { |
| | | |
| | | Iterator<Map.Entry<DN,Group>> iterator = |
| | | groupInstances.entrySet().iterator(); |
| | | while (iterator.hasNext()) |
| | |
| | | public void handleAddOperation(PostResponseAddOperation addOperation, |
| | | Entry entry) |
| | | { |
| | | |
| | | List<Control> requestControls = addOperation.getRequestControls(); |
| | | if (requestControls != null) |
| | | { |
| | |
| | | public void handleDeleteOperation(PostResponseDeleteOperation deleteOperation, |
| | | Entry entry) |
| | | { |
| | | |
| | | List<Control> requestControls = deleteOperation.getRequestControls(); |
| | | if (requestControls != null) |
| | | { |
| | |
| | | public void handleModifyOperation(PostResponseModifyOperation modifyOperation, |
| | | Entry oldEntry, Entry newEntry) |
| | | { |
| | | |
| | | List<Control> requestControls = modifyOperation.getRequestControls(); |
| | | if (requestControls != null) |
| | | { |
| | |
| | | PostResponseModifyDNOperation modifyDNOperation, |
| | | Entry oldEntry, Entry newEntry) |
| | | { |
| | | |
| | | List<Control> requestControls = modifyDNOperation.getRequestControls(); |
| | | if (requestControls != null) |
| | | { |
| | |
| | | */ |
| | | private void createAndRegisterGroup(Entry entry) |
| | | { |
| | | |
| | | for (Group groupImplementation : groupImplementations.values()) |
| | | { |
| | | try |
| | |
| | | */ |
| | | public IdentityMapperConfigManager() |
| | | { |
| | | |
| | | configHandler = DirectoryServer.getConfigHandler(); |
| | | identityMappers = new ConcurrentHashMap<DN,IdentityMapper>(); |
| | | } |
| | |
| | | public void initializeIdentityMappers() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the configuration base entry. |
| | | ConfigEntry baseEntry; |
| | | try |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for an identity |
| | | // mapper. |
| | | if (! configEntry.hasObjectClass(OC_IDENTITY_MAPPER)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that no entry already exists with the specified DN. |
| | | DN configEntryDN = configEntry.getDN(); |
| | | if (identityMappers.containsKey(configEntryDN)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | */ |
| | | public KeyManagerProviderConfigManager() |
| | | { |
| | | |
| | | configHandler = DirectoryServer.getConfigHandler(); |
| | | providers = new ConcurrentHashMap<DN,KeyManagerProvider>(); |
| | | } |
| | |
| | | public void initializeKeyManagerProviders() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the configuration base entry. |
| | | ConfigEntry baseEntry; |
| | | try |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for a key manager |
| | | // provider. |
| | | if (! configEntry.hasObjectClass(OC_KEY_MANAGER_PROVIDER)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that no entry already exists with the specified DN. |
| | | DN configEntryDN = configEntry.getDN(); |
| | | if (providers.containsKey(configEntryDN)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public static boolean acquireSharedLock(String lockFile, |
| | | StringBuilder failureReason) |
| | | { |
| | | |
| | | mapLock.lock(); |
| | | |
| | | try |
| | |
| | | public static boolean acquireExclusiveLock(String lockFile, |
| | | StringBuilder failureReason) |
| | | { |
| | | |
| | | mapLock.lock(); |
| | | |
| | | try |
| | |
| | | public static boolean releaseLock(String lockFile, |
| | | StringBuilder failureReason) |
| | | { |
| | | |
| | | mapLock.lock(); |
| | | |
| | | try |
| | |
| | | */ |
| | | public static String getLockDirectoryPath() |
| | | { |
| | | |
| | | String lockDirectory = System.getProperty(PROPERTY_LOCK_DIRECTORY); |
| | | if ((lockDirectory == null) || (lockDirectory.length() == 0)) |
| | | { |
| | |
| | | */ |
| | | public static String getServerLockFileName() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append(getLockDirectoryPath()); |
| | | buffer.append(File.separator); |
| | |
| | | */ |
| | | public static String getBackendLockFileName(Backend backend) |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append(getLockDirectoryPath()); |
| | | buffer.append(File.separator); |
| | |
| | | */ |
| | | public LoggerConfigManager() |
| | | { |
| | | |
| | | configHandler = DirectoryServer.getConfigHandler(); |
| | | |
| | | activeAccessLoggers = new ConcurrentHashMap<DN,AccessLogger>(); |
| | |
| | | public void initializeLoggers() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the logger configuration base entry. |
| | | ConfigEntry loggerBaseEntry; |
| | | try |
| | |
| | | */ |
| | | public void stopLoggers() |
| | | { |
| | | |
| | | StartupErrorLogger errorLogger = new StartupErrorLogger(); |
| | | errorLogger.initializeErrorLogger(null); |
| | | |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for an access, |
| | | // error, or debug logger. |
| | | boolean isAccessLogger = false; |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that no entry already exists with the specified DN. |
| | | DN configEntryDN = configEntry.getDN(); |
| | | if (activeAccessLoggers.containsKey(configEntryDN) || |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | */ |
| | | public final ByteString getRawEntryDN() |
| | | { |
| | | |
| | | return rawEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setRawEntryDN(ByteString rawEntryDN) |
| | | { |
| | | |
| | | this.rawEntryDN = rawEntryDN; |
| | | |
| | | entryDN = null; |
| | |
| | | */ |
| | | public final DN getEntryDN() |
| | | { |
| | | |
| | | return entryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final ByteString getRawNewRDN() |
| | | { |
| | | |
| | | return rawNewRDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setRawNewRDN(ByteString rawNewRDN) |
| | | { |
| | | |
| | | this.rawNewRDN = rawNewRDN; |
| | | |
| | | newRDN = null; |
| | |
| | | */ |
| | | public final RDN getNewRDN() |
| | | { |
| | | |
| | | return newRDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final boolean deleteOldRDN() |
| | | { |
| | | |
| | | return deleteOldRDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setDeleteOldRDN(boolean deleteOldRDN) |
| | | { |
| | | |
| | | this.deleteOldRDN = deleteOldRDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final ByteString getRawNewSuperior() |
| | | { |
| | | |
| | | return rawNewSuperior; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setRawNewSuperior(ByteString rawNewSuperior) |
| | | { |
| | | |
| | | this.rawNewSuperior = rawNewSuperior; |
| | | |
| | | newSuperior = null; |
| | |
| | | */ |
| | | public final DN getNewSuperior() |
| | | { |
| | | |
| | | return newSuperior; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final List<Modification> getModifications() |
| | | { |
| | | |
| | | return modifications; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void addModification(Modification modification) |
| | | { |
| | | |
| | | modifications.add(modification); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Entry getOriginalEntry() |
| | | { |
| | | |
| | | return currentEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Entry getUpdatedEntry() |
| | | { |
| | | |
| | | return newEntry; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStartTime() |
| | | { |
| | | |
| | | return processingStartTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStopTime() |
| | | { |
| | | |
| | | return processingStopTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingTime() |
| | | { |
| | | |
| | | return (processingStopTime - processingStartTime); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final long getChangeNumber() |
| | | { |
| | | |
| | | return changeNumber; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setChangeNumber(long changeNumber) |
| | | { |
| | | |
| | | this.changeNumber = changeNumber; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final List<Control> getResponseControls() |
| | | { |
| | | |
| | | return responseControls; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final void run() |
| | | { |
| | | |
| | | setResultCode(ResultCode.UNDEFINED); |
| | | |
| | | |
| | |
| | | @Override() |
| | | public final CancelResult cancel(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | |
| | | CancelResult cancelResult = getCancelResult(); |
| | |
| | | @Override() |
| | | public final CancelRequest getCancelRequest() |
| | | { |
| | | |
| | | return cancelRequest; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | boolean setCancelRequest(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("ModifyDNOperation(connID="); |
| | | buffer.append(clientConnection.getConnectionID()); |
| | | buffer.append(", opID="); |
| | |
| | | */ |
| | | public final ByteString getRawEntryDN() |
| | | { |
| | | |
| | | return rawEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setRawEntryDN(ByteString rawEntryDN) |
| | | { |
| | | |
| | | this.rawEntryDN = rawEntryDN; |
| | | |
| | | entryDN = null; |
| | |
| | | */ |
| | | public final DN getEntryDN() |
| | | { |
| | | |
| | | return entryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final List<LDAPModification> getRawModifications() |
| | | { |
| | | |
| | | return rawModifications; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void addRawModification(LDAPModification rawModification) |
| | | { |
| | | |
| | | rawModifications.add(rawModification); |
| | | |
| | | modifications = null; |
| | |
| | | */ |
| | | public final void setRawModifications(List<LDAPModification> rawModifications) |
| | | { |
| | | |
| | | this.rawModifications = rawModifications; |
| | | |
| | | modifications = null; |
| | |
| | | */ |
| | | public final List<Modification> getModifications() |
| | | { |
| | | |
| | | return modifications; |
| | | } |
| | | |
| | |
| | | public final void addModification(Modification modification) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | modifiedEntry.applyModification(modification); |
| | | modifications.add(modification); |
| | | } |
| | |
| | | */ |
| | | public final Entry getCurrentEntry() |
| | | { |
| | | |
| | | return currentEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Entry getModifiedEntry() |
| | | { |
| | | |
| | | return modifiedEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final List<AttributeValue> getCurrentPasswords() |
| | | { |
| | | |
| | | return currentPasswords; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final List<AttributeValue> getNewPasswords() |
| | | { |
| | | |
| | | return newPasswords; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStartTime() |
| | | { |
| | | |
| | | return processingStartTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStopTime() |
| | | { |
| | | |
| | | return processingStopTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingTime() |
| | | { |
| | | |
| | | return (processingStopTime - processingStartTime); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final long getChangeNumber() |
| | | { |
| | | |
| | | return changeNumber; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setChangeNumber(long changeNumber) |
| | | { |
| | | |
| | | this.changeNumber = changeNumber; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final List<Control> getResponseControls() |
| | | { |
| | | |
| | | return responseControls; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final void run() |
| | | { |
| | | |
| | | setResultCode(ResultCode.UNDEFINED); |
| | | |
| | | |
| | |
| | | @Override() |
| | | public final CancelResult cancel(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | |
| | | CancelResult cancelResult = getCancelResult(); |
| | |
| | | @Override() |
| | | public final CancelRequest getCancelRequest() |
| | | { |
| | | |
| | | return cancelRequest; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | boolean setCancelRequest(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("ModifyOperation(connID="); |
| | | buffer.append(clientConnection.getConnectionID()); |
| | | buffer.append(", opID="); |
| | |
| | | */ |
| | | public MonitorConfigManager() |
| | | { |
| | | |
| | | configHandler = DirectoryServer.getConfigHandler(); |
| | | |
| | | monitorProviders = new ConcurrentHashMap<DN,MonitorProvider>(); |
| | |
| | | public void initializeMonitorProviders() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the monitor configuration base entry. |
| | | ConfigEntry monitorBaseEntry; |
| | | try |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for a monitor |
| | | // provider. |
| | | if (! configEntry.hasObjectClass(OC_MONITOR_PROVIDER)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that no entry already exists with the specified DN. |
| | | DN configEntryDN = configEntry.getDN(); |
| | | if (monitorProviders.containsKey(configEntryDN)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | protected Operation(ClientConnection clientConnection, long operationID, |
| | | int messageID, List<Control> requestControls) |
| | | { |
| | | |
| | | this.clientConnection = clientConnection; |
| | | this.operationID = operationID; |
| | | this.messageID = messageID; |
| | |
| | | */ |
| | | public final ClientConnection getClientConnection() |
| | | { |
| | | |
| | | return clientConnection; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final long getConnectionID() |
| | | { |
| | | |
| | | return clientConnection.getConnectionID(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final long getOperationID() |
| | | { |
| | | |
| | | return operationID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final int getMessageID() |
| | | { |
| | | |
| | | return messageID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final List<Control> getRequestControls() |
| | | { |
| | | |
| | | return requestControls; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void addRequestControl(Control control) |
| | | { |
| | | |
| | | requestControls.add(control); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void removeRequestControl(Control control) |
| | | { |
| | | |
| | | requestControls.remove(control); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final ResultCode getResultCode() |
| | | { |
| | | |
| | | return resultCode; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setResultCode(ResultCode resultCode) |
| | | { |
| | | |
| | | this.resultCode = resultCode; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final StringBuilder getErrorMessage() |
| | | { |
| | | |
| | | return errorMessage; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setErrorMessage(StringBuilder errorMessage) |
| | | { |
| | | |
| | | if (errorMessage == null) |
| | | { |
| | | this.errorMessage = new StringBuilder(); |
| | |
| | | */ |
| | | public final void appendErrorMessage(String message) |
| | | { |
| | | |
| | | if (errorMessage == null) |
| | | { |
| | | errorMessage = new StringBuilder(message); |
| | |
| | | */ |
| | | public final StringBuilder getAdditionalLogMessage() |
| | | { |
| | | |
| | | return additionalLogMessage; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setAdditionalLogMessage(StringBuilder additionalLogMessage) |
| | | { |
| | | |
| | | if (additionalLogMessage == null) |
| | | { |
| | | this.additionalLogMessage = new StringBuilder(); |
| | |
| | | */ |
| | | public final void appendAdditionalLogMessage(String message) |
| | | { |
| | | |
| | | if (additionalLogMessage == null) |
| | | { |
| | | additionalLogMessage = new StringBuilder(message); |
| | |
| | | */ |
| | | public final DN getMatchedDN() |
| | | { |
| | | |
| | | return matchedDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setMatchedDN(DN matchedDN) |
| | | { |
| | | |
| | | this.matchedDN = matchedDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final List<String> getReferralURLs() |
| | | { |
| | | |
| | | return referralURLs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setReferralURLs(List<String> referralURLs) |
| | | { |
| | | |
| | | this.referralURLs = referralURLs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setResponseData(DirectoryException directoryException) |
| | | { |
| | | |
| | | this.resultCode = directoryException.getResultCode(); |
| | | this.matchedDN = directoryException.getMatchedDN(); |
| | | this.referralURLs = directoryException.getReferralURLs(); |
| | |
| | | */ |
| | | public final boolean isInternalOperation() |
| | | { |
| | | |
| | | return isInternalOperation; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setInternalOperation(boolean isInternalOperation) |
| | | { |
| | | |
| | | this.isInternalOperation = isInternalOperation; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final boolean isSynchronizationOperation() |
| | | { |
| | | |
| | | return isSynchronizationOperation; |
| | | } |
| | | |
| | |
| | | public final void setSynchronizationOperation( |
| | | boolean isSynchronizationOperation) |
| | | { |
| | | |
| | | this.isSynchronizationOperation = isSynchronizationOperation; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setDontSynchronize(boolean dontSynchronize) |
| | | { |
| | | |
| | | this.dontSynchronizeFlag = dontSynchronize; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Entry getAuthorizationEntry() |
| | | { |
| | | |
| | | return authorizationEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final DN getAuthorizationDN() |
| | | { |
| | | |
| | | if (authorizationEntry == null) |
| | | { |
| | | return DN.nullDN(); |
| | |
| | | */ |
| | | public final Map<String,Object> getAttachments() |
| | | { |
| | | |
| | | return attachments; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Object getAttachment(String name) |
| | | { |
| | | |
| | | return attachments.get(name); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Object removeAttachment(String name) |
| | | { |
| | | |
| | | return attachments.remove(name); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final Object setAttachment(String name, Object value) |
| | | { |
| | | |
| | | return attachments.put(name, value); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void operationCompleted() |
| | | { |
| | | |
| | | |
| | | // Notify the client connection that this operation is complete and that it |
| | | // no longer needs to be retained. |
| | | clientConnection.removeOperationInProgress(messageID); |
| | |
| | | */ |
| | | public final CancelResult getCancelResult() |
| | | { |
| | | |
| | | return cancelResult; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setCancelResult(CancelResult cancelResult) |
| | | { |
| | | |
| | | this.cancelResult = cancelResult; |
| | | } |
| | | |
| | |
| | | */ |
| | | protected final void indicateCancelled(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | setCancelResult(CancelResult.CANCELED); |
| | | |
| | | if (cancelRequest.notifyOriginalRequestor() || |
| | |
| | | */ |
| | | public final String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public PasswordGeneratorConfigManager() |
| | | { |
| | | |
| | | configHandler = DirectoryServer.getConfigHandler(); |
| | | passwordGenerators = new ConcurrentHashMap<DN,PasswordGenerator>(); |
| | | } |
| | |
| | | public void initializePasswordGenerators() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the configuration base entry. |
| | | ConfigEntry baseEntry; |
| | | try |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for a password |
| | | // generator. |
| | | if (! configEntry.hasObjectClass(OC_PASSWORD_GENERATOR)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that no entry already exists with the specified DN. |
| | | DN configEntryDN = configEntry.getDN(); |
| | | if (passwordGenerators.containsKey(configEntryDN)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | */ |
| | | private PasswordPolicy() |
| | | { |
| | | |
| | | configEntryDN = null; |
| | | passwordAttribute = null; |
| | | authPasswordSyntax = false; |
| | |
| | | */ |
| | | public AttributeType getPasswordAttribute() |
| | | { |
| | | |
| | | return passwordAttribute; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean usesAuthPasswordSyntax() |
| | | { |
| | | |
| | | return authPasswordSyntax; |
| | | } |
| | | |
| | |
| | | */ |
| | | public CopyOnWriteArrayList<PasswordStorageScheme> getDefaultStorageSchemes() |
| | | { |
| | | |
| | | return defaultStorageSchemes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isDefaultStorageScheme(String name) |
| | | { |
| | | |
| | | CopyOnWriteArrayList<PasswordStorageScheme> defaultSchemes = |
| | | getDefaultStorageSchemes(); |
| | | if (defaultSchemes == null) |
| | |
| | | */ |
| | | public CopyOnWriteArraySet<String> getDeprecatedStorageSchemes() |
| | | { |
| | | |
| | | return deprecatedStorageSchemes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isDeprecatedStorageScheme(String name) |
| | | { |
| | | |
| | | CopyOnWriteArraySet<String> deprecatedSchemes = |
| | | getDeprecatedStorageSchemes(); |
| | | if (deprecatedSchemes == null) |
| | |
| | | */ |
| | | public ConcurrentHashMap<DN,PasswordValidator> getPasswordValidators() |
| | | { |
| | | |
| | | return passwordValidators; |
| | | } |
| | | |
| | |
| | | public ConcurrentHashMap<DN,AccountStatusNotificationHandler> |
| | | getAccountStatusNotificationHandlers() |
| | | { |
| | | |
| | | return notificationHandlers; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean allowUserPasswordChanges() |
| | | { |
| | | |
| | | return allowUserPasswordChanges; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean requireCurrentPassword() |
| | | { |
| | | |
| | | return requireCurrentPassword; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean forceChangeOnAdd() |
| | | { |
| | | |
| | | return forceChangeOnAdd; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean forceChangeOnReset() |
| | | { |
| | | |
| | | return forceChangeOnReset; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean skipValidationForAdministrators() |
| | | { |
| | | |
| | | return skipValidationForAdministrators; |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN getPasswordGeneratorDN() |
| | | { |
| | | |
| | | return passwordGeneratorDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public PasswordGenerator getPasswordGenerator() |
| | | { |
| | | |
| | | return passwordGenerator; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean requireSecureAuthentication() |
| | | { |
| | | |
| | | return requireSecureAuthentication; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean requireSecurePasswordChanges() |
| | | { |
| | | |
| | | return requireSecurePasswordChanges; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean allowMultiplePasswordValues() |
| | | { |
| | | |
| | | return allowMultiplePasswordValues; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean allowPreEncodedPasswords() |
| | | { |
| | | |
| | | return allowPreEncodedPasswords; |
| | | } |
| | | |
| | |
| | | */ |
| | | public int getMinimumPasswordAge() |
| | | { |
| | | |
| | | if (minimumPasswordAge <= 0) |
| | | { |
| | | return 0; |
| | |
| | | */ |
| | | public int getMaximumPasswordAge() |
| | | { |
| | | |
| | | if (maximumPasswordAge < 0) |
| | | { |
| | | return 0; |
| | |
| | | */ |
| | | public int getMaximumPasswordResetAge() |
| | | { |
| | | |
| | | if (maximumPasswordResetAge < 0) |
| | | { |
| | | return 0; |
| | |
| | | */ |
| | | public int getWarningInterval() |
| | | { |
| | | |
| | | if (warningInterval < 0) |
| | | { |
| | | return 0; |
| | |
| | | */ |
| | | public boolean expirePasswordsWithoutWarning() |
| | | { |
| | | |
| | | return expirePasswordsWithoutWarning; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean allowExpiredPasswordChanges() |
| | | { |
| | | |
| | | return allowExpiredPasswordChanges; |
| | | } |
| | | |
| | |
| | | */ |
| | | public int getGraceLoginCount() |
| | | { |
| | | |
| | | if (graceLoginCount < 0) |
| | | { |
| | | return 0; |
| | |
| | | */ |
| | | public int getLockoutFailureCount() |
| | | { |
| | | |
| | | if (lockoutFailureCount < 0) |
| | | { |
| | | return 0; |
| | |
| | | */ |
| | | public int getLockoutDuration() |
| | | { |
| | | |
| | | if (lockoutDuration < 0) |
| | | { |
| | | return 0; |
| | |
| | | */ |
| | | public int getLockoutFailureExpirationInterval() |
| | | { |
| | | |
| | | if (lockoutFailureExpirationInterval < 0) |
| | | { |
| | | return 0; |
| | |
| | | */ |
| | | public long getRequireChangeByTime() |
| | | { |
| | | |
| | | if (requireChangeByTime < 0) |
| | | { |
| | | return 0; |
| | |
| | | */ |
| | | public AttributeType getLastLoginTimeAttribute() |
| | | { |
| | | |
| | | return lastLoginTimeAttribute; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getLastLoginTimeFormat() |
| | | { |
| | | |
| | | return lastLoginTimeFormat; |
| | | } |
| | | |
| | |
| | | */ |
| | | public CopyOnWriteArrayList<String> getPreviousLastLoginTimeFormats() |
| | | { |
| | | |
| | | return previousLastLoginTimeFormats; |
| | | } |
| | | |
| | |
| | | */ |
| | | public int getIdleLockoutInterval() |
| | | { |
| | | |
| | | if (idleLockoutInterval < 0) |
| | | { |
| | | return 0; |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | |
| | | buffer.append("Password Attribute: "); |
| | | buffer.append(passwordAttribute.getNameOrOID()); |
| | | buffer.append(EOL); |
| | |
| | | */ |
| | | public PasswordPolicyConfig(PasswordPolicy policy) |
| | | { |
| | | |
| | | this.currentPolicy = policy; |
| | | DirectoryServer.registerConfigurableComponent(this); |
| | | } |
| | |
| | | */ |
| | | public void finalizePasswordPolicyConfig() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return currentPolicy.getConfigEntryDN(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | |
| | | // Create a list of units and values that we can use to represent time |
| | | // periods. |
| | | LinkedHashMap<String,Double> timeUnits = new LinkedHashMap<String,Double>(); |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | assert configEntry.getDN().equals(this.currentPolicy.getConfigEntryDN() ) |
| | | : "Internal Error: mismatch between DN of configuration entry and" |
| | | + "DN of current password policy." ; |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | assert configEntry.getDN().equals(this.currentPolicy.getConfigEntryDN() ) |
| | | : "Internal Error: mismatch between DN of configuration entry and" |
| | | + "DN of current password policy." ; |
| | |
| | | public void initializePasswordPolicies() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the configuration base entry. |
| | | ConfigEntry baseEntry; |
| | | try |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // See if we can create a password policy from the provided configuration |
| | | // entry. If so, then it's acceptable. |
| | | try |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | | |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // We'll allow the policy to be removed as long as it isn't the default. |
| | | // FIXME: something like a referential integrity check is needed to ensure |
| | | // a policy is not removed when referenced by a user entry (either |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | // We'll allow the policy to be removed as long as it isn't the default. |
| | | // FIXME: something like a referential integrity check is needed to ensure |
| | | // a policy is not removed when referenced by a user entry (either |
| | |
| | | boolean debug) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | this.userEntry = userEntry; |
| | | this.updateEntry = updateEntry; |
| | | this.debug = debug; |
| | |
| | | private PasswordPolicy getPasswordPolicyInternal() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // See if the user entry contains the ds-pwp-password-policy-dn attribute to |
| | | // select a custom objectclass (whether real or virtual). |
| | | AttributeType type = |
| | |
| | | */ |
| | | private String getValue(AttributeType attributeType) |
| | | { |
| | | |
| | | List<Attribute> attrList = userEntry.getAttribute(attributeType); |
| | | if ((attrList == null) || attrList.isEmpty()) |
| | | { |
| | |
| | | private long getGeneralizedTime(AttributeType attributeType) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | List<Attribute> attrList = userEntry.getAttribute(attributeType); |
| | | if ((attrList == null) || attrList.isEmpty()) |
| | | { |
| | |
| | | private List<Long> getGeneralizedTimes(AttributeType attributeType) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | ArrayList<Long> timeValues = new ArrayList<Long>(); |
| | | |
| | | List<Attribute> attrList = userEntry.getAttribute(attributeType); |
| | |
| | | private boolean getBoolean(AttributeType attributeType, boolean defaultValue) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | List<Attribute> attrList = userEntry.getAttribute(attributeType); |
| | | if ((attrList == null) || attrList.isEmpty()) |
| | | { |
| | |
| | | */ |
| | | public PasswordPolicy getPolicy() |
| | | { |
| | | |
| | | return passwordPolicy; |
| | | } |
| | | |
| | |
| | | */ |
| | | public LinkedList<Modification> getModifications() |
| | | { |
| | | |
| | | return modifications; |
| | | } |
| | | |
| | |
| | | */ |
| | | public LinkedHashSet<AttributeValue> getPasswordValues() |
| | | { |
| | | |
| | | List<Attribute> attrList = |
| | | userEntry.getAttribute(passwordPolicy.getPasswordAttribute()); |
| | | for (Attribute a : attrList) |
| | |
| | | */ |
| | | public boolean requireSecureAuthentication() |
| | | { |
| | | |
| | | return passwordPolicy.requireSecureAuthentication(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getCurrentTime() |
| | | { |
| | | |
| | | return currentTime; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getCurrentGeneralizedTime() |
| | | { |
| | | |
| | | return currentGeneralizedTime; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setPasswordChangedTime() |
| | | { |
| | | |
| | | if (debug) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | */ |
| | | public boolean isDisabled() |
| | | { |
| | | |
| | | if ((isDisabled == null) || (isDisabled == ConditionResult.UNDEFINED)) |
| | | { |
| | | AttributeType type = |
| | |
| | | */ |
| | | public void setDisabled(boolean isDisabled) |
| | | { |
| | | |
| | | if (debug) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | */ |
| | | public boolean isAccountExpired() |
| | | { |
| | | |
| | | if ((isAccountExpired == null) || |
| | | (isAccountExpired == ConditionResult.UNDEFINED)) |
| | | { |
| | |
| | | */ |
| | | public List<Long> getAuthFailureTimes() |
| | | { |
| | | |
| | | if (authFailureTimes == null) |
| | | { |
| | | AttributeType type = |
| | |
| | | */ |
| | | public void updateAuthFailureTimes() |
| | | { |
| | | |
| | | if (debug) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | */ |
| | | public void clearAuthFailureTimes() |
| | | { |
| | | |
| | | if (debug) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | */ |
| | | public boolean lockedDueToFailures() |
| | | { |
| | | |
| | | |
| | | int maxFailures = passwordPolicy.getLockoutFailureCount(); |
| | | if (maxFailures <= 0) |
| | | { |
| | |
| | | */ |
| | | public int getSecondsUntilUnlock() |
| | | { |
| | | |
| | | if (secondsUntilUnlock < 0) |
| | | { |
| | | return -1; |
| | |
| | | */ |
| | | public void lockDueToFailures() |
| | | { |
| | | |
| | | if (debug) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | */ |
| | | public void clearFailureLockout() |
| | | { |
| | | |
| | | if (debug) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | */ |
| | | public long getLastLoginTime() |
| | | { |
| | | |
| | | if (lastLoginTime == Long.MIN_VALUE) |
| | | { |
| | | AttributeType type = passwordPolicy.getLastLoginTimeAttribute(); |
| | |
| | | */ |
| | | public void setLastLoginTime() |
| | | { |
| | | |
| | | AttributeType type = passwordPolicy.getLastLoginTimeAttribute(); |
| | | String format = passwordPolicy.getLastLoginTimeFormat(); |
| | | |
| | |
| | | */ |
| | | public boolean lockedDueToIdleInterval() |
| | | { |
| | | |
| | | if ((isIdleLocked == null) || (isIdleLocked == ConditionResult.UNDEFINED)) |
| | | { |
| | | if (passwordPolicy.getIdleLockoutInterval() <= 0) |
| | |
| | | */ |
| | | public boolean mustChangePassword() |
| | | { |
| | | |
| | | // If the password policy doesn't use force change on add or force change on |
| | | // reset, or if it forbits the user from changing their password, then this |
| | | // must return false. |
| | |
| | | */ |
| | | public void setMustChangePassword(boolean mustChangePassword) |
| | | { |
| | | |
| | | if (debug) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | */ |
| | | public boolean lockedDueToMaximumResetAge() |
| | | { |
| | | |
| | | if (passwordPolicy.getMaximumPasswordResetAge() <= 0) |
| | | { |
| | | if (debug) |
| | |
| | | */ |
| | | public long getPasswordExpirationTime() |
| | | { |
| | | |
| | | if (expirationTime == Long.MIN_VALUE) |
| | | { |
| | | expirationTime = Long.MAX_VALUE; |
| | |
| | | */ |
| | | public boolean isPasswordExpired() |
| | | { |
| | | |
| | | if ((isPasswordExpired == null) || |
| | | (isPasswordExpired == ConditionResult.UNDEFINED)) |
| | | { |
| | |
| | | */ |
| | | public boolean isWithinMinimumAge() |
| | | { |
| | | |
| | | int minAge = passwordPolicy.getMinimumPasswordAge(); |
| | | if (minAge <= 0) |
| | | { |
| | |
| | | */ |
| | | public boolean mayUseGraceLogin() |
| | | { |
| | | |
| | | if ((mayUseGraceLogin == null) || |
| | | (mayUseGraceLogin == ConditionResult.UNDEFINED)) |
| | | { |
| | |
| | | */ |
| | | public boolean shouldWarn() |
| | | { |
| | | |
| | | if ((shouldWarn == null) || (shouldWarn == ConditionResult.UNDEFINED)) |
| | | { |
| | | getPasswordExpirationTime(); |
| | |
| | | */ |
| | | public boolean isFirstWarning() |
| | | { |
| | | |
| | | if ((isFirstWarning == null) || |
| | | (isFirstWarning == ConditionResult.UNDEFINED)) |
| | | { |
| | |
| | | */ |
| | | public int getSecondsUntilExpiration() |
| | | { |
| | | |
| | | long expirationTime = getPasswordExpirationTime(); |
| | | if (expirationTime < 0) |
| | | { |
| | |
| | | */ |
| | | public long getRequiredChangeTime() |
| | | { |
| | | |
| | | if (requiredChangeTime == Long.MIN_VALUE) |
| | | { |
| | | AttributeType type = DirectoryServer.getAttributeType( |
| | |
| | | */ |
| | | public void setRequiredChangeTime() |
| | | { |
| | | |
| | | if (debug) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | */ |
| | | public long getWarnedTime() |
| | | { |
| | | |
| | | |
| | | if (warnedTime == Long.MIN_VALUE) |
| | | { |
| | | AttributeType type = |
| | |
| | | */ |
| | | public void setWarnedTime() |
| | | { |
| | | |
| | | long warnTime = getWarnedTime(); |
| | | if (warnTime == currentTime) |
| | | { |
| | |
| | | */ |
| | | public void clearWarnedTime() |
| | | { |
| | | |
| | | AttributeType type = |
| | | DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_WARNED_TIME, true); |
| | | if (updateEntry) |
| | |
| | | */ |
| | | public List<Long> getGraceLoginTimes() |
| | | { |
| | | |
| | | |
| | | if (graceLoginTimes == null) |
| | | { |
| | | AttributeType type = DirectoryServer.getAttributeType( |
| | |
| | | */ |
| | | public int getGraceLoginsRemaining() |
| | | { |
| | | |
| | | int maxGraceLogins = passwordPolicy.getGraceLoginCount(); |
| | | if (maxGraceLogins <= 0) |
| | | { |
| | |
| | | */ |
| | | public void updateGraceLoginTimes() |
| | | { |
| | | |
| | | if (debug) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | */ |
| | | public void clearGraceLoginTimes() |
| | | { |
| | | |
| | | if (debug) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | */ |
| | | public boolean passwordMatches(ByteString password) |
| | | { |
| | | |
| | | |
| | | List<Attribute> attrList = |
| | | userEntry.getAttribute(passwordPolicy.getPasswordAttribute()); |
| | | if ((attrList == null) || attrList.isEmpty()) |
| | |
| | | */ |
| | | public boolean passwordIsPreEncoded(ByteString passwordValue) |
| | | { |
| | | |
| | | if (passwordPolicy.usesAuthPasswordSyntax()) |
| | | { |
| | | return AuthPasswordSyntax.isEncoded(passwordValue); |
| | |
| | | public List<ByteString> encodePassword(ByteString password) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | List<PasswordStorageScheme> schemes = |
| | | passwordPolicy.getDefaultStorageSchemes(); |
| | | List<ByteString> encodedPasswords = |
| | |
| | | Set<ByteString> currentPasswords, |
| | | StringBuilder invalidReason) |
| | | { |
| | | |
| | | for (DN validatorDN : passwordPolicy.getPasswordValidators().keySet()) |
| | | { |
| | | PasswordValidator validator = |
| | |
| | | */ |
| | | public void handleDeprecatedStorageSchemes(ByteString password) |
| | | { |
| | | |
| | | if (passwordPolicy.getDefaultStorageSchemes().isEmpty()) |
| | | { |
| | | if (debug) |
| | |
| | | public ByteString generatePassword() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | PasswordGenerator generator = passwordPolicy.getPasswordGenerator(); |
| | | if (generator == null) |
| | | { |
| | |
| | | AccountStatusNotificationType notificationType, |
| | | DN userDN, int messageID, String message) |
| | | { |
| | | |
| | | |
| | | Collection<AccountStatusNotificationHandler> handlers = |
| | | passwordPolicy.getAccountStatusNotificationHandlers().values(); |
| | | if ((handlers == null) || handlers.isEmpty()) |
| | |
| | | public void generateAccountStatusNotification( |
| | | AccountStatusNotification notification) |
| | | { |
| | | |
| | | |
| | | Collection<AccountStatusNotificationHandler> handlers = |
| | | passwordPolicy.getAccountStatusNotificationHandlers().values(); |
| | | if ((handlers == null) || handlers.isEmpty()) |
| | |
| | | public void updateUserEntry() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // If there are no modifications, then there's nothing to do. |
| | | if (modifications.isEmpty()) |
| | | { |
| | |
| | | */ |
| | | public PasswordStorageSchemeConfigManager() |
| | | { |
| | | |
| | | configHandler = DirectoryServer.getConfigHandler(); |
| | | storageSchemes = new ConcurrentHashMap<DN,PasswordStorageScheme>(); |
| | | } |
| | |
| | | public void initializePasswordStorageSchemes() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the configuration base entry. |
| | | ConfigEntry baseEntry; |
| | | try |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for a password |
| | | // storage scheme. |
| | | if (! configEntry.hasObjectClass(OC_PASSWORD_STORAGE_SCHEME)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that no entry already exists with the specified DN. |
| | | DN configEntryDN = configEntry.getDN(); |
| | | if (storageSchemes.containsKey(configEntryDN)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | */ |
| | | public PasswordValidatorConfigManager() |
| | | { |
| | | |
| | | configHandler = DirectoryServer.getConfigHandler(); |
| | | passwordValidators = new ConcurrentHashMap<DN,PasswordValidator>(); |
| | | } |
| | |
| | | public void initializePasswordValidators() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the configuration base entry. |
| | | ConfigEntry baseEntry; |
| | | try |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for a password |
| | | // validator. |
| | | if (! configEntry.hasObjectClass(OC_PASSWORD_VALIDATOR)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that no entry already exists with the specified DN. |
| | | DN configEntryDN = configEntry.getDN(); |
| | | if (passwordValidators.containsKey(configEntryDN)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | Set<PersistentSearchChangeType> changeTypes, |
| | | boolean returnECs) |
| | | { |
| | | |
| | | this.searchOperation = searchOperation; |
| | | this.changeTypes = changeTypes; |
| | | this.returnECs = returnECs; |
| | |
| | | */ |
| | | public SearchOperation getSearchOperation() |
| | | { |
| | | |
| | | return searchOperation; |
| | | } |
| | | |
| | |
| | | */ |
| | | public Set<PersistentSearchChangeType> getChangeTypes() |
| | | { |
| | | |
| | | return changeTypes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean getReturnECs() |
| | | { |
| | | |
| | | return returnECs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN getBaseDN() |
| | | { |
| | | |
| | | return baseDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public SearchScope getScope() |
| | | { |
| | | |
| | | return scope; |
| | | } |
| | | |
| | |
| | | */ |
| | | public SearchFilter getFilter() |
| | | { |
| | | |
| | | return filter; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void processAdd(AddOperation addOperation, Entry entry) |
| | | { |
| | | |
| | | |
| | | // See if we care about add operations. |
| | | if (! changeTypes.contains(PersistentSearchChangeType.ADD)) |
| | | { |
| | |
| | | */ |
| | | public void processDelete(DeleteOperation deleteOperation, Entry entry) |
| | | { |
| | | |
| | | |
| | | // See if we care about delete operations. |
| | | if (! changeTypes.contains(PersistentSearchChangeType.DELETE)) |
| | | { |
| | |
| | | public void processModify(ModifyOperation modifyOperation, Entry oldEntry, |
| | | Entry newEntry) |
| | | { |
| | | |
| | | |
| | | // See if we care about modify operations. |
| | | if (! changeTypes.contains(PersistentSearchChangeType.MODIFY)) |
| | | { |
| | |
| | | public void processModifyDN(ModifyDNOperation modifyDNOperation, |
| | | Entry oldEntry, Entry newEntry) |
| | | { |
| | | |
| | | |
| | | // See if we care about modify DN operations. |
| | | if (! changeTypes.contains(PersistentSearchChangeType.MODIFY_DN)) |
| | | { |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("PersistentSearch(connID="); |
| | | buffer.append(searchOperation.getConnectionID()); |
| | | buffer.append(",opID="); |
| | |
| | | */ |
| | | public PluginConfigManager() |
| | | { |
| | | |
| | | pluginLock = new ReentrantLock(); |
| | | |
| | | startupPlugins = new DirectoryServerPlugin[0]; |
| | |
| | | public void initializePluginConfig(Set<PluginType> pluginTypes) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | registeredPlugins.clear(); |
| | | |
| | | |
| | |
| | | */ |
| | | public ConcurrentHashMap<DN,DirectoryServerPlugin> getRegisteredPlugins() |
| | | { |
| | | |
| | | return registeredPlugins; |
| | | } |
| | | |
| | |
| | | */ |
| | | public DirectoryServerPlugin getRegisteredPlugin(DN pluginDN) |
| | | { |
| | | |
| | | return registeredPlugins.get(pluginDN); |
| | | } |
| | | |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for a plugin. |
| | | if (! configEntry.hasObjectClass(OC_PLUGIN)) |
| | | { |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // NYI |
| | | return false; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // NYI |
| | | return false; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | private void registerPlugin(DirectoryServerPlugin plugin, DN pluginEntryDN, |
| | | HashSet<PluginType> pluginTypes) |
| | | { |
| | | |
| | | pluginLock.lock(); |
| | | |
| | | try |
| | |
| | | private DirectoryServerPlugin[] addPlugin(DirectoryServerPlugin[] pluginArray, |
| | | DirectoryServerPlugin plugin) |
| | | { |
| | | |
| | | DirectoryServerPlugin[] newPlugins = |
| | | new DirectoryServerPlugin[pluginArray.length+1]; |
| | | System.arraycopy(pluginArray, 0, newPlugins, 0, pluginArray.length); |
| | |
| | | */ |
| | | private void deregisterPlugin(DN configEntryDN) |
| | | { |
| | | |
| | | pluginLock.lock(); |
| | | |
| | | try |
| | |
| | | removePlugin(DirectoryServerPlugin[] pluginArray, |
| | | DirectoryServerPlugin plugin) |
| | | { |
| | | |
| | | int slot = -1; |
| | | int length = pluginArray.length; |
| | | for (int i=0; i < length; i++) |
| | |
| | | */ |
| | | public StartupPluginResult invokeStartupPlugins() |
| | | { |
| | | |
| | | |
| | | StartupPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : startupPlugins) |
| | |
| | | */ |
| | | public void invokeShutdownPlugins(String reason) |
| | | { |
| | | |
| | | |
| | | for (DirectoryServerPlugin p : shutdownPlugins) |
| | | { |
| | | try |
| | |
| | | public PostConnectPluginResult invokePostConnectPlugins(ClientConnection |
| | | clientConnection) |
| | | { |
| | | |
| | | |
| | | PostConnectPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postConnectPlugins) |
| | |
| | | DisconnectReason disconnectReason, |
| | | int messageID, String message) |
| | | { |
| | | |
| | | |
| | | PostDisconnectPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postDisconnectPlugins) |
| | |
| | | public LDIFPluginResult invokeLDIFImportPlugins(LDIFImportConfig importConfig, |
| | | Entry entry) |
| | | { |
| | | |
| | | LDIFPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : ldifImportPlugins) |
| | |
| | | public LDIFPluginResult invokeLDIFExportPlugins(LDIFExportConfig exportConfig, |
| | | Entry entry) |
| | | { |
| | | |
| | | LDIFPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : ldifExportPlugins) |
| | |
| | | public PreParsePluginResult invokePreParseAbandonPlugins( |
| | | AbandonOperation abandonOperation) |
| | | { |
| | | |
| | | PreParsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseAbandonPlugins) |
| | |
| | | public PreParsePluginResult invokePreParseAddPlugins(AddOperation |
| | | addOperation) |
| | | { |
| | | |
| | | PreParsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseAddPlugins) |
| | |
| | | public PreParsePluginResult invokePreParseBindPlugins( |
| | | BindOperation bindOperation) |
| | | { |
| | | |
| | | PreParsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseBindPlugins) |
| | |
| | | public PreParsePluginResult invokePreParseComparePlugins( |
| | | CompareOperation compareOperation) |
| | | { |
| | | |
| | | PreParsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseComparePlugins) |
| | |
| | | public PreParsePluginResult invokePreParseDeletePlugins( |
| | | DeleteOperation deleteOperation) |
| | | { |
| | | |
| | | PreParsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseDeletePlugins) |
| | |
| | | public PreParsePluginResult invokePreParseExtendedPlugins( |
| | | ExtendedOperation extendedOperation) |
| | | { |
| | | |
| | | PreParsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseExtendedPlugins) |
| | |
| | | public PreParsePluginResult invokePreParseModifyPlugins( |
| | | ModifyOperation modifyOperation) |
| | | { |
| | | |
| | | PreParsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseModifyPlugins) |
| | |
| | | public PreParsePluginResult invokePreParseModifyDNPlugins( |
| | | ModifyDNOperation modifyDNOperation) |
| | | { |
| | | |
| | | PreParsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseModifyDNPlugins) |
| | |
| | | public PreParsePluginResult invokePreParseSearchPlugins( |
| | | SearchOperation searchOperation) |
| | | { |
| | | |
| | | PreParsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseSearchPlugins) |
| | |
| | | public PreParsePluginResult invokePreParseUnbindPlugins( |
| | | UnbindOperation unbindOperation) |
| | | { |
| | | |
| | | PreParsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preParseUnbindPlugins) |
| | |
| | | public PreOperationPluginResult invokePreOperationAddPlugins( |
| | | AddOperation addOperation) |
| | | { |
| | | |
| | | PreOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationAddPlugins) |
| | |
| | | public PreOperationPluginResult invokePreOperationBindPlugins( |
| | | BindOperation bindOperation) |
| | | { |
| | | |
| | | PreOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationBindPlugins) |
| | |
| | | public PreOperationPluginResult invokePreOperationComparePlugins( |
| | | CompareOperation compareOperation) |
| | | { |
| | | |
| | | PreOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationComparePlugins) |
| | |
| | | public PreOperationPluginResult invokePreOperationDeletePlugins( |
| | | DeleteOperation deleteOperation) |
| | | { |
| | | |
| | | PreOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationDeletePlugins) |
| | |
| | | public PreOperationPluginResult invokePreOperationExtendedPlugins( |
| | | ExtendedOperation extendedOperation) |
| | | { |
| | | |
| | | PreOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationExtendedPlugins) |
| | |
| | | public PreOperationPluginResult invokePreOperationModifyPlugins( |
| | | ModifyOperation modifyOperation) |
| | | { |
| | | |
| | | PreOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationModifyPlugins) |
| | |
| | | public PreOperationPluginResult invokePreOperationModifyDNPlugins( |
| | | ModifyDNOperation modifyDNOperation) |
| | | { |
| | | |
| | | PreOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationModifyDNPlugins) |
| | |
| | | public PreOperationPluginResult invokePreOperationSearchPlugins( |
| | | SearchOperation searchOperation) |
| | | { |
| | | |
| | | PreOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : preOperationSearchPlugins) |
| | |
| | | public PostOperationPluginResult invokePostOperationAbandonPlugins( |
| | | AbandonOperation abandonOperation) |
| | | { |
| | | |
| | | PostOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationAbandonPlugins) |
| | |
| | | public PostOperationPluginResult invokePostOperationAddPlugins( |
| | | AddOperation addOperation) |
| | | { |
| | | |
| | | PostOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationAddPlugins) |
| | |
| | | public PostOperationPluginResult invokePostOperationBindPlugins( |
| | | BindOperation bindOperation) |
| | | { |
| | | |
| | | PostOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationBindPlugins) |
| | |
| | | public PostOperationPluginResult invokePostOperationComparePlugins( |
| | | CompareOperation compareOperation) |
| | | { |
| | | |
| | | PostOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationComparePlugins) |
| | |
| | | public PostOperationPluginResult invokePostOperationDeletePlugins( |
| | | DeleteOperation deleteOperation) |
| | | { |
| | | |
| | | PostOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationDeletePlugins) |
| | |
| | | public PostOperationPluginResult invokePostOperationExtendedPlugins( |
| | | ExtendedOperation extendedOperation) |
| | | { |
| | | |
| | | PostOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationExtendedPlugins) |
| | |
| | | public PostOperationPluginResult invokePostOperationModifyPlugins( |
| | | ModifyOperation modifyOperation) |
| | | { |
| | | |
| | | PostOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationModifyPlugins) |
| | |
| | | public PostOperationPluginResult invokePostOperationModifyDNPlugins( |
| | | ModifyDNOperation modifyDNOperation) |
| | | { |
| | | |
| | | PostOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationModifyDNPlugins) |
| | |
| | | public PostOperationPluginResult invokePostOperationSearchPlugins( |
| | | SearchOperation searchOperation) |
| | | { |
| | | |
| | | PostOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationSearchPlugins) |
| | |
| | | public PostOperationPluginResult invokePostOperationUnbindPlugins( |
| | | UnbindOperation unbindOperation) |
| | | { |
| | | |
| | | PostOperationPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postOperationUnbindPlugins) |
| | |
| | | public PostResponsePluginResult invokePostResponseAddPlugins( |
| | | AddOperation addOperation) |
| | | { |
| | | |
| | | PostResponsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseAddPlugins) |
| | |
| | | public PostResponsePluginResult invokePostResponseBindPlugins( |
| | | BindOperation bindOperation) |
| | | { |
| | | |
| | | PostResponsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseBindPlugins) |
| | |
| | | public PostResponsePluginResult invokePostResponseComparePlugins( |
| | | CompareOperation compareOperation) |
| | | { |
| | | |
| | | PostResponsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseComparePlugins) |
| | |
| | | public PostResponsePluginResult invokePostResponseDeletePlugins( |
| | | DeleteOperation deleteOperation) |
| | | { |
| | | |
| | | PostResponsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseDeletePlugins) |
| | |
| | | public PostResponsePluginResult invokePostResponseExtendedPlugins( |
| | | ExtendedOperation extendedOperation) |
| | | { |
| | | |
| | | PostResponsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseExtendedPlugins) |
| | |
| | | public PostResponsePluginResult invokePostResponseModifyPlugins( |
| | | ModifyOperation modifyOperation) |
| | | { |
| | | |
| | | PostResponsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseModifyPlugins) |
| | |
| | | public PostResponsePluginResult invokePostResponseModifyDNPlugins( |
| | | ModifyDNOperation modifyDNOperation) |
| | | { |
| | | |
| | | PostResponsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseModifyDNPlugins) |
| | |
| | | public PostResponsePluginResult invokePostResponseSearchPlugins( |
| | | SearchOperation searchOperation) |
| | | { |
| | | |
| | | PostResponsePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : postResponseSearchPlugins) |
| | |
| | | SearchOperation searchOperation, |
| | | SearchResultEntry searchEntry) |
| | | { |
| | | |
| | | SearchEntryPluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : searchResultEntryPlugins) |
| | |
| | | SearchOperation searchOperation, |
| | | SearchResultReference searchReference) |
| | | { |
| | | |
| | | SearchReferencePluginResult result = null; |
| | | |
| | | for (DirectoryServerPlugin p : searchResultReferencePlugins) |
| | |
| | | invokeIntermediateResponsePlugins( |
| | | IntermediateResponse intermediateResponse) |
| | | { |
| | | |
| | | IntermediateResponsePluginResult result = null; |
| | | Operation operation = intermediateResponse.getOperation(); |
| | | |
| | |
| | | */ |
| | | public RootDNConfigManager() |
| | | { |
| | | |
| | | bindMappings = new ConcurrentHashMap<DN,List<DN>>(); |
| | | } |
| | | |
| | |
| | | public void initializeRootDNs() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the base configuration entry for the root DNs. |
| | | ConfigHandler configHandler = DirectoryServer.getConfigHandler(); |
| | | ConfigEntry baseEntry; |
| | |
| | | */ |
| | | public Set<Privilege> getRootPrivileges() |
| | | { |
| | | |
| | | return rootPrivileges; |
| | | } |
| | | |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for a root DN. |
| | | if (! configEntry.hasObjectClass(OC_ROOT_DN)) |
| | | { |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that no entry already exists with the specified DN, and that |
| | | // there is no other root user with a conflicting alternate bind DN. |
| | | DN configEntryDN = configEntry.getDN(); |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | int msgID = MSGID_CONFIG_ROOTDN_DESCRIPTION_ROOT_PRIVILEGE; |
| | | MultiChoiceConfigAttribute rootPrivStub = |
| | | new MultiChoiceConfigAttribute(ATTR_DEFAULT_ROOT_PRIVILEGE_NAME, |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | | boolean adminActionRequired = false; |
| | |
| | | */ |
| | | public SASLConfigManager() |
| | | { |
| | | |
| | | configHandler = DirectoryServer.getConfigHandler(); |
| | | handlers = new ConcurrentHashMap<DN,SASLMechanismHandler>(); |
| | | } |
| | |
| | | public void initializeSASLMechanismHandlers() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the configuration base entry. |
| | | ConfigEntry baseEntry; |
| | | try |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for a SASL |
| | | // mechanism handler. |
| | | if (! configEntry.hasObjectClass(OC_SASL_MECHANISM_HANDLER)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that no entry already exists with the specified DN. |
| | | DN configEntryDN = configEntry.getDN(); |
| | | if (handlers.containsKey(configEntryDN)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | */ |
| | | public SchemaConfigManager() |
| | | { |
| | | |
| | | configHandler = DirectoryServer.getConfigHandler(); |
| | | |
| | | schema = new Schema(); |
| | |
| | | */ |
| | | public static String getSchemaDirectoryPath() |
| | | { |
| | | |
| | | String schemaDirPath = System.getProperty(PROPERTY_SCHEMA_DIRECTORY); |
| | | if ((schemaDirPath == null) || (schemaDirPath.length() == 0)) |
| | | { |
| | |
| | | */ |
| | | public Schema getSchema() |
| | | { |
| | | |
| | | return schema; |
| | | } |
| | | |
| | |
| | | public void initializeMatchingRules() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the matching rule configuration base entry. |
| | | ConfigEntry matchingRuleBaseEntry; |
| | | try |
| | |
| | | public void initializeAttributeSyntaxes() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the attribute syntax configuration base entry. |
| | | ConfigEntry syntaxBaseEntry; |
| | | try |
| | |
| | | public void initializeSchemaFromFiles() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // Construct the path to the directory that should contain the schema files |
| | | // and make sure that it exists and is a directory. Get a list of the files |
| | | // in that directory sorted in alphabetic order. |
| | |
| | | public static void loadSchemaFile(Schema schema, String schemaFile) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | loadSchemaFile(schema, schemaFile, true); |
| | | } |
| | | |
| | |
| | | boolean failOnError) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // Create an LDIF reader to use when reading the files. |
| | | String schemaDirPath = getSchemaDirectoryPath(); |
| | | LDIFReader reader; |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // NYI |
| | | |
| | | // If we've gotten here then the monitor entry appears to be acceptable. |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // NYI |
| | | |
| | | // If we've gotten here then the monitor entry appears to be acceptable. |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // NYI -- Should we allow deletes of elements with this as superior? |
| | | |
| | | return true; |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | */ |
| | | public final ByteString getRawBaseDN() |
| | | { |
| | | |
| | | return rawBaseDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setRawBaseDN(ByteString rawBaseDN) |
| | | { |
| | | |
| | | this.rawBaseDN = rawBaseDN; |
| | | |
| | | baseDN = null; |
| | |
| | | */ |
| | | public final DN getBaseDN() |
| | | { |
| | | |
| | | return baseDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setBaseDN(DN baseDN) |
| | | { |
| | | |
| | | this.baseDN = baseDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final SearchScope getScope() |
| | | { |
| | | |
| | | return scope; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setScope(SearchScope scope) |
| | | { |
| | | |
| | | this.scope = scope; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final DereferencePolicy getDerefPolicy() |
| | | { |
| | | |
| | | return derefPolicy; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setDerefPolicy(DereferencePolicy derefPolicy) |
| | | { |
| | | |
| | | this.derefPolicy = derefPolicy; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final int getSizeLimit() |
| | | { |
| | | |
| | | return sizeLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setSizeLimit(int sizeLimit) |
| | | { |
| | | |
| | | this.sizeLimit = sizeLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final int getTimeLimit() |
| | | { |
| | | |
| | | return timeLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setTimeLimit(int timeLimit) |
| | | { |
| | | |
| | | this.timeLimit = timeLimit; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final boolean getTypesOnly() |
| | | { |
| | | |
| | | return typesOnly; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setTypesOnly(boolean typesOnly) |
| | | { |
| | | |
| | | this.typesOnly = typesOnly; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final LDAPFilter getRawFilter() |
| | | { |
| | | |
| | | return rawFilter; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setRawFilter(LDAPFilter rawFilter) |
| | | { |
| | | |
| | | this.rawFilter = rawFilter; |
| | | |
| | | filter = null; |
| | |
| | | */ |
| | | public final SearchFilter getFilter() |
| | | { |
| | | |
| | | return filter; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final LinkedHashSet<String> getAttributes() |
| | | { |
| | | |
| | | return attributes; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final void setAttributes(LinkedHashSet<String> attributes) |
| | | { |
| | | |
| | | if (attributes == null) |
| | | { |
| | | this.attributes.clear(); |
| | |
| | | */ |
| | | public final int getEntriesSent() |
| | | { |
| | | |
| | | return entriesSent; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final int getReferencesSent() |
| | | { |
| | | |
| | | return referencesSent; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStartTime() |
| | | { |
| | | |
| | | return processingStartTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingStopTime() |
| | | { |
| | | |
| | | return processingStopTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final long getProcessingTime() |
| | | { |
| | | |
| | | return (processingStopTime - processingStartTime); |
| | | } |
| | | |
| | |
| | | */ |
| | | public final boolean returnEntry(Entry entry, List<Control> controls) |
| | | { |
| | | |
| | | |
| | | // See if the operation has been abandoned. If so, then don't send the |
| | | // entry and indicate that the search should end. |
| | | if (cancelRequest != null) |
| | |
| | | */ |
| | | public final boolean returnReference(SearchResultReference reference) |
| | | { |
| | | |
| | | // See if the operation has been abandoned. If so, then don't send the |
| | | // reference and indicate that the search should end. |
| | | if (cancelRequest != null) |
| | |
| | | */ |
| | | public final void sendSearchResultDone() |
| | | { |
| | | |
| | | |
| | | // Send the search result done message to the client. We want to make sure |
| | | // that this only gets sent once, and it's possible that this could be |
| | | // multithreaded in the event of a persistent search, so do it safely. |
| | |
| | | @Override() |
| | | public final List<Control> getResponseControls() |
| | | { |
| | | |
| | | return responseControls; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final void run() |
| | | { |
| | | |
| | | setResultCode(ResultCode.UNDEFINED); |
| | | boolean sendResponse = true; |
| | | |
| | |
| | | private final void searchBackend(Backend backend) |
| | | throws DirectoryException, CancelledOperationException |
| | | { |
| | | |
| | | |
| | | // Check for and handle a request to cancel this operation. |
| | | if (cancelRequest != null) |
| | | { |
| | |
| | | @Override() |
| | | public final CancelResult cancel(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | |
| | | if (persistentSearch != null) |
| | |
| | | @Override() |
| | | public final CancelRequest getCancelRequest() |
| | | { |
| | | |
| | | return cancelRequest; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | boolean setCancelRequest(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | this.cancelRequest = cancelRequest; |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("SearchOperation(connID="); |
| | | buffer.append(clientConnection.getConnectionID()); |
| | | buffer.append(", opID="); |
| | |
| | | */ |
| | | public SynchronizationProviderConfigManager() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | public void initializeSynchronizationProviders() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | registeredProviders = new ConcurrentHashMap<DN,SynchronizationProvider>(); |
| | | |
| | | |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | DN providerDN = configEntry.getDN(); |
| | | SynchronizationProvider provider = registeredProviders.get(providerDN); |
| | | |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN providerDN = configEntry.getDN(); |
| | | SynchronizationProvider provider = registeredProviders.get(providerDN); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // NYI |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | // NYI |
| | | return null; |
| | | } |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // NYI |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | // NYI |
| | | return null; |
| | | } |
| | |
| | | */ |
| | | public TrustManagerProviderConfigManager() |
| | | { |
| | | |
| | | configHandler = DirectoryServer.getConfigHandler(); |
| | | providers = new ConcurrentHashMap<DN,TrustManagerProvider>(); |
| | | } |
| | |
| | | public void initializeTrustManagerProviders() |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // First, get the configuration base entry. |
| | | ConfigEntry baseEntry; |
| | | try |
| | |
| | | public boolean configChangeIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that the entry has an appropriate objectclass for a trust |
| | | // manager provider. |
| | | if (! configEntry.hasObjectClass(OC_TRUST_MANAGER_PROVIDER)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationChange(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configAddIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // Make sure that no entry already exists with the specified DN. |
| | | DN configEntryDN = configEntry.getDN(); |
| | | if (providers.containsKey(configEntryDN)) |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationAdd(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public boolean configDeleteIsAcceptable(ConfigEntry configEntry, |
| | | StringBuilder unacceptableReason) |
| | | { |
| | | |
| | | |
| | | // A delete should always be acceptable, so just return true. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public ConfigChangeResult applyConfigurationDelete(ConfigEntry configEntry) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | @Override() |
| | | public final List<Control> getResponseControls() |
| | | { |
| | | |
| | | // An unbind operation can never have a response, so just return an empty |
| | | // list. |
| | | return NO_RESPONSE_CONTROLS; |
| | |
| | | @Override() |
| | | public long getProcessingStartTime() |
| | | { |
| | | |
| | | return processingStartTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public long getProcessingStopTime() |
| | | { |
| | | |
| | | return processingStopTime; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public long getProcessingTime() |
| | | { |
| | | |
| | | return (processingStopTime - processingStartTime); |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public final void run() |
| | | { |
| | | |
| | | |
| | | // Get the plugin config manager that will be used for invoking plugins. |
| | | PluginConfigManager pluginConfigManager = |
| | | DirectoryServer.getPluginConfigManager(); |
| | |
| | | @Override() |
| | | public final CancelResult cancel(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | cancelRequest.addResponseMessage(getMessage(MSGID_CANNOT_CANCEL_UNBIND)); |
| | | return CancelResult.CANNOT_CANCEL; |
| | | } |
| | |
| | | @Override() |
| | | public final CancelRequest getCancelRequest() |
| | | { |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | boolean setCancelRequest(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | // Unbind operations cannot be canceled. |
| | | return false; |
| | | } |
| | |
| | | @Override() |
| | | public final void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("UnbindOperation(connID="); |
| | | buffer.append(clientConnection.getConnectionID()); |
| | | buffer.append(", opID="); |
| | |
| | | public void initializeSASLMechanismHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // No real implementation is required. Simply register with the Directory |
| | | // Server for the ANONYMOUS mechanism. |
| | | DirectoryServer.registerSASLMechanismHandler(SASL_MECHANISM_ANONYMOUS, |
| | |
| | | @Override() |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | | |
| | | DirectoryServer.deregisterSASLMechanismHandler(SASL_MECHANISM_ANONYMOUS); |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | | |
| | | |
| | | // See if the client provided SASL credentials including trace information. |
| | | // If so, then log it to the error log. |
| | | ByteString saslCredentials = bindOperation.getSASLCredentials(); |
| | |
| | | @Override() |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | | |
| | | // This is not a password-based mechanism. |
| | | return false; |
| | | } |
| | |
| | | @Override() |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | | |
| | | // This is not a secure mechanism. |
| | | return false; |
| | | } |
| | |
| | | public void initializePasswordStorageScheme(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No initialization is required. |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public String getStorageSchemeName() |
| | | { |
| | | |
| | | return STORAGE_SCHEME_NAME_BASE64; |
| | | } |
| | | |
| | |
| | | public ByteString encodePassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return ByteStringFactory.create(Base64.encode(plaintext.value())); |
| | | } |
| | | |
| | |
| | | public ByteString encodePasswordWithScheme(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append('{'); |
| | | buffer.append(STORAGE_SCHEME_NAME_BASE64); |
| | |
| | | public boolean passwordMatches(ByteString plaintextPassword, |
| | | ByteString storedPassword) |
| | | { |
| | | |
| | | |
| | | String userString = Base64.encode(plaintextPassword.value()); |
| | | String storedString = storedPassword.stringValue(); |
| | | return userString.equals(storedString); |
| | |
| | | @Override() |
| | | public boolean isReversible() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | public ByteString getPlaintextValue(ByteString storedPassword) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | try |
| | | { |
| | | return ByteStringFactory.create(Base64.decode( |
| | |
| | | @Override() |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | | |
| | | // This storage scheme does not support the authentication password syntax. |
| | | return false; |
| | | } |
| | |
| | | public ByteString encodeAuthPassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | int msgID = MSGID_PWSCHEME_DOES_NOT_SUPPORT_AUTH_PASSWORD; |
| | | String message = getMessage(msgID, getStorageSchemeName()); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public boolean authPasswordMatches(ByteString plaintextPassword, |
| | | String authInfo, String authValue) |
| | | { |
| | | |
| | | |
| | | // This storage scheme does not support the authentication password syntax. |
| | | return false; |
| | | } |
| | |
| | | String authValue) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_DOES_NOT_SUPPORT_AUTH_PASSWORD; |
| | | String message = getMessage(msgID, getStorageSchemeName()); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | @Override() |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | | |
| | | // Base64-encoded values may be easily decoded with no key or special |
| | | // knowledge. |
| | | return false; |
| | |
| | | */ |
| | | public BlindTrustManagerProvider() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | public void initializeTrustManagerProvider(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public void finalizeTrustManagerProvider() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | public TrustManager[] getTrustManagers() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return new TrustManager[] { this }; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void checkClientTrusted(X509Certificate[] chain, String authType) |
| | | { |
| | | |
| | | // As long as we don't throw an exception, then the client certificate will |
| | | // be considered trusted. |
| | | } |
| | |
| | | */ |
| | | public void checkServerTrusted(X509Certificate[] chain, String authType) |
| | | { |
| | | |
| | | // As long as we don't throw an exception, then the server certificate will |
| | | // be considered trusted. |
| | | } |
| | |
| | | */ |
| | | public X509Certificate[] getAcceptedIssuers() |
| | | { |
| | | |
| | | return new X509Certificate[0]; |
| | | } |
| | | } |
| | |
| | | public void initializeSASLMechanismHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | this.configEntryDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | @Override() |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | DirectoryServer.deregisterSASLMechanismHandler(SASL_MECHANISM_CRAM_MD5); |
| | | } |
| | |
| | | @Override() |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | | |
| | | |
| | | // The CRAM-MD5 bind process uses two stages. See if the client provided |
| | | // any credentials. If not, then we're in the first stage so we'll send the |
| | | // challenge to the client. |
| | |
| | | */ |
| | | private byte[] generateDigest(ByteString password, ByteString challenge) |
| | | { |
| | | |
| | | |
| | | // Get the byte arrays backing the password and challenge. |
| | | byte[] p = password.value(); |
| | | byte[] c = challenge.value(); |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | int msgID = MSGID_SASLCRAMMD5_DESCRIPTION_IDENTITY_MAPPER_DN; |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // Look at the identity mapper configuration. |
| | | int msgID = MSGID_SASLCRAMMD5_DESCRIPTION_IDENTITY_MAPPER_DN; |
| | | DNConfigAttribute mapperStub = |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | @Override() |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | | |
| | | // This is a password-based mechanism. |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | | |
| | | // This may be considered a secure mechanism. |
| | | return true; |
| | | } |
| | |
| | | public void initializeExtendedOperationHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No special configuration is required. |
| | | |
| | | DirectoryServer.registerSupportedExtension(OID_CANCEL_REQUEST, this); |
| | |
| | | */ |
| | | public void finalizeExtendedOperationHandler() |
| | | { |
| | | |
| | | DirectoryServer.deregisterSupportedExtension(OID_CANCEL_REQUEST); |
| | | } |
| | | |
| | |
| | | */ |
| | | public void processExtendedOperation(ExtendedOperation operation) |
| | | { |
| | | |
| | | |
| | | // The value of the request must be a sequence containing an integer element |
| | | // that holds the message ID of the operation to cancel. If there is no |
| | | // value or it cannot be decoded, then fail. |
| | |
| | | public void initializePasswordStorageScheme(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No initialization is required. |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public String getStorageSchemeName() |
| | | { |
| | | |
| | | return STORAGE_SCHEME_NAME_CLEAR; |
| | | } |
| | | |
| | |
| | | public ByteString encodePassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return plaintext.duplicate(); |
| | | } |
| | | |
| | |
| | | public ByteString encodePasswordWithScheme(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append('{'); |
| | | buffer.append(STORAGE_SCHEME_NAME_CLEAR); |
| | |
| | | public boolean passwordMatches(ByteString plaintextPassword, |
| | | ByteString storedPassword) |
| | | { |
| | | |
| | | return Arrays.equals(plaintextPassword.value(), storedPassword.value()); |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public boolean isReversible() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | public ByteString getPlaintextValue(ByteString storedPassword) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return storedPassword.duplicate(); |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | | |
| | | // This storage scheme does not support the authentication password syntax. |
| | | return false; |
| | | } |
| | |
| | | public ByteString encodeAuthPassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | int msgID = MSGID_PWSCHEME_DOES_NOT_SUPPORT_AUTH_PASSWORD; |
| | | String message = getMessage(msgID, getStorageSchemeName()); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public boolean authPasswordMatches(ByteString plaintextPassword, |
| | | String authInfo, String authValue) |
| | | { |
| | | |
| | | |
| | | // This storage scheme does not support the authentication password syntax. |
| | | return false; |
| | | } |
| | |
| | | String authValue) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_DOES_NOT_SUPPORT_AUTH_PASSWORD; |
| | | String message = getMessage(msgID, getStorageSchemeName()); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | @Override() |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | | |
| | | // Clear-text passwords are not obscured in any way. |
| | | return false; |
| | | } |
| | |
| | | public void initializeConfigHandler(String configFile, boolean checkSchema) |
| | | throws InitializationException |
| | | { |
| | | |
| | | |
| | | // Initialize the config lock. |
| | | configLock = new ReentrantLock(); |
| | | |
| | |
| | | private void applyChangesFile(File sourceFile, File changesFile) |
| | | throws IOException, LDIFException |
| | | { |
| | | |
| | | |
| | | // FIXME -- Do we need to do anything special for configuration archiving? |
| | | |
| | | |
| | |
| | | */ |
| | | public void finalizeConfigHandler() |
| | | { |
| | | |
| | | try |
| | | { |
| | | DirectoryServer.deregisterBaseDN(configRootEntry.getDN(), false); |
| | |
| | | public ConfigEntry getConfigRootEntry() |
| | | throws ConfigException |
| | | { |
| | | |
| | | return configRootEntry; |
| | | } |
| | | |
| | |
| | | public ConfigEntry getConfigEntry(DN entryDN) |
| | | throws ConfigException |
| | | { |
| | | |
| | | return configEntries.get(entryDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getServerRoot() |
| | | { |
| | | |
| | | return serverRoot; |
| | | } |
| | | |
| | |
| | | public void initializeBackend(ConfigEntry configEntry, DN[] baseDNs) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No action is required, since all initialization was performed in the |
| | | // initializeConfigHandler method. |
| | | } |
| | |
| | | */ |
| | | public DN[] getBaseDNs() |
| | | { |
| | | |
| | | return baseDNs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getEntryCount() |
| | | { |
| | | |
| | | return configEntries.size(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isLocal() |
| | | { |
| | | |
| | | // The configuration information will always be local. |
| | | return true; |
| | | } |
| | |
| | | public Entry getEntry(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | ConfigEntry configEntry = configEntries.get(entryDN); |
| | | if (configEntry == null) |
| | | { |
| | |
| | | public boolean entryExists(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return configEntries.containsKey(entryDN); |
| | | } |
| | | |
| | |
| | | public void addEntry(Entry entry, AddOperation addOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // If there is an add operation, then make sure that the associated user has |
| | | // both the CONFIG_READ and CONFIG_WRITE privileges. |
| | | if (addOperation != null) |
| | |
| | | public void deleteEntry(DN entryDN, DeleteOperation deleteOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // If there is a delete operation, then make sure that the associated user |
| | | // has both the CONFIG_READ and CONFIG_WRITE privileges. |
| | | if (deleteOperation != null) |
| | |
| | | public void replaceEntry(Entry entry, ModifyOperation modifyOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // If there is a modify operation, then make sure that the associated user |
| | | // has both the CONFIG_READ and CONFIG_WRITE privileges. Also, if the |
| | | // operation targets the set of root privileges then make sure the user has |
| | |
| | | ModifyDNOperation modifyDNOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // If there is a modify DN operation, then make sure that the associated |
| | | // user has both the CONFIG_READ and CONFIG_WRITE privileges. |
| | | if (modifyDNOperation != null) |
| | |
| | | public void search(SearchOperation searchOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Make sure that the associated user has the CONFIG_READ privilege. |
| | | ClientConnection clientConnection = searchOperation.getClientConnection(); |
| | | if (! clientConnection.hasPrivilege(Privilege.CONFIG_READ, searchOperation)) |
| | |
| | | SearchOperation searchOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | Entry e = baseEntry.getEntry(); |
| | | if (filter.matchesEntry(e)) |
| | | { |
| | |
| | | public void writeUpdatedConfig() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // FIXME -- This needs support for encryption. |
| | | |
| | | |
| | |
| | | */ |
| | | public boolean supportsLDIFExport() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | LDIFExportConfig exportConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | LDIFWriter writer; |
| | | try |
| | | { |
| | |
| | | private void writeEntryAndChildren(LDIFWriter writer, ConfigEntry configEntry) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | try |
| | | { |
| | | // Write the entry itself to LDIF. |
| | |
| | | */ |
| | | public boolean supportsLDIFImport() |
| | | { |
| | | |
| | | return false; |
| | | } |
| | | |
| | |
| | | LDIFImportConfig importConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_UNWILLING_TO_IMPORT; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | */ |
| | | public boolean supportsBackup() |
| | | { |
| | | |
| | | // We do support an online backup mechanism for the configuration. |
| | | return true; |
| | | } |
| | |
| | | public boolean supportsBackup(BackupConfig backupConfig, |
| | | StringBuilder unsupportedReason) |
| | | { |
| | | |
| | | |
| | | // We should support online backup for the configuration in any form. This |
| | | // implementation does not support incremental backups, but in this case |
| | | // even if we're asked to do an incremental we'll just do a full backup |
| | |
| | | public void createBackup(ConfigEntry configEntry, BackupConfig backupConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Get the properties to use for the backup. We don't care whether or not |
| | | // it's incremental, so there's no need to get that. |
| | | String backupID = backupConfig.getBackupID(); |
| | |
| | | String backupID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // NYI |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsRestore() |
| | | { |
| | | |
| | | |
| | | // We will provide a restore, but only for offline operations. |
| | | return true; |
| | | } |
| | |
| | | RestoreConfig restoreConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // First, make sure that the requested backup exists. |
| | | BackupDirectory backupDirectory = restoreConfig.getBackupDirectory(); |
| | | String backupPath = backupDirectory.getPath(); |
| | |
| | | */ |
| | | public DN getComponentEntryDN() |
| | | { |
| | | |
| | | return configRootEntry.getDN(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getClassName() |
| | | { |
| | | |
| | | return CLASS_NAME; |
| | | } |
| | | |
| | |
| | | */ |
| | | public LinkedHashMap<String,String> getAlerts() |
| | | { |
| | | |
| | | LinkedHashMap<String,String> alerts = new LinkedHashMap<String,String>(); |
| | | |
| | | alerts.put(ALERT_TYPE_CANNOT_WRITE_CONFIGURATION, |
| | |
| | | public void initializeEntryCache(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No implementation required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public void finalizeEntryCache() |
| | | { |
| | | |
| | | // No implementation required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean containsEntry(DN entryDN) |
| | | { |
| | | |
| | | // This implementation does not store any entries. |
| | | return false; |
| | | } |
| | |
| | | */ |
| | | public Entry getEntry(DN entryDN) |
| | | { |
| | | |
| | | // This implementation does not store any entries. |
| | | return null; |
| | | } |
| | |
| | | */ |
| | | public long getEntryID(DN entryDN) |
| | | { |
| | | |
| | | // This implementation does not store any entries. |
| | | return -1; |
| | | } |
| | |
| | | */ |
| | | public Entry getEntry(DN entryDN, LockType lockType, List<Lock> lockList) |
| | | { |
| | | |
| | | // This implementation does not store entries. |
| | | return null; |
| | | } |
| | |
| | | public Entry getEntry(Backend backend, long entryID, LockType lockType, |
| | | List<Lock> lockList) |
| | | { |
| | | |
| | | // This implementation does not store entries. |
| | | return null; |
| | | } |
| | |
| | | */ |
| | | public void putEntry(Entry entry, Backend backend, long entryID) |
| | | { |
| | | |
| | | // This implementation does not store entries. |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean putEntryIfAbsent(Entry entry, Backend backend, long entryID) |
| | | { |
| | | |
| | | // This implementation does not store entries, so we will never have a |
| | | // conflict. |
| | | return true; |
| | |
| | | */ |
| | | public void removeEntry(DN entryDN) |
| | | { |
| | | |
| | | // This implementation does not store entries. |
| | | } |
| | | |
| | |
| | | */ |
| | | public void clear() |
| | | { |
| | | |
| | | // This implementation does not store entries. |
| | | } |
| | | |
| | |
| | | */ |
| | | public void clearBackend(Backend backend) |
| | | { |
| | | |
| | | // This implementation does not store entries. |
| | | } |
| | | |
| | |
| | | */ |
| | | public void clearSubtree(DN baseDN) |
| | | { |
| | | |
| | | // This implementation does not store entries. |
| | | } |
| | | |
| | |
| | | */ |
| | | public void handleLowMemory() |
| | | { |
| | | |
| | | // This implementation does not store entries, so there are no resources |
| | | // that it can free. |
| | | } |
| | |
| | | public void initializeSASLMechanismHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | this.configEntryDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | @Override() |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | DirectoryServer.deregisterSASLMechanismHandler(SASL_MECHANISM_DIGEST_MD5); |
| | | } |
| | |
| | | @Override() |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | | |
| | | |
| | | // The DIGEST-MD5 bind process uses two stages. See if the client provided |
| | | // any credentials. If not, then this is an initial authentication so we |
| | | // will send a challenge to the client. |
| | |
| | | */ |
| | | private String generateNonce() |
| | | { |
| | | |
| | | byte[] nonceBytes = new byte[16]; |
| | | |
| | | digestLock.lock(); |
| | |
| | | StringBuilder token) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // If the position is greater than or equal to the length, then we shouldn't |
| | | // do anything. |
| | | if (startPos >= length) |
| | |
| | | String qop, String charset) |
| | | throws UnsupportedEncodingException |
| | | { |
| | | |
| | | digestLock.lock(); |
| | | |
| | | try |
| | |
| | | String qop, String charset) |
| | | throws UnsupportedEncodingException |
| | | { |
| | | |
| | | digestLock.lock(); |
| | | |
| | | try |
| | |
| | | */ |
| | | private String getHexString(byte[] byteArray) |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(2*byteArray.length); |
| | | for (byte b : byteArray) |
| | | { |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | int msgID = MSGID_SASLDIGESTMD5_DESCRIPTION_IDENTITY_MAPPER_DN; |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // Look at the identity mapper configuration. |
| | | int msgID = MSGID_SASLDIGESTMD5_DESCRIPTION_IDENTITY_MAPPER_DN; |
| | | DNConfigAttribute mapperStub = |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | @Override() |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | | |
| | | // This is a password-based mechanism. |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | | |
| | | // This may be considered a secure mechanism. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public DigestMD5StateInfo(String nonce, String nonceCount) |
| | | { |
| | | |
| | | this.nonce = nonce; |
| | | this.nonceCount = nonceCount; |
| | | } |
| | |
| | | */ |
| | | public String getNonce() |
| | | { |
| | | |
| | | return nonce; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getNonceCount() |
| | | { |
| | | |
| | | return nonceCount; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setNonceCount(String nonceCount) |
| | | { |
| | | |
| | | this.nonceCount = nonceCount; |
| | | } |
| | | } |
| | |
| | | public void initializeStatusNotificationHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | configEntryDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | notificationType, |
| | | DN userDN, int messageID, String message) |
| | | { |
| | | |
| | | if (notificationTypes.contains(notificationType)) |
| | | { |
| | | int msgID = MSGID_ERRORLOG_ACCTNOTHANDLER_NOTIFICATION; |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | LinkedList<String> typeNames = new LinkedList<String>(); |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // Initialize the set of notification types that should generate log |
| | | // messages. |
| | | int msgID = MSGID_ERRORLOG_ACCTNOTHANDLER_DESCRIPTION_NOTIFICATION_TYPES; |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public void initializeIdentityMapper(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | configEntryDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | */ |
| | | public void finalizeIdentityMapper() |
| | | { |
| | | |
| | | |
| | | // Deregister with the server as a configurable component. |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | } |
| | |
| | | public Entry getEntryForID(String id) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Get the attribute type and base DN arrays as local variables to protect |
| | | // against concurrent modifications. |
| | | String[] matchAttrs = rawMatchAttributes; |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | String[] attrs = rawMatchAttributes; |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | boolean configAcceptable = true; |
| | | |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public void initializeSASLMechanismHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | this.configEntryDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | @Override() |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | DirectoryServer.deregisterSASLMechanismHandler(SASL_MECHANISM_EXTERNAL); |
| | | } |
| | |
| | | @Override() |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | | |
| | | |
| | | // Get the client connection used for the bind request, and get the |
| | | // security manager for that connection. If either are null, then fail. |
| | | ClientConnection clientConnection = bindOperation.getClientConnection(); |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | int msgID = MSGID_SASLEXTERNAL_DESCRIPTION_VALIDATION_POLICY; |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // Look at the validation policy configuration. |
| | | int msgID = MSGID_SASLEXTERNAL_DESCRIPTION_VALIDATION_POLICY; |
| | | MultiChoiceConfigAttribute validateStub = |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | @Override() |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | | |
| | | // This is not a password-based mechanism. |
| | | return false; |
| | | } |
| | |
| | | @Override() |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | | |
| | | // This may be considered a secure mechanism. |
| | | return true; |
| | | } |
| | |
| | | public void initializeEntryCache(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | configEntryDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | */ |
| | | public void finalizeEntryCache() |
| | | { |
| | | |
| | | |
| | | // Release all memory currently in use by this cache. |
| | | cacheLock.lock(); |
| | | |
| | |
| | | */ |
| | | public boolean containsEntry(DN entryDN) |
| | | { |
| | | |
| | | // Indicate whether the DN map contains the specified DN. |
| | | return dnMap.containsKey(entryDN); |
| | | } |
| | |
| | | */ |
| | | public Entry getEntry(DN entryDN) |
| | | { |
| | | |
| | | |
| | | // Simply return the entry from the DN map. |
| | | CacheEntry e = dnMap.get(entryDN); |
| | | if (e == null) |
| | |
| | | */ |
| | | public long getEntryID(DN entryDN) |
| | | { |
| | | |
| | | // Simply return the ID from the DN map. |
| | | CacheEntry e = dnMap.get(entryDN); |
| | | if (e == null) |
| | |
| | | */ |
| | | public Entry getEntry(DN entryDN, LockType lockType, List<Lock> lockList) |
| | | { |
| | | |
| | | |
| | | // Get the entry from the DN map if it is present. If not, then return |
| | | // null. |
| | | CacheEntry entry = dnMap.get(entryDN); |
| | |
| | | public Entry getEntry(Backend backend, long entryID, LockType lockType, |
| | | List<Lock> lockList) |
| | | { |
| | | |
| | | // Get the hash map for the provided backend. If it isn't present, then |
| | | // return null. |
| | | HashMap<Long,CacheEntry> map = idMap.get(backend); |
| | |
| | | */ |
| | | public void putEntry(Entry entry, Backend backend, long entryID) |
| | | { |
| | | |
| | | |
| | | // If there is a set of exclude filters, then make sure that the provided |
| | | // entry doesn't match any of them. |
| | | if (! excludeFilters.isEmpty()) |
| | |
| | | */ |
| | | public boolean putEntryIfAbsent(Entry entry, Backend backend, long entryID) |
| | | { |
| | | |
| | | |
| | | // If there is a set of exclude filters, then make sure that the provided |
| | | // entry doesn't match any of them. |
| | | if (! excludeFilters.isEmpty()) |
| | |
| | | */ |
| | | public void removeEntry(DN entryDN) |
| | | { |
| | | |
| | | |
| | | // Acquire the lock on the cache. We should not return until the entry is |
| | | // removed, so we will block until we can obtain the lock. |
| | | // FIXME -- An alternate approach could be to block for a maximum length of |
| | |
| | | */ |
| | | public void clear() |
| | | { |
| | | |
| | | // Acquire a lock on the cache. We should not return until the cache has |
| | | // been cleared, so we will block until we can obtain the lock. |
| | | cacheLock.lock(); |
| | |
| | | */ |
| | | public void clearBackend(Backend backend) |
| | | { |
| | | |
| | | // Acquire a lock on the cache. We should not return until the cache has |
| | | // been cleared, so we will block until we can obtain the lock. |
| | | cacheLock.lock(); |
| | |
| | | */ |
| | | public void clearSubtree(DN baseDN) |
| | | { |
| | | |
| | | |
| | | // Determine which backend should be used for the provided base DN. If |
| | | // there is none, then we don't need to do anything. |
| | | Backend backend = DirectoryServer.getBackend(baseDN); |
| | |
| | | */ |
| | | private void clearSubtree(DN baseDN, Backend backend) |
| | | { |
| | | |
| | | |
| | | // See if there are any entries for the provided backend in the cache. If |
| | | // not, then return. |
| | | HashMap<Long,CacheEntry> map = idMap.get(backend); |
| | |
| | | */ |
| | | public void handleLowMemory() |
| | | { |
| | | |
| | | |
| | | // Grab the lock on the cache and wait until we have it. |
| | | cacheLock.lock(); |
| | | |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // Start out assuming that the configuration is valid. |
| | | boolean configIsAcceptable = true; |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | // Create a set of variables to use for the result. |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | */ |
| | | public FileBasedKeyManagerProvider() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | public void initializeKeyManagerProvider(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // Store the DN of the configuration entry. |
| | | configEntryDN = configEntry.getDN(); |
| | | |
| | |
| | | */ |
| | | public void finalizeKeyManagerProvider() |
| | | { |
| | | |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | } |
| | | |
| | |
| | | public KeyManager[] getKeyManagers() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | KeyStore keyStore; |
| | | try |
| | | { |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | */ |
| | | public FileBasedTrustManagerProvider() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | public void initializeTrustManagerProvider(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // Store the DN of the configuration entry. |
| | | configEntryDN = configEntry.getDN(); |
| | | |
| | |
| | | */ |
| | | public void finalizeTrustManagerProvider() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | } |
| | | |
| | |
| | | public TrustManager[] getTrustManagers() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | KeyStore trustStore; |
| | | try |
| | | { |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // Make sure that a trust store file was provided. |
| | | int msgID = MSGID_FILE_TRUSTMANAGER_DESCRIPTION_FILE; |
| | | StringConfigAttribute fileStub = |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public FilteredStaticGroupMemberList(DN groupDN, Set<DN> memberDNs, DN baseDN, |
| | | SearchScope scope, SearchFilter filter) |
| | | { |
| | | |
| | | ensureNotNull(groupDN, memberDNs); |
| | | |
| | | this.groupDN = groupDN; |
| | |
| | | @Override() |
| | | public boolean hasMoreMembers() |
| | | { |
| | | |
| | | if (! memberDNIterator.hasNext()) |
| | | { |
| | | return false; |
| | |
| | | public DN nextMemberDN() |
| | | throws MembershipException |
| | | { |
| | | |
| | | if (! memberDNIterator.hasNext()) |
| | | { |
| | | return null; |
| | |
| | | public Entry nextMemberEntry() |
| | | throws MembershipException |
| | | { |
| | | |
| | | if (! memberDNIterator.hasNext()) |
| | | { |
| | | return null; |
| | |
| | | @Override() |
| | | public void close() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | } |
| | |
| | | public void initializeCertificateMapper(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | this.configEntryDN = configEntry.getDN(); |
| | | |
| | | // Get the attribute type that will be used to hold the fingerprint. |
| | |
| | | */ |
| | | public void finalizeCertificateMapper() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | } |
| | | |
| | |
| | | public Entry mapCertificateToUser(Certificate[] certificateChain) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Make sure that a peer certificate was provided. |
| | | if ((certificateChain == null) || (certificateChain.length == 0)) |
| | | { |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | int msgID = MSGID_FCM_DESCRIPTION_FINGERPRINT_ATTR; |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | boolean configAcceptable = true; |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public void initializeSASLMechanismHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | this.configEntryDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | @Override() |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | DirectoryServer.deregisterSASLMechanismHandler(SASL_MECHANISM_GSSAPI); |
| | | } |
| | |
| | | @Override() |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | | |
| | | |
| | | // GSSAPI binds use multiple stages, so we need to determine whether this is |
| | | // the first stage or a subsequent one. To do that, see if we have SASL |
| | | // state information in the client connection. |
| | |
| | | public Entry getUserForAuthzID(BindOperation bindOperation, String authzID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return identityMapper.getEntryForID(authzID); |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | int msgID = MSGID_SASLGSSAPI_DESCRIPTION_IDENTITY_MAPPER_DN; |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // Look at the identity mapper configuration |
| | | int msgID = MSGID_SASLGSSAPI_DESCRIPTION_IDENTITY_MAPPER_DN; |
| | | DNConfigAttribute mapperStub = |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | @Override() |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | | |
| | | // This is not a password-based mechanism. |
| | | return false; |
| | | } |
| | |
| | | @Override() |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | | |
| | | // This may be considered a secure mechanism. |
| | | return true; |
| | | } |
| | |
| | | BindOperation bindOperation, String serverFQDN) |
| | | throws InitializationException |
| | | { |
| | | |
| | | this.gssapiHandler = gssapiHandler; |
| | | this.bindOperation = bindOperation; |
| | | this.serverFQDN = serverFQDN; |
| | |
| | | */ |
| | | public void setBindOperation(BindOperation bindOperation) |
| | | { |
| | | |
| | | this.bindOperation = bindOperation; |
| | | } |
| | | |
| | |
| | | */ |
| | | public Entry getUserEntry() |
| | | { |
| | | |
| | | return userEntry; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void processAuthenticationStage() |
| | | { |
| | | |
| | | try |
| | | { |
| | | Subject.doAs(loginContext.getSubject(), this); |
| | |
| | | */ |
| | | public Boolean run() |
| | | { |
| | | |
| | | |
| | | if (saslServer == null) |
| | | { |
| | | // Create the SASL server instance for use with this authentication |
| | |
| | | public void handle(Callback[] callbacks) |
| | | throws UnsupportedCallbackException |
| | | { |
| | | |
| | | |
| | | for (Callback callback : callbacks) |
| | | { |
| | | if (callback instanceof NameCallback) |
| | |
| | | */ |
| | | public String getSecurityMechanismName() |
| | | { |
| | | |
| | | return "INTERNAL"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isSecure() |
| | | { |
| | | |
| | | // Internal connections are inherently secure. |
| | | return true; |
| | | } |
| | |
| | | SocketChannel socketChannel) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return new InternalConnectionSecurityProvider(clientConnection, |
| | | socketChannel); |
| | | } |
| | |
| | | public void initializeAlertHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | sequenceNumber = new AtomicLong(1); |
| | | |
| | | if (configEntry == null) |
| | |
| | | */ |
| | | public void finalizeAlertHandler() |
| | | { |
| | | |
| | | // No action is required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public ObjectName getObjectName() |
| | | { |
| | | |
| | | return objectName; |
| | | } |
| | | |
| | |
| | | public void sendAlertNotification(AlertGenerator generator, String alertType, |
| | | int alertID, String alertMessage) |
| | | { |
| | | |
| | | sendNotification(new Notification(alertType, generator.getClassName(), |
| | | sequenceNumber.getAndIncrement(), |
| | | System.currentTimeMillis(), |
| | |
| | | */ |
| | | public MBeanNotificationInfo[] getNotificationInfo() |
| | | { |
| | | |
| | | ArrayList<MBeanNotificationInfo> notifications = |
| | | new ArrayList<MBeanNotificationInfo>(); |
| | | ConcurrentHashMap<DN,JMXMBean> mBeans = DirectoryServer.getJMXMBeans(); |
| | |
| | | public Attribute getAttribute(String attribute) |
| | | throws AttributeNotFoundException |
| | | { |
| | | |
| | | // There are no attributes for this MBean. |
| | | int msgID = MSGID_CONFIG_JMX_ATTR_NO_ATTR; |
| | | String message = getMessage(msgID, String.valueOf(configEntryDN), |
| | |
| | | public void setAttribute(Attribute attribute) |
| | | throws AttributeNotFoundException, InvalidAttributeValueException |
| | | { |
| | | |
| | | |
| | | // There are no attributes for this MBean. |
| | | int msgID = MSGID_CONFIG_JMX_ATTR_NO_ATTR; |
| | | String message = getMessage(msgID, String.valueOf(configEntryDN), |
| | |
| | | */ |
| | | public AttributeList getAttributes(String[] attributes) |
| | | { |
| | | |
| | | |
| | | // There are no attributes for this MBean. |
| | | return new AttributeList(); |
| | | } |
| | |
| | | */ |
| | | public AttributeList setAttributes(AttributeList attributes) |
| | | { |
| | | |
| | | // There are no attributes for this MBean. |
| | | return new AttributeList(); |
| | | } |
| | |
| | | public Object invoke(String actionName, Object[] params, String[] signature) |
| | | throws MBeanException |
| | | { |
| | | |
| | | // There are no invokable components for this MBean. |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append(actionName); |
| | |
| | | */ |
| | | public MBeanInfo getMBeanInfo() |
| | | { |
| | | |
| | | return new MBeanInfo(CLASS_NAME, "JMX Alert Handler", |
| | | new MBeanAttributeInfo[0], new MBeanConstructorInfo[0], |
| | | new MBeanOperationInfo[0], getNotificationInfo()); |
| | |
| | | public void initializePasswordValidator(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | configEntryDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | @Override() |
| | | public void finalizePasswordValidator() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | } |
| | | |
| | |
| | | Operation operation, Entry userEntry, |
| | | StringBuilder invalidReason) |
| | | { |
| | | |
| | | |
| | | int numChars = newPassword.stringValue().length(); |
| | | |
| | | if ((minLength > 0) && (numChars < minLength)) |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | |
| | | LinkedList<ConfigAttribute> attrs = new LinkedList<ConfigAttribute>(); |
| | | |
| | | int msgID = MSGID_PWLENGTHVALIDATOR_DESCRIPTION_MIN_LENGTH; |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // Get the configured minimum length. |
| | | int newMinLength = 0; |
| | | int msgID = MSGID_PWLENGTHVALIDATOR_DESCRIPTION_MIN_LENGTH; |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public void initializePasswordStorageScheme(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | try |
| | | { |
| | | messageDigest = MessageDigest.getInstance(MESSAGE_DIGEST_ALGORITHM_MD5); |
| | |
| | | @Override() |
| | | public String getStorageSchemeName() |
| | | { |
| | | |
| | | return STORAGE_SCHEME_NAME_MD5; |
| | | } |
| | | |
| | |
| | | public ByteString encodePassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | byte[] digestBytes; |
| | | |
| | | digestLock.lock(); |
| | |
| | | public ByteString encodePasswordWithScheme(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append('{'); |
| | | buffer.append(STORAGE_SCHEME_NAME_MD5); |
| | |
| | | public boolean passwordMatches(ByteString plaintextPassword, |
| | | ByteString storedPassword) |
| | | { |
| | | |
| | | byte[] userPWDigestBytes; |
| | | |
| | | digestLock.lock(); |
| | |
| | | @Override() |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | | |
| | | // This storage scheme does not support the authentication password syntax. |
| | | return false; |
| | | } |
| | |
| | | public ByteString encodeAuthPassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | int msgID = MSGID_PWSCHEME_DOES_NOT_SUPPORT_AUTH_PASSWORD; |
| | | String message = getMessage(msgID, getStorageSchemeName()); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public boolean authPasswordMatches(ByteString plaintextPassword, |
| | | String authInfo, String authValue) |
| | | { |
| | | |
| | | |
| | | // This storage scheme does not support the authentication password syntax. |
| | | return false; |
| | | } |
| | |
| | | @Override() |
| | | public boolean isReversible() |
| | | { |
| | | |
| | | return false; |
| | | } |
| | | |
| | |
| | | public ByteString getPlaintextValue(ByteString storedPassword) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_NOT_REVERSIBLE; |
| | | String message = getMessage(msgID, STORAGE_SCHEME_NAME_MD5); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message, |
| | |
| | | String authValue) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_DOES_NOT_SUPPORT_AUTH_PASSWORD; |
| | | String message = getMessage(msgID, getStorageSchemeName()); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | @Override() |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | | |
| | | // MD5 may be considered reasonably secure for this purpose. |
| | | return true; |
| | | } |
| | |
| | | public void initializeConnectionSecurityProvider(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | clearBuffer = null; |
| | | clientConnection = null; |
| | | socketChannel = null; |
| | |
| | | */ |
| | | public void finalizeConnectionSecurityProvider() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getSecurityMechanismName() |
| | | { |
| | | |
| | | return "NULL"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isSecure() |
| | | { |
| | | |
| | | // This is not a secure provider. |
| | | return false; |
| | | } |
| | |
| | | SocketChannel socketChannel) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return new NullConnectionSecurityProvider(clientConnection, |
| | | socketChannel); |
| | | } |
| | |
| | | */ |
| | | public void disconnect(boolean connectionValid) |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public int getClearBufferSize() |
| | | { |
| | | |
| | | return BUFFER_SIZE; |
| | | } |
| | | |
| | |
| | | */ |
| | | public int getEncodedBufferSize() |
| | | { |
| | | |
| | | return BUFFER_SIZE; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean readData() |
| | | { |
| | | |
| | | clearBuffer.clear(); |
| | | while (true) |
| | | { |
| | |
| | | */ |
| | | public boolean writeData(ByteBuffer clearData) |
| | | { |
| | | |
| | | int position = clearData.position(); |
| | | int limit = clearData.limit(); |
| | | |
| | |
| | | */ |
| | | public NullKeyManagerProvider() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | public void initializeKeyManagerProvider(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public void finalizeKeyManagerProvider() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | public KeyManager[] getKeyManagers() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return new KeyManager[0]; |
| | | } |
| | | } |
| | |
| | | */ |
| | | public NullTrustManagerProvider() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | public void initializeTrustManagerProvider(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public void finalizeTrustManagerProvider() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | public TrustManager[] getTrustManagers() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return new TrustManager[0]; |
| | | } |
| | | } |
| | |
| | | */ |
| | | public PKCS11KeyManagerProvider() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | public void initializeKeyManagerProvider(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // Store the DN of the configuration entry. |
| | | configEntryDN = configEntry.getDN(); |
| | | |
| | |
| | | */ |
| | | public void finalizeKeyManagerProvider() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | } |
| | | |
| | |
| | | public KeyManager[] getKeyManagers() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | KeyStore keyStore; |
| | | try |
| | | { |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public void initializeExtendedOperationHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | configEntryDN = configEntry.getDN(); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_DESCRIPTION_ID_MAPPER; |
| | |
| | | */ |
| | | public void finalizeExtendedOperationHandler() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | |
| | | DirectoryServer.deregisterSupportedExtension(OID_PASSWORD_MODIFY_REQUEST); |
| | |
| | | */ |
| | | public void processExtendedOperation(ExtendedOperation operation) |
| | | { |
| | | |
| | | // Initialize the variables associated with components that may be included |
| | | // in the request. |
| | | ByteString userIdentity = null; |
| | |
| | | */ |
| | | private Entry getEntryByDN(ExtendedOperation operation, DN entryDN) |
| | | { |
| | | |
| | | // Retrieve the user's entry from the directory. If it does not exist, then |
| | | // fail. |
| | | try |
| | |
| | | */ |
| | | public Set<String> getSupportedControls() |
| | | { |
| | | |
| | | return supportedControlOIDs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | List<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | int msgID = MSGID_EXTOP_PASSMOD_DESCRIPTION_ID_MAPPER; |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // Make sure that the specified identity mapper is OK. |
| | | int msgID = MSGID_EXTOP_PASSMOD_DESCRIPTION_ID_MAPPER; |
| | | DNConfigAttribute mapperStub = |
| | |
| | | public void initializeSASLMechanismHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | this.configEntryDN = configEntry.getDN(); |
| | | |
| | | |
| | |
| | | @Override() |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | DirectoryServer.deregisterSASLMechanismHandler(SASL_MECHANISM_PLAIN); |
| | | } |
| | |
| | | @Override() |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | | |
| | | |
| | | // Get the SASL credentials provided by the user and decode them. |
| | | String authzID = null; |
| | | String authcID = null; |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | int msgID = MSGID_SASLPLAIN_DESCRIPTION_IDENTITY_MAPPER_DN; |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // Look at the identity mapper configuration. |
| | | int msgID = MSGID_SASLPLAIN_DESCRIPTION_IDENTITY_MAPPER_DN; |
| | | DNConfigAttribute mapperStub = |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | @Override() |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | | |
| | | // This is a password-based mechanism. |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | | |
| | | // This is not a secure mechanism. |
| | | return false; |
| | | } |
| | |
| | | public void initializePasswordGenerator(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | this.configEntryDN = configEntry.getDN(); |
| | | generatorLock = new ReentrantLock(); |
| | | |
| | |
| | | */ |
| | | public void finalizePasswordGenerator() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | } |
| | | |
| | |
| | | public ByteString generatePassword(Entry userEntry) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | StringBuilder buffer = new StringBuilder(totalLength); |
| | | |
| | | generatorLock.lock(); |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | ArrayList<String> charsetValues = new ArrayList<String>(); |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // Get the character sets for use in generating the password. At least one |
| | | // must have been provided. |
| | | HashMap<String,NamedCharacterSet> charsets = |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public void initializePasswordStorageScheme(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | try |
| | | { |
| | | messageDigest = MessageDigest.getInstance(MESSAGE_DIGEST_ALGORITHM_SHA_1); |
| | |
| | | @Override() |
| | | public String getStorageSchemeName() |
| | | { |
| | | |
| | | return STORAGE_SCHEME_NAME_SHA_1; |
| | | } |
| | | |
| | |
| | | public ByteString encodePassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | byte[] digestBytes; |
| | | |
| | | digestLock.lock(); |
| | |
| | | public ByteString encodePasswordWithScheme(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append('{'); |
| | | buffer.append(STORAGE_SCHEME_NAME_SHA_1); |
| | |
| | | public boolean passwordMatches(ByteString plaintextPassword, |
| | | ByteString storedPassword) |
| | | { |
| | | |
| | | byte[] userPWDigestBytes; |
| | | |
| | | digestLock.lock(); |
| | |
| | | @Override() |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | | |
| | | // This storage scheme does not support the authentication password syntax. |
| | | return false; |
| | | } |
| | |
| | | public ByteString encodeAuthPassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | int msgID = MSGID_PWSCHEME_DOES_NOT_SUPPORT_AUTH_PASSWORD; |
| | | String message = getMessage(msgID, getStorageSchemeName()); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public boolean authPasswordMatches(ByteString plaintextPassword, |
| | | String authInfo, String authValue) |
| | | { |
| | | |
| | | |
| | | // This storage scheme does not support the authentication password syntax. |
| | | return false; |
| | | } |
| | |
| | | @Override() |
| | | public boolean isReversible() |
| | | { |
| | | |
| | | return false; |
| | | } |
| | | |
| | |
| | | public ByteString getPlaintextValue(ByteString storedPassword) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_NOT_REVERSIBLE; |
| | | String message = getMessage(msgID, STORAGE_SCHEME_NAME_SHA_1); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message, |
| | |
| | | String authValue) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_DOES_NOT_SUPPORT_AUTH_PASSWORD; |
| | | String message = getMessage(msgID, getStorageSchemeName()); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | @Override() |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | | |
| | | // SHA-1 should be considered secure. |
| | | return true; |
| | | } |
| | |
| | | public void initializePasswordStorageScheme(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | try |
| | | { |
| | | messageDigest = MessageDigest.getInstance(MESSAGE_DIGEST_ALGORITHM_MD5); |
| | |
| | | @Override() |
| | | public String getStorageSchemeName() |
| | | { |
| | | |
| | | return STORAGE_SCHEME_NAME_SALTED_MD5; |
| | | } |
| | | |
| | |
| | | public ByteString encodePassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | byte[] plainBytes = plaintext.value(); |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] plainPlusSalt = new byte[plainBytes.length + NUM_SALT_BYTES]; |
| | |
| | | public ByteString encodePasswordWithScheme(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append('{'); |
| | | buffer.append(STORAGE_SCHEME_NAME_SALTED_MD5); |
| | |
| | | public boolean passwordMatches(ByteString plaintextPassword, |
| | | ByteString storedPassword) |
| | | { |
| | | |
| | | |
| | | // Base64-decode the stored value and take the last 8 bytes as the salt. |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] digestBytes; |
| | |
| | | @Override() |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | | |
| | | // This storage scheme does support the authentication password syntax. |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public String getAuthPasswordSchemeName() |
| | | { |
| | | |
| | | return AUTH_PASSWORD_SCHEME_NAME_SALTED_MD5; |
| | | } |
| | | |
| | |
| | | public ByteString encodeAuthPassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | byte[] plainBytes = plaintext.value(); |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] plainPlusSalt = new byte[plainBytes.length + NUM_SALT_BYTES]; |
| | |
| | | public boolean authPasswordMatches(ByteString plaintextPassword, |
| | | String authInfo, String authValue) |
| | | { |
| | | |
| | | |
| | | byte[] saltBytes; |
| | | byte[] digestBytes; |
| | | try |
| | |
| | | @Override() |
| | | public boolean isReversible() |
| | | { |
| | | |
| | | return false; |
| | | } |
| | | |
| | |
| | | public ByteString getPlaintextValue(ByteString storedPassword) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_NOT_REVERSIBLE; |
| | | String message = getMessage(msgID, STORAGE_SCHEME_NAME_SALTED_MD5); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message, |
| | |
| | | String authValue) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_NOT_REVERSIBLE; |
| | | String message = getMessage(msgID, AUTH_PASSWORD_SCHEME_NAME_SALTED_MD5); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message, |
| | |
| | | @Override() |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | | |
| | | // MD5 may be considered reasonably secure for this purpose. |
| | | return true; |
| | | } |
| | |
| | | public void initializePasswordStorageScheme(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | try |
| | | { |
| | | messageDigest = MessageDigest.getInstance(MESSAGE_DIGEST_ALGORITHM_SHA_1); |
| | |
| | | @Override() |
| | | public String getStorageSchemeName() |
| | | { |
| | | |
| | | return STORAGE_SCHEME_NAME_SALTED_SHA_1; |
| | | } |
| | | |
| | |
| | | public ByteString encodePassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | byte[] plainBytes = plaintext.value(); |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] plainPlusSalt = new byte[plainBytes.length + NUM_SALT_BYTES]; |
| | |
| | | public ByteString encodePasswordWithScheme(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append('{'); |
| | | buffer.append(STORAGE_SCHEME_NAME_SALTED_SHA_1); |
| | |
| | | public boolean passwordMatches(ByteString plaintextPassword, |
| | | ByteString storedPassword) |
| | | { |
| | | |
| | | |
| | | // Base64-decode the stored value and take the last 8 bytes as the salt. |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] digestBytes; |
| | |
| | | @Override() |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | | |
| | | // This storage scheme does support the authentication password syntax. |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public String getAuthPasswordSchemeName() |
| | | { |
| | | |
| | | return AUTH_PASSWORD_SCHEME_NAME_SALTED_SHA_1; |
| | | } |
| | | |
| | |
| | | public ByteString encodeAuthPassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | byte[] plainBytes = plaintext.value(); |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] plainPlusSalt = new byte[plainBytes.length + NUM_SALT_BYTES]; |
| | |
| | | public boolean authPasswordMatches(ByteString plaintextPassword, |
| | | String authInfo, String authValue) |
| | | { |
| | | |
| | | |
| | | byte[] saltBytes; |
| | | byte[] digestBytes; |
| | | try |
| | |
| | | @Override() |
| | | public boolean isReversible() |
| | | { |
| | | |
| | | return false; |
| | | } |
| | | |
| | |
| | | public ByteString getPlaintextValue(ByteString storedPassword) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_NOT_REVERSIBLE; |
| | | String message = getMessage(msgID, STORAGE_SCHEME_NAME_SALTED_SHA_1); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message, |
| | |
| | | String authValue) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_NOT_REVERSIBLE; |
| | | String message = getMessage(msgID, AUTH_PASSWORD_SCHEME_NAME_SALTED_SHA_1); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message, |
| | |
| | | @Override() |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | | |
| | | // SHA-1 should be considered secure. |
| | | return true; |
| | | } |
| | |
| | | public void initializePasswordStorageScheme(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | try |
| | | { |
| | | messageDigest = |
| | |
| | | @Override() |
| | | public String getStorageSchemeName() |
| | | { |
| | | |
| | | return STORAGE_SCHEME_NAME_SALTED_SHA_256; |
| | | } |
| | | |
| | |
| | | public ByteString encodePassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | byte[] plainBytes = plaintext.value(); |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] plainPlusSalt = new byte[plainBytes.length + NUM_SALT_BYTES]; |
| | |
| | | public ByteString encodePasswordWithScheme(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append('{'); |
| | | buffer.append(STORAGE_SCHEME_NAME_SALTED_SHA_256); |
| | |
| | | public boolean passwordMatches(ByteString plaintextPassword, |
| | | ByteString storedPassword) |
| | | { |
| | | |
| | | |
| | | // Base64-decode the stored value and take the last 8 bytes as the salt. |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] digestBytes; |
| | |
| | | @Override() |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | | |
| | | // This storage scheme does support the authentication password syntax. |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public String getAuthPasswordSchemeName() |
| | | { |
| | | |
| | | return AUTH_PASSWORD_SCHEME_NAME_SALTED_SHA_256; |
| | | } |
| | | |
| | |
| | | public ByteString encodeAuthPassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | byte[] plainBytes = plaintext.value(); |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] plainPlusSalt = new byte[plainBytes.length + NUM_SALT_BYTES]; |
| | |
| | | public boolean authPasswordMatches(ByteString plaintextPassword, |
| | | String authInfo, String authValue) |
| | | { |
| | | |
| | | |
| | | byte[] saltBytes; |
| | | byte[] digestBytes; |
| | | try |
| | |
| | | @Override() |
| | | public boolean isReversible() |
| | | { |
| | | |
| | | return false; |
| | | } |
| | | |
| | |
| | | public ByteString getPlaintextValue(ByteString storedPassword) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_NOT_REVERSIBLE; |
| | | String message = getMessage(msgID, STORAGE_SCHEME_NAME_SALTED_SHA_256); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message, |
| | |
| | | String authValue) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_NOT_REVERSIBLE; |
| | | String message = getMessage(msgID, |
| | | AUTH_PASSWORD_SCHEME_NAME_SALTED_SHA_256); |
| | |
| | | @Override() |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | | |
| | | // SHA-2 should be considered secure. |
| | | return true; |
| | | } |
| | |
| | | public void initializePasswordStorageScheme(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | try |
| | | { |
| | | messageDigest = |
| | |
| | | @Override() |
| | | public String getStorageSchemeName() |
| | | { |
| | | |
| | | return STORAGE_SCHEME_NAME_SALTED_SHA_384; |
| | | } |
| | | |
| | |
| | | public ByteString encodePassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | byte[] plainBytes = plaintext.value(); |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] plainPlusSalt = new byte[plainBytes.length + NUM_SALT_BYTES]; |
| | |
| | | public ByteString encodePasswordWithScheme(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append('{'); |
| | | buffer.append(STORAGE_SCHEME_NAME_SALTED_SHA_384); |
| | |
| | | public boolean passwordMatches(ByteString plaintextPassword, |
| | | ByteString storedPassword) |
| | | { |
| | | |
| | | |
| | | // Base64-decode the stored value and take the last 8 bytes as the salt. |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] digestBytes; |
| | |
| | | @Override() |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | | |
| | | // This storage scheme does support the authentication password syntax. |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public String getAuthPasswordSchemeName() |
| | | { |
| | | |
| | | return AUTH_PASSWORD_SCHEME_NAME_SALTED_SHA_384; |
| | | } |
| | | |
| | |
| | | public ByteString encodeAuthPassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | byte[] plainBytes = plaintext.value(); |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] plainPlusSalt = new byte[plainBytes.length + NUM_SALT_BYTES]; |
| | |
| | | public boolean authPasswordMatches(ByteString plaintextPassword, |
| | | String authInfo, String authValue) |
| | | { |
| | | |
| | | |
| | | byte[] saltBytes; |
| | | byte[] digestBytes; |
| | | try |
| | |
| | | @Override() |
| | | public boolean isReversible() |
| | | { |
| | | |
| | | return false; |
| | | } |
| | | |
| | |
| | | public ByteString getPlaintextValue(ByteString storedPassword) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_NOT_REVERSIBLE; |
| | | String message = getMessage(msgID, STORAGE_SCHEME_NAME_SALTED_SHA_384); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message, |
| | |
| | | String authValue) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_NOT_REVERSIBLE; |
| | | String message = getMessage(msgID, |
| | | AUTH_PASSWORD_SCHEME_NAME_SALTED_SHA_384); |
| | |
| | | @Override() |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | | |
| | | // SHA-2 should be considered secure. |
| | | return true; |
| | | } |
| | |
| | | public void initializePasswordStorageScheme(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | try |
| | | { |
| | | messageDigest = |
| | |
| | | @Override() |
| | | public String getStorageSchemeName() |
| | | { |
| | | |
| | | return STORAGE_SCHEME_NAME_SALTED_SHA_512; |
| | | } |
| | | |
| | |
| | | public ByteString encodePassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | byte[] plainBytes = plaintext.value(); |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] plainPlusSalt = new byte[plainBytes.length + NUM_SALT_BYTES]; |
| | |
| | | public ByteString encodePasswordWithScheme(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append('{'); |
| | | buffer.append(STORAGE_SCHEME_NAME_SALTED_SHA_512); |
| | |
| | | public boolean passwordMatches(ByteString plaintextPassword, |
| | | ByteString storedPassword) |
| | | { |
| | | |
| | | |
| | | // Base64-decode the stored value and take the last 8 bytes as the salt. |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] digestBytes; |
| | |
| | | @Override() |
| | | public boolean supportsAuthPasswordSyntax() |
| | | { |
| | | |
| | | // This storage scheme does support the authentication password syntax. |
| | | return true; |
| | | } |
| | |
| | | @Override() |
| | | public String getAuthPasswordSchemeName() |
| | | { |
| | | |
| | | return AUTH_PASSWORD_SCHEME_NAME_SALTED_SHA_512; |
| | | } |
| | | |
| | |
| | | public ByteString encodeAuthPassword(ByteString plaintext) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | byte[] plainBytes = plaintext.value(); |
| | | byte[] saltBytes = new byte[NUM_SALT_BYTES]; |
| | | byte[] plainPlusSalt = new byte[plainBytes.length + NUM_SALT_BYTES]; |
| | |
| | | public boolean authPasswordMatches(ByteString plaintextPassword, |
| | | String authInfo, String authValue) |
| | | { |
| | | |
| | | |
| | | byte[] saltBytes; |
| | | byte[] digestBytes; |
| | | try |
| | |
| | | @Override() |
| | | public boolean isReversible() |
| | | { |
| | | |
| | | return false; |
| | | } |
| | | |
| | |
| | | public ByteString getPlaintextValue(ByteString storedPassword) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_NOT_REVERSIBLE; |
| | | String message = getMessage(msgID, STORAGE_SCHEME_NAME_SALTED_SHA_512); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message, |
| | |
| | | String authValue) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_PWSCHEME_NOT_REVERSIBLE; |
| | | String message = getMessage(msgID, |
| | | AUTH_PASSWORD_SCHEME_NAME_SALTED_SHA_512); |
| | |
| | | @Override() |
| | | public boolean isStorageSchemeSecure() |
| | | { |
| | | |
| | | // SHA-2 should be considered secure. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public SimpleStaticGroupMemberList(DN groupDN, Set<DN> memberDNs) |
| | | { |
| | | |
| | | ensureNotNull(groupDN, memberDNs); |
| | | |
| | | this.groupDN = groupDN; |
| | |
| | | @Override() |
| | | public boolean hasMoreMembers() |
| | | { |
| | | |
| | | return memberDNIterator.hasNext(); |
| | | } |
| | | |
| | |
| | | public DN nextMemberDN() |
| | | throws MembershipException |
| | | { |
| | | |
| | | if (memberDNIterator.hasNext()) |
| | | { |
| | | return memberDNIterator.next(); |
| | |
| | | public Entry nextMemberEntry() |
| | | throws MembershipException |
| | | { |
| | | |
| | | if (memberDNIterator.hasNext()) |
| | | { |
| | | DN memberDN = memberDNIterator.next(); |
| | |
| | | @Override() |
| | | public void close() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | } |
| | |
| | | public void initializeEntryCache(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | dnMap.clear(); |
| | | idMap.clear(); |
| | | |
| | |
| | | */ |
| | | public void finalizeEntryCache() |
| | | { |
| | | |
| | | dnMap.clear(); |
| | | idMap.clear(); |
| | | } |
| | |
| | | */ |
| | | public boolean containsEntry(DN entryDN) |
| | | { |
| | | |
| | | // Indicate whether the DN map contains the specified DN. |
| | | return dnMap.containsKey(entryDN); |
| | | } |
| | |
| | | */ |
| | | public Entry getEntry(DN entryDN) |
| | | { |
| | | |
| | | SoftReference<CacheEntry> ref = dnMap.get(entryDN); |
| | | if (ref == null) |
| | | { |
| | |
| | | */ |
| | | public long getEntryID(DN entryDN) |
| | | { |
| | | |
| | | SoftReference<CacheEntry> ref = dnMap.get(entryDN); |
| | | if (ref == null) |
| | | { |
| | |
| | | public Entry getEntry(DN entryDN, LockType lockType, |
| | | List<Lock> lockList) |
| | | { |
| | | |
| | | SoftReference<CacheEntry> ref = dnMap.get(entryDN); |
| | | if (ref == null) |
| | | { |
| | |
| | | public Entry getEntry(Backend backend, long entryID, |
| | | LockType lockType, List<Lock> lockList) |
| | | { |
| | | |
| | | ConcurrentHashMap<Long,SoftReference<CacheEntry>> map = idMap.get(backend); |
| | | if (map == null) |
| | | { |
| | |
| | | */ |
| | | public void putEntry(Entry entry, Backend backend, long entryID) |
| | | { |
| | | |
| | | |
| | | // If there is a set of exclude filters, then make sure that the provided |
| | | // entry doesn't match any of them. |
| | | if (! excludeFilters.isEmpty()) |
| | |
| | | public boolean putEntryIfAbsent(Entry entry, Backend backend, |
| | | long entryID) |
| | | { |
| | | |
| | | |
| | | // If there is a set of exclude filters, then make sure that the provided |
| | | // entry doesn't match any of them. |
| | | if (! excludeFilters.isEmpty()) |
| | |
| | | */ |
| | | public void removeEntry(DN entryDN) |
| | | { |
| | | |
| | | |
| | | SoftReference<CacheEntry> ref = dnMap.remove(entryDN); |
| | | if (ref != null) |
| | | { |
| | |
| | | */ |
| | | public void clear() |
| | | { |
| | | |
| | | dnMap.clear(); |
| | | idMap.clear(); |
| | | } |
| | |
| | | */ |
| | | public void clearBackend(Backend backend) |
| | | { |
| | | |
| | | |
| | | // FIXME -- Would it be better just to dump everything? |
| | | ConcurrentHashMap<Long,SoftReference<CacheEntry>> map = |
| | | idMap.remove(backend); |
| | |
| | | */ |
| | | public void clearSubtree(DN baseDN) |
| | | { |
| | | |
| | | |
| | | // Determine the backend used to hold the specified base DN and clear it. |
| | | Backend backend = DirectoryServer.getBackend(baseDN); |
| | | if (backend == null) |
| | |
| | | */ |
| | | public void handleLowMemory() |
| | | { |
| | | |
| | | |
| | | // This function should automatically be taken care of by the nature of the |
| | | // soft references used in this cache. |
| | | // FIXME -- Do we need to do anything at all here? |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // Start out assuming that the configuration is valid. |
| | | boolean configIsAcceptable = true; |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | // Create a set of variables to use for the result. |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | |
| | | public void initializeExtendedOperationHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // FIXME -- Are there any configurable options that we should support? |
| | | DirectoryServer.registerSupportedExtension(OID_START_TLS_REQUEST, this); |
| | | } |
| | |
| | | */ |
| | | public void finalizeExtendedOperationHandler() |
| | | { |
| | | |
| | | DirectoryServer.deregisterSupportedExtension(OID_START_TLS_REQUEST); |
| | | } |
| | | |
| | |
| | | */ |
| | | public void processExtendedOperation(ExtendedOperation operation) |
| | | { |
| | | |
| | | |
| | | // We should always include the StartTLS OID in the response (the same OID |
| | | // is used for both the request and the response), so make sure that it will |
| | | // happen. |
| | |
| | | public void initializeGroupImplementation(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No additional initialization is required. |
| | | } |
| | | |
| | |
| | | public StaticGroup newInstance(Entry groupEntry) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | ensureNotNull(groupEntry); |
| | | |
| | | |
| | |
| | | public SearchFilter getGroupDefinitionFilter() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | // FIXME -- This needs to exclude enhanced groups once we have support for |
| | | // them. |
| | | String filterString = |
| | |
| | | @Override() |
| | | public DN getGroupDN() |
| | | { |
| | | |
| | | return groupEntryDN; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public boolean supportsNestedGroups() |
| | | { |
| | | |
| | | // FIXME -- We should add support for nested groups. |
| | | return false; |
| | | } |
| | |
| | | @Override() |
| | | public List<DN> getNestedGroupDNs() |
| | | { |
| | | |
| | | // FIXME -- We should add support for nested groups. |
| | | return Collections.<DN>emptyList(); |
| | | } |
| | |
| | | public void addNestedGroup(DN nestedGroupDN) |
| | | throws UnsupportedOperationException, DirectoryException |
| | | { |
| | | |
| | | // FIXME -- We should add support for nested groups. |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | |
| | | public void removeNestedGroup(DN nestedGroupDN) |
| | | throws UnsupportedOperationException, DirectoryException |
| | | { |
| | | |
| | | // FIXME -- We should add support for nested groups. |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | |
| | | public boolean isMember(DN userDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return memberDNs.contains(userDN); |
| | | } |
| | | |
| | |
| | | public boolean isMember(Entry userEntry) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return memberDNs.contains(userEntry.getDN()); |
| | | } |
| | | |
| | |
| | | public MemberList getMembers() |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return new SimpleStaticGroupMemberList(groupEntryDN, memberDNs); |
| | | } |
| | | |
| | |
| | | SearchFilter filter) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | if ((baseDN == null) && (filter == null)) |
| | | { |
| | | return new SimpleStaticGroupMemberList(groupEntryDN, memberDNs); |
| | |
| | | @Override() |
| | | public boolean mayAlterMemberList() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | public void addMember(Entry userEntry) |
| | | throws UnsupportedOperationException, DirectoryException |
| | | { |
| | | |
| | | ensureNotNull(userEntry); |
| | | |
| | | synchronized (this) |
| | |
| | | public void removeMember(DN userDN) |
| | | throws UnsupportedOperationException, DirectoryException |
| | | { |
| | | |
| | | ensureNotNull(userDN); |
| | | |
| | | synchronized (this) |
| | |
| | | @Override() |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("StaticGroup("); |
| | | buffer.append(groupEntryDN); |
| | | buffer.append(")"); |
| | |
| | | public void initializeCertificateMapper(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | this.configEntryDN = configEntry.getDN(); |
| | | |
| | | // Get the attribute that will be used to map subject attributes to user |
| | |
| | | */ |
| | | public void finalizeCertificateMapper() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | } |
| | | |
| | |
| | | public Entry mapCertificateToUser(Certificate[] certificateChain) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Make sure that a peer certificate was provided. |
| | | if ((certificateChain == null) || (certificateChain.length == 0)) |
| | | { |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | LinkedList<String> mapValues = new LinkedList<String>(); |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | boolean configAcceptable = true; |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public void initializeCertificateMapper(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | this.configEntryDN = configEntry.getDN(); |
| | | |
| | | // Get the attribute type that will be used to hold the certificate subject. |
| | |
| | | */ |
| | | public void finalizeCertificateMapper() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | } |
| | | |
| | |
| | | public Entry mapCertificateToUser(Certificate[] certificateChain) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Make sure that a peer certificate was provided. |
| | | if ((certificateChain == null) || (certificateChain.length == 0)) |
| | | { |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | int msgID = MSGID_SDTUACM_DESCRIPTION_SUBJECT_ATTR; |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | boolean configAcceptable = true; |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | DN configEntryDN = configEntry.getDN(); |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | public void initializeCertificateMapper(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No initialization is required. |
| | | } |
| | | |
| | |
| | | public Entry mapCertificateToUser(Certificate[] certificateChain) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Make sure that a peer certificate was provided. |
| | | if ((certificateChain == null) || (certificateChain.length == 0)) |
| | | { |
| | |
| | | public void initializeConnectionSecurityProvider(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // Initialize default values for the connection-specific variables. |
| | | clientConnection = null; |
| | | socketChannel = null; |
| | |
| | | */ |
| | | public void finalizeConnectionSecurityProvider() |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getSecurityMechanismName() |
| | | { |
| | | |
| | | return SSL_CONTEXT_INSTANCE_NAME; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isSecure() |
| | | { |
| | | |
| | | // This should be considered secure. |
| | | return true; |
| | | } |
| | |
| | | SocketChannel socketChannel) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | return new TLSConnectionSecurityProvider(clientConnection, socketChannel, |
| | | this); |
| | | } |
| | |
| | | */ |
| | | public void disconnect(boolean connectionValid) |
| | | { |
| | | |
| | | if (connectionValid) |
| | | { |
| | | try |
| | |
| | | */ |
| | | public int getClearBufferSize() |
| | | { |
| | | |
| | | return clearBufferSize; |
| | | } |
| | | |
| | |
| | | */ |
| | | public int getEncodedBufferSize() |
| | | { |
| | | |
| | | return sslBufferSize; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean readData() |
| | | { |
| | | |
| | | |
| | | while (true) |
| | | { |
| | | try |
| | |
| | | */ |
| | | public boolean writeData(ByteBuffer clearData) |
| | | { |
| | | |
| | | int originalPosition = clearData.position(); |
| | | int originalLimit = clearData.limit(); |
| | | int length = originalLimit - originalPosition; |
| | |
| | | */ |
| | | public String[] getEnabledProtocols() |
| | | { |
| | | |
| | | return enabledProtocols; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setEnabledProtocols(String[] enabledProtocols) |
| | | { |
| | | |
| | | this.enabledProtocols = enabledProtocols; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String[] getEnabledCipherSuites() |
| | | { |
| | | |
| | | return enabledCipherSuites; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setEnabledCipherSuites(String[] enabledCipherSuites) |
| | | { |
| | | |
| | | this.enabledCipherSuites = enabledCipherSuites; |
| | | } |
| | | |
| | |
| | | */ |
| | | public SSLClientAuthPolicy getSSLClientAuthPolicy() |
| | | { |
| | | |
| | | return sslClientAuthPolicy; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setSSLClientAuthPolicy(SSLClientAuthPolicy sslClientAuthPolicy) |
| | | { |
| | | |
| | | this.sslClientAuthPolicy = sslClientAuthPolicy; |
| | | } |
| | | |
| | |
| | | */ |
| | | public SSLSession getSSLSession() |
| | | { |
| | | |
| | | return sslEngine.getSession(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public Certificate[] getClientCertificateChain() |
| | | { |
| | | |
| | | try |
| | | { |
| | | return sslEngine.getSession().getPeerCertificates(); |
| | |
| | | */ |
| | | public TraditionalWorkQueue() |
| | | { |
| | | |
| | | // No implementation should be performed here. |
| | | } |
| | | |
| | |
| | | public void initializeWorkQueue(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | shutdownRequested = false; |
| | | killThreads = false; |
| | | opsSubmitted = new AtomicLong(0); |
| | |
| | | */ |
| | | public void finalizeWorkQueue(String reason) |
| | | { |
| | | |
| | | shutdownRequested = true; |
| | | |
| | | |
| | |
| | | */ |
| | | public boolean shutdownRequested() |
| | | { |
| | | |
| | | return shutdownRequested; |
| | | } |
| | | |
| | |
| | | public void submitOperation(Operation operation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | if (shutdownRequested) |
| | | { |
| | | int messageID = MSGID_OP_REJECTED_BY_SHUTDOWN; |
| | |
| | | */ |
| | | public Operation nextOperation(TraditionalWorkerThread workerThread) |
| | | { |
| | | |
| | | return retryNextOperation(workerThread, 0); |
| | | } |
| | | |
| | |
| | | private Operation retryNextOperation(TraditionalWorkerThread workerThread, |
| | | int numFailures) |
| | | { |
| | | |
| | | |
| | | // See if we should kill off this thread. This could be necessary if the |
| | | // number of worker threads has been decreased with the server online. If |
| | | // so, then return null and the thread will exit. |
| | |
| | | */ |
| | | public boolean removeOperation(Operation operation) |
| | | { |
| | | |
| | | return opQueue.remove(operation); |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getOpsSubmitted() |
| | | { |
| | | |
| | | return opsSubmitted.longValue(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getOpsRejectedDueToQueueFull() |
| | | { |
| | | |
| | | return queueFullRejects.longValue(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public int size() |
| | | { |
| | | |
| | | return opQueue.size(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | boolean configIsAcceptable = true; |
| | | |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ArrayList<String> resultMessages = new ArrayList<String>(); |
| | | int newNumThreads; |
| | | int newMaxCapacity; |
| | |
| | | */ |
| | | public boolean isIdle() |
| | | { |
| | | |
| | | if (opQueue.size() > 0) |
| | | { |
| | | return false; |
| | |
| | | */ |
| | | public void setStoppedByReducedThreadNumber() |
| | | { |
| | | |
| | | stoppedByReducedThreadNumber = true; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isActive() |
| | | { |
| | | |
| | | return (isAlive() && (operation != null)); |
| | | } |
| | | |
| | |
| | | */ |
| | | public void run() |
| | | { |
| | | |
| | | workerThread = currentThread(); |
| | | |
| | | while (! shutdownRequested) |
| | |
| | | */ |
| | | public void shutDown() |
| | | { |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | debugInfo(getName() + " being signaled to shut down."); |
| | |
| | | public void initializeExtendedOperationHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No special configuration is required. |
| | | |
| | | DirectoryServer.registerSupportedExtension(OID_WHO_AM_I_REQUEST, this); |
| | |
| | | */ |
| | | public void finalizeExtendedOperationHandler() |
| | | { |
| | | |
| | | DirectoryServer.deregisterSupportedExtension(OID_WHO_AM_I_REQUEST); |
| | | } |
| | | |
| | |
| | | */ |
| | | public void processExtendedOperation(ExtendedOperation operation) |
| | | { |
| | | |
| | | |
| | | // Get the client connection and determine the DN of the user associated |
| | | // with it. |
| | | ClientConnection clientConnection = operation.getClientConnection(); |
| | |
| | | */ |
| | | public LazyDN(String dnString) |
| | | { |
| | | |
| | | this.dnString = dnString; |
| | | this.decodedDN = null; |
| | | } |
| | |
| | | public boolean isNullDN() |
| | | throws RuntimeException |
| | | { |
| | | |
| | | return getDecodedDN().isNullDN(); |
| | | } |
| | | |
| | |
| | | public int getNumComponents() |
| | | throws RuntimeException |
| | | { |
| | | |
| | | return getDecodedDN().getNumComponents(); |
| | | } |
| | | |
| | |
| | | public RDN getRDN(int pos) |
| | | throws RuntimeException |
| | | { |
| | | |
| | | return getDecodedDN().getRDN(pos); |
| | | } |
| | | |
| | |
| | | public DN getParent() |
| | | throws RuntimeException |
| | | { |
| | | |
| | | return getDecodedDN().getParent(); |
| | | } |
| | | |
| | |
| | | public DN getParentDNInSuffix() |
| | | throws RuntimeException |
| | | { |
| | | |
| | | return getDecodedDN().getParentDNInSuffix(); |
| | | } |
| | | |
| | |
| | | public DN concat(RDN rdn) |
| | | throws RuntimeException |
| | | { |
| | | |
| | | return getDecodedDN().concat(rdn); |
| | | } |
| | | |
| | |
| | | public DN concat(RDN[] rdnComponents) |
| | | throws RuntimeException |
| | | { |
| | | |
| | | return getDecodedDN().concat(rdnComponents); |
| | | } |
| | | |
| | |
| | | public DN concat(DN relativeBaseDN) |
| | | throws RuntimeException |
| | | { |
| | | |
| | | return getDecodedDN().concat(relativeBaseDN); |
| | | } |
| | | |
| | |
| | | public boolean isDescendantOf(DN dn) |
| | | throws RuntimeException |
| | | { |
| | | |
| | | return getDecodedDN().isDescendantOf(dn); |
| | | } |
| | | |
| | |
| | | public boolean isAncestorOf(DN dn) |
| | | throws RuntimeException |
| | | { |
| | | |
| | | return getDecodedDN().isAncestorOf(dn); |
| | | } |
| | | |
| | |
| | | public boolean equals(Object o) |
| | | throws RuntimeException |
| | | { |
| | | |
| | | return getDecodedDN().equals(o); |
| | | } |
| | | |
| | |
| | | public int hashCode() |
| | | throws RuntimeException |
| | | { |
| | | |
| | | return getDecodedDN().hashCode(); |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public String toString() |
| | | { |
| | | |
| | | return dnString; |
| | | } |
| | | |
| | |
| | | @Override() |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append(dnString); |
| | | } |
| | | |
| | |
| | | public String toNormalizedString() |
| | | throws RuntimeException |
| | | { |
| | | |
| | | return getDecodedDN().toNormalizedString(); |
| | | } |
| | | |
| | |
| | | public void toNormalizedString(StringBuilder buffer) |
| | | throws RuntimeException |
| | | { |
| | | |
| | | getDecodedDN().toNormalizedString(buffer); |
| | | } |
| | | |
| | |
| | | public int compareTo(DN dn) |
| | | throws RuntimeException |
| | | { |
| | | |
| | | return getDecodedDN().compareTo(dn); |
| | | } |
| | | |
| | |
| | | private DN getDecodedDN() |
| | | throws RuntimeException |
| | | { |
| | | |
| | | if (decodedDN == null) |
| | | { |
| | | try |
| | |
| | | public void initializeAccessLogger(ConfigEntry configEntry) |
| | | throws ConfigException |
| | | { |
| | | |
| | | configDN = configEntry.getDN(); |
| | | |
| | | // FIXME - read the logger name from the config |
| | |
| | | public void logSearchResultEntry(SearchOperation searchOperation, |
| | | SearchResultEntry searchEntry) |
| | | { |
| | | |
| | | // NYI |
| | | } |
| | | |
| | |
| | | public void initializeAccessLogger(ConfigEntry configEntry) |
| | | throws ConfigException |
| | | { |
| | | |
| | | configDN = configEntry.getDN(); |
| | | |
| | | // FIXME - read the logger name from the config |
| | |
| | | public void initializeErrorLogger(ConfigEntry configEntry) |
| | | throws ConfigException |
| | | { |
| | | |
| | | configDN = configEntry.getDN(); |
| | | defaultSeverities = new HashSet<ErrorLogSeverity>(); |
| | | |
| | |
| | | */ |
| | | public FileNumberRetentionPolicy(String dir, String prefix, int numFiles) |
| | | { |
| | | |
| | | this.numFiles = numFiles; |
| | | this.directory = new File(dir); |
| | | this.prefix = prefix; |
| | |
| | | */ |
| | | public int deleteFiles() |
| | | { |
| | | |
| | | int count = 0; |
| | | |
| | | File[] selectedFiles = directory.listFiles(new LogFileFilter(prefix)); |
| | |
| | | |
| | | public FixedTimeRotationPolicy(int[] timeOfDays) |
| | | { |
| | | |
| | | Calendar cal = new GregorianCalendar(); |
| | | cal.set( Calendar.MILLISECOND, 0 ); |
| | | cal.set( Calendar.SECOND, 0 ); |
| | |
| | | */ |
| | | public boolean rotateFile() |
| | | { |
| | | |
| | | long currTime = TimeThread.getTime(); |
| | | if (debugEnabled()) |
| | | { |
| | |
| | | public FreeDiskSpaceRetentionPolicy(String dir, String prefix, |
| | | long freeDiskSpace) |
| | | { |
| | | |
| | | this.directory = new File(dir); |
| | | this.freeDiskSpace = freeDiskSpace; |
| | | this.prefix = prefix; |
| | |
| | | */ |
| | | public int deleteFiles() |
| | | { |
| | | |
| | | int count = 0; |
| | | long freeSpace = 0; |
| | | try |
| | |
| | | */ |
| | | public void run() |
| | | { |
| | | |
| | | |
| | | this.loggerThread = Thread.currentThread(); |
| | | |
| | | while (!stopRequested) |
| | |
| | | */ |
| | | public String getShutdownListenerName() |
| | | { |
| | | |
| | | |
| | | return "Logger Thread " + getName(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public void processServerShutdown(String reason) |
| | | { |
| | | |
| | | |
| | | stopRequested = true; |
| | | |
| | | try |
| | |
| | | getRotationPolicies(ConfigEntry configEntry) |
| | | throws ConfigException |
| | | { |
| | | |
| | | HashSet<String> allowedValues = new HashSet<String>(); |
| | | allowedValues.add("size"); |
| | | allowedValues.add("timeofday"); |
| | |
| | | getRetentionPolicies(ConfigEntry configEntry) |
| | | throws ConfigException |
| | | { |
| | | |
| | | StringConfigAttribute logFileStub = |
| | | new StringConfigAttribute(ATTR_LOGGER_FILE, |
| | | getMessage(MSGID_CONFIG_LOGGER_DESCRIPTION_CLASS_NAME), |
| | |
| | | getPostRotationActions(ConfigEntry configEntry) |
| | | throws ConfigException |
| | | { |
| | | |
| | | ArrayList<ActionType> actions = new ArrayList<ActionType>(); |
| | | |
| | | StringConfigAttribute rotationActionStub = |
| | |
| | | public static int getIntegerAttribute(ConfigEntry configEntry, |
| | | String attrName, int msgID) throws ConfigException |
| | | { |
| | | |
| | | int value = -1; |
| | | |
| | | IntegerConfigAttribute attrStub = |
| | |
| | | */ |
| | | public SizeBasedRetentionPolicy(String dir, String prefix, long size) |
| | | { |
| | | |
| | | this.size = size; |
| | | this.directory = new File(dir); |
| | | this.prefix = prefix; |
| | |
| | | */ |
| | | public int deleteFiles() |
| | | { |
| | | |
| | | int count = 0; |
| | | |
| | | File[] selectedFiles = directory.listFiles(new LogFileFilter(prefix)); |
| | |
| | | */ |
| | | public SizeBasedRotationPolicy(long size) |
| | | { |
| | | |
| | | sizeLimit = size; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean rotateFile() |
| | | { |
| | | |
| | | if (fileHandler.getFileSize() >= sizeLimit) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | */ |
| | | public TimeLimitRotationPolicy(long time) |
| | | { |
| | | |
| | | timeInterval = time; |
| | | lastModifiedTime = TimeThread.getTime(); |
| | | } |
| | |
| | | */ |
| | | public boolean rotateFile() |
| | | { |
| | | |
| | | long currTime = TimeThread.getTime(); |
| | | if (currTime - lastModifiedTime > timeInterval) |
| | | { |
| | |
| | | */ |
| | | public void initializeMonitorProvider(ConfigEntry configEntry) |
| | | { |
| | | |
| | | monitorName = backend.getBackendID() + " Backend"; |
| | | |
| | | backendIDType = DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_ID, |
| | |
| | | */ |
| | | public String getMonitorInstanceName() |
| | | { |
| | | |
| | | return monitorName; |
| | | } |
| | | |
| | |
| | | */ |
| | | public ObjectClass getMonitorObjectClass() |
| | | { |
| | | |
| | | return DirectoryConfig.getObjectClass(OC_MONITOR_BACKEND, true); |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getUpdateInterval() |
| | | { |
| | | |
| | | // We don't need do anything on a periodic basis. |
| | | return 0; |
| | | } |
| | |
| | | */ |
| | | public void updateMonitorData() |
| | | { |
| | | |
| | | // No implementaiton is required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<Attribute> getMonitorData() |
| | | { |
| | | |
| | | LinkedList<Attribute> attrs = new LinkedList<Attribute>(); |
| | | |
| | | LinkedHashSet<AttributeValue> values = new LinkedHashSet<AttributeValue>(); |
| | |
| | | */ |
| | | public void initializeMonitorProvider(ConfigEntry configEntry) |
| | | { |
| | | |
| | | monitorName = connectionHandler.getConnectionHandlerName(); |
| | | |
| | | connectionsType = |
| | |
| | | */ |
| | | public String getMonitorInstanceName() |
| | | { |
| | | |
| | | return monitorName; |
| | | } |
| | | |
| | |
| | | */ |
| | | public ObjectClass getMonitorObjectClass() |
| | | { |
| | | |
| | | return DirectoryConfig.getObjectClass(OC_MONITOR_CONNHANDLER, true); |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getUpdateInterval() |
| | | { |
| | | |
| | | // We don't need do anything on a periodic basis. |
| | | return 0; |
| | | } |
| | |
| | | */ |
| | | public void updateMonitorData() |
| | | { |
| | | |
| | | // No implementaiton is required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<Attribute> getMonitorData() |
| | | { |
| | | |
| | | LinkedList<Attribute> attrs = new LinkedList<Attribute>(); |
| | | |
| | | int numConnections = 0; |
| | |
| | | public void initializeMonitorProvider(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No initialization is required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getMonitorInstanceName() |
| | | { |
| | | |
| | | return "JVM Stack Trace"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getUpdateInterval() |
| | | { |
| | | |
| | | // This monitor does not need to run periodically. |
| | | return 0; |
| | | } |
| | |
| | | */ |
| | | public void updateMonitorData() |
| | | { |
| | | |
| | | // This monitor does not need to run periodically. |
| | | return; |
| | | } |
| | |
| | | */ |
| | | public ArrayList<Attribute> getMonitorData() |
| | | { |
| | | |
| | | |
| | | Map<Thread,StackTraceElement[]> threadStacks = Thread.getAllStackTraces(); |
| | | |
| | | |
| | |
| | | public void initializeMonitorProvider(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No initialization is required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getMonitorInstanceName() |
| | | { |
| | | |
| | | return "System Information"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getUpdateInterval() |
| | | { |
| | | |
| | | // This monitor does not need to run periodically. |
| | | return 0; |
| | | } |
| | |
| | | */ |
| | | public void updateMonitorData() |
| | | { |
| | | |
| | | // This monitor does not need to run periodically. |
| | | return; |
| | | } |
| | |
| | | */ |
| | | public ArrayList<Attribute> getMonitorData() |
| | | { |
| | | |
| | | |
| | | ArrayList<Attribute> attrs = new ArrayList<Attribute>(12); |
| | | |
| | | attrs.add(createAttribute("javaVersion", |
| | |
| | | */ |
| | | private Attribute createAttribute(String name, String value) |
| | | { |
| | | |
| | | AttributeType attrType = DirectoryServer.getDefaultAttributeType(name); |
| | | |
| | | ASN1OctetString encodedValue = new ASN1OctetString(value); |
| | |
| | | public void initializeMonitorProvider(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | maxBacklog = 0; |
| | | totalBacklog = 0; |
| | | numPolls = 0; |
| | |
| | | */ |
| | | public String getMonitorInstanceName() |
| | | { |
| | | |
| | | return "Work Queue"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getUpdateInterval() |
| | | { |
| | | |
| | | |
| | | // We will poll the work queue every 10 seconds. |
| | | return 10000; |
| | | } |
| | |
| | | */ |
| | | public void updateMonitorData() |
| | | { |
| | | |
| | | int backlog = workQueue.size(); |
| | | totalBacklog += backlog; |
| | | numPolls++; |
| | |
| | | */ |
| | | public ArrayList<Attribute> getMonitorData() |
| | | { |
| | | |
| | | int backlog = workQueue.size(); |
| | | totalBacklog += backlog; |
| | | numPolls++; |
| | |
| | | public void initializeMonitorProvider(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | // No initialization is required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getMonitorInstanceName() |
| | | { |
| | | |
| | | return "Version"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getUpdateInterval() |
| | | { |
| | | |
| | | // This monitor does not need to run periodically. |
| | | return 0; |
| | | } |
| | |
| | | */ |
| | | public void updateMonitorData() |
| | | { |
| | | |
| | | // This monitor does not need to run periodically. |
| | | return; |
| | | } |
| | |
| | | */ |
| | | public ArrayList<Attribute> getMonitorData() |
| | | { |
| | | |
| | | |
| | | ArrayList<Attribute> attrs = new ArrayList<Attribute>(8); |
| | | |
| | | attrs.add(createAttribute("productName", DynamicConstants.PRODUCT_NAME)); |
| | |
| | | */ |
| | | private Attribute createAttribute(String name, String value) |
| | | { |
| | | |
| | | AttributeType attrType = DirectoryServer.getDefaultAttributeType(name); |
| | | |
| | | ASN1OctetString encodedValue = new ASN1OctetString(value); |
| | |
| | | ConfigEntry configEntry) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // Make sure that the plugin has been enabled for the appropriate types. |
| | | for (PluginType t : pluginTypes) |
| | | { |
| | |
| | | public final LDIFPluginResult doLDIFImport(LDIFImportConfig importConfig, |
| | | Entry entry) |
| | | { |
| | | |
| | | |
| | | // See if the entry being imported already contains an entryUUID attribute. |
| | | // If so, then leave it alone. |
| | | List<Attribute> uuidList = entry.getAttribute(entryUUIDType); |
| | |
| | | public final PreOperationPluginResult |
| | | doPreOperation(PreOperationAddOperation addOperation) |
| | | { |
| | | |
| | | |
| | | // See if the entry being added already contains an entryUUID attribute. |
| | | // It shouldn't, since it's NO-USER-MODIFICATION, but if it does then leave |
| | | // it alone. |
| | |
| | | ConfigEntry configEntry) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // The set of plugin types must contain only the pre-parse search element. |
| | | if (pluginTypes.isEmpty()) |
| | | { |
| | |
| | | public final PreParsePluginResult |
| | | doPreParse(PreParseSearchOperation searchOperation) |
| | | { |
| | | |
| | | |
| | | // Iterate through the requested attributes to see if any of them start with |
| | | // an "@" symbol. If not, then we don't need to do anything. If so, then |
| | | // keep track of them. |
| | |
| | | ConfigEntry configEntry) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // Make sure that the plugin has been enabled for the appropriate types. |
| | | for (PluginType t : pluginTypes) |
| | | { |
| | |
| | | public final PreOperationPluginResult |
| | | doPreOperation(PreOperationAddOperation addOperation) |
| | | { |
| | | |
| | | |
| | | // Create the attribute list for the creatorsName attribute, if appropriate. |
| | | DN creatorDN = addOperation.getAuthorizationDN(); |
| | | LinkedHashSet<AttributeValue> nameValues = |
| | |
| | | public final PreOperationPluginResult |
| | | doPreOperation(PreOperationModifyOperation modifyOperation) |
| | | { |
| | | |
| | | |
| | | // Create the modifiersName attribute. |
| | | DN modifierDN = modifyOperation.getAuthorizationDN(); |
| | | LinkedHashSet<AttributeValue> nameValues = |
| | |
| | | public final PreOperationPluginResult |
| | | doPreOperation(PreOperationModifyDNOperation modifyDNOperation) |
| | | { |
| | | |
| | | |
| | | // Create the modifiersName attribute. |
| | | DN modifierDN = modifyDNOperation.getAuthorizationDN(); |
| | | LinkedHashSet<AttributeValue> nameValues = |
| | |
| | | ConfigEntry configEntry) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // Make sure that the plugin has been enabled for the appropriate types. |
| | | for (PluginType t : pluginTypes) |
| | | { |
| | |
| | | public final LDIFPluginResult doLDIFImport(LDIFImportConfig importConfig, |
| | | Entry entry) |
| | | { |
| | | |
| | | |
| | | // Create a list that we will use to hold new encoded values. |
| | | ArrayList<ByteString> encodedValueList = new ArrayList<ByteString>(); |
| | | |
| | |
| | | */ |
| | | public ProfileStack(StackTraceElement[] stackElements) |
| | | { |
| | | |
| | | numFrames = stackElements.length; |
| | | classNames = new String[numFrames]; |
| | | methodNames = new String[numFrames]; |
| | |
| | | private ProfileStack(String[] classNames, String[] methodNames, |
| | | int[] lineNumbers) |
| | | { |
| | | |
| | | this.numFrames = classNames.length; |
| | | this.classNames = classNames; |
| | | this.methodNames = methodNames; |
| | |
| | | */ |
| | | public int getNumFrames() |
| | | { |
| | | |
| | | return numFrames; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String[] getClassNames() |
| | | { |
| | | |
| | | return classNames; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getClassName(int depth) |
| | | { |
| | | |
| | | return classNames[depth]; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String[] getMethodNames() |
| | | { |
| | | |
| | | return methodNames; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getMethodName(int depth) |
| | | { |
| | | |
| | | return methodNames[depth]; |
| | | } |
| | | |
| | |
| | | */ |
| | | public int[] getLineNumbers() |
| | | { |
| | | |
| | | return lineNumbers; |
| | | } |
| | | |
| | |
| | | */ |
| | | public int getLineNumber(int depth) |
| | | { |
| | | |
| | | return lineNumbers[depth]; |
| | | } |
| | | |
| | |
| | | */ |
| | | public int hashCode() |
| | | { |
| | | |
| | | if (numFrames == 0) |
| | | { |
| | | return 0; |
| | |
| | | */ |
| | | public boolean equals(Object o) |
| | | { |
| | | |
| | | if (o == null) |
| | | { |
| | | return false; |
| | |
| | | */ |
| | | public ASN1Element encode() |
| | | { |
| | | |
| | | ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(3*numFrames); |
| | | for (int i=0; i < numFrames; i++) |
| | | { |
| | |
| | | */ |
| | | public static ProfileStack decode(ASN1Element stackElement) |
| | | { |
| | | |
| | | try |
| | | { |
| | | ArrayList<ASN1Element> elements = |
| | |
| | | */ |
| | | public ProfileStackFrame(String className, String methodName) |
| | | { |
| | | |
| | | this.className = className; |
| | | this.methodName = methodName; |
| | | |
| | |
| | | */ |
| | | public String getClassName() |
| | | { |
| | | |
| | | return className; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getMethodName() |
| | | { |
| | | |
| | | return methodName; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getHTMLSafeMethodName() |
| | | { |
| | | |
| | | int length = methodName.length(); |
| | | StringBuilder buffer = new StringBuilder(length + 6); |
| | | |
| | |
| | | */ |
| | | public HashMap<Integer,Long> getLineNumbers() |
| | | { |
| | | |
| | | return lineNumbers; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void updateLineNumberCount(int lineNumber, long numOccurrences) |
| | | { |
| | | |
| | | Long existingCount = lineNumbers.get(lineNumber); |
| | | if (existingCount == null) |
| | | { |
| | |
| | | */ |
| | | public long getTotalCount() |
| | | { |
| | | |
| | | long totalCount = 0; |
| | | |
| | | for (Long l : lineNumbers.values()) |
| | |
| | | */ |
| | | public ProfileStackFrame[] getSubordinateFrames() |
| | | { |
| | | |
| | | ProfileStackFrame[] subFrames = new ProfileStackFrame[0]; |
| | | subFrames = subordinateFrames.values().toArray(subFrames); |
| | | |
| | |
| | | */ |
| | | public boolean hasSubFrames() |
| | | { |
| | | |
| | | return (! subordinateFrames.isEmpty()); |
| | | } |
| | | |
| | |
| | | public void recurseSubFrames(ProfileStack stack, int depth, long count, |
| | | HashMap<String,HashMap<ProfileStack,Long>> stacksByMethod) |
| | | { |
| | | |
| | | if (depth < 0) |
| | | { |
| | | return; |
| | |
| | | */ |
| | | public int hashCode() |
| | | { |
| | | |
| | | return (className.hashCode() + methodName.hashCode()); |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean equals(Object o) |
| | | { |
| | | |
| | | if (o == null) |
| | | { |
| | | return false; |
| | |
| | | public int compareTo(Object o) |
| | | throws ClassCastException |
| | | { |
| | | |
| | | ProfileStackFrame f; |
| | | try |
| | | { |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append(getTotalCount()); |
| | | buffer.append(" "); |
| | |
| | | ConfigEntry configEntry) |
| | | throws ConfigException |
| | | { |
| | | |
| | | |
| | | // Initialize the set of profiler actions. |
| | | profilerActions = new LinkedHashSet<String>(4); |
| | | profilerActions.add(PROFILE_ACTION_NONE); |
| | |
| | | @Override() |
| | | public final void finalizePlugin() |
| | | { |
| | | |
| | | |
| | | // If the profiler thread is still active, then cause it to dump the |
| | | // information it has captured and exit. |
| | | synchronized (this) |
| | |
| | | @Override() |
| | | public final StartupPluginResult doStartup() |
| | | { |
| | | |
| | | // If the profiler should be started automatically, then do so now. |
| | | if (autoStart) |
| | | { |
| | |
| | | */ |
| | | public final DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public final List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | LinkedList<ConfigAttribute> attrList = new LinkedList<ConfigAttribute>(); |
| | | |
| | | |
| | |
| | | public final boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // See if there is an acceptable value for the sample interval. |
| | | int msgID = MSGID_PLUGIN_PROFILER_DESCRIPTION_INTERVAL; |
| | | IntegerWithUnitConfigAttribute intervalStub = |
| | |
| | | public final ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |
| | |
| | | */ |
| | | public void run() |
| | | { |
| | | |
| | | captureThread = currentThread(); |
| | | captureStartTime = System.currentTimeMillis(); |
| | | |
| | |
| | | */ |
| | | public void stopProfiling() |
| | | { |
| | | |
| | | stopProfiling = true; |
| | | |
| | | try |
| | |
| | | public void writeCaptureData(String filename) |
| | | throws IOException |
| | | { |
| | | |
| | | |
| | | // Open the capture file for writing. We'll use an ASN.1 writer to write |
| | | // the data. |
| | | ASN1Writer writer = new ASN1Writer(new FileOutputStream(filename)); |
| | |
| | | */ |
| | | public boolean booleanValue() |
| | | { |
| | | |
| | | return booleanValue; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setValue(boolean booleanValue) |
| | | { |
| | | |
| | | this.booleanValue = booleanValue; |
| | | setValueInternal(encodeValue(booleanValue)); |
| | | } |
| | |
| | | public void setValue(byte[] value) |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | if (value == null) |
| | | { |
| | | int msgID = MSGID_ASN1_BOOLEAN_SET_VALUE_NULL; |
| | |
| | | public static ASN1Boolean decodeAsBoolean(ASN1Element element) |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | if (element == null) |
| | | { |
| | | int msgID = MSGID_ASN1_BOOLEAN_DECODE_ELEMENT_NULL; |
| | |
| | | public static ASN1Boolean decodeAsBoolean(byte[] encodedElement) |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | // First make sure that the array is not null and long enough to contain |
| | | // a valid ASN.1 Boolean element. |
| | | if (encodedElement == null) |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("ASN1Boolean(type="); |
| | | buffer.append(byteToHex(getType())); |
| | | buffer.append(", value="); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer, int indent) |
| | | { |
| | | |
| | | StringBuilder indentBuf = new StringBuilder(indent); |
| | | for (int i=0 ; i < indent; i++) |
| | | { |
| | |
| | | */ |
| | | public ASN1Element(byte type) |
| | | { |
| | | |
| | | this.type = type; |
| | | this.value = NO_VALUE; |
| | | } |
| | |
| | | */ |
| | | public ASN1Element(byte type, byte[] value) |
| | | { |
| | | |
| | | this.type = type; |
| | | |
| | | if (value == null) |
| | |
| | | */ |
| | | public byte getType() |
| | | { |
| | | |
| | | return type; |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setType(byte type) |
| | | { |
| | | |
| | | this.type = type; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isUniversal() |
| | | { |
| | | |
| | | return ((type & TYPE_MASK_ALL_BUT_CLASS) == TYPE_MASK_UNIVERSAL); |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isApplicationSpecific() |
| | | { |
| | | |
| | | return ((type & TYPE_MASK_ALL_BUT_CLASS) == TYPE_MASK_APPLICATION); |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isContextSpecific() |
| | | { |
| | | |
| | | return ((type & TYPE_MASK_ALL_BUT_CLASS) == TYPE_MASK_CONTEXT); |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isPrivate() |
| | | { |
| | | |
| | | return ((type & TYPE_MASK_ALL_BUT_CLASS) == TYPE_MASK_PRIVATE); |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isPrimitive() |
| | | { |
| | | |
| | | return ((type & TYPE_MASK_ALL_BUT_PC) == TYPE_MASK_PRIMITIVE); |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isConstructed() |
| | | { |
| | | |
| | | return ((type & TYPE_MASK_ALL_BUT_PC) == TYPE_MASK_CONSTRUCTED); |
| | | } |
| | | |
| | |
| | | */ |
| | | public byte[] value() |
| | | { |
| | | |
| | | return value; |
| | | } |
| | | |
| | |
| | | public void setValue(byte[] value) |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | if (value == null) |
| | | { |
| | | this.value = NO_VALUE; |
| | |
| | | */ |
| | | protected final void setValueInternal(byte[] value) |
| | | { |
| | | |
| | | this.value = value; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static byte[] encodeLength(int length) |
| | | { |
| | | |
| | | if (length < 128) |
| | | { |
| | | return new byte[] { (byte) length }; |
| | |
| | | */ |
| | | public byte[] encode() |
| | | { |
| | | |
| | | if (value.length == 0) |
| | | { |
| | | return new byte[] { type, 0x00 }; |
| | |
| | | */ |
| | | public static byte[] encodeValue(boolean booleanValue) |
| | | { |
| | | |
| | | return (booleanValue ? BOOLEAN_VALUE_TRUE : BOOLEAN_VALUE_FALSE); |
| | | } |
| | | |
| | |
| | | */ |
| | | public static byte[] encodeValue(int intValue) |
| | | { |
| | | |
| | | if ((intValue & 0x0000007F) == intValue) |
| | | { |
| | | return new byte[] |
| | |
| | | */ |
| | | public static byte[] encodeLongValue(long longValue) |
| | | { |
| | | |
| | | if ((longValue & 0x000000000000007FL) == longValue) |
| | | { |
| | | return new byte[] |
| | |
| | | */ |
| | | public static byte[] encodeValue(ArrayList<ASN1Element> elements) |
| | | { |
| | | |
| | | if (elements == null) |
| | | { |
| | | return NO_VALUE; |
| | |
| | | public static ASN1Element decode(byte[] encodedElement) |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | |
| | | // First make sure that the array is not null and long enough to contain |
| | | // a valid ASN.1 element. |
| | | if (encodedElement == null) |
| | |
| | | int length) |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | |
| | | // First make sure that the array is not null and long enough to contain |
| | | // a valid ASN.1 element. |
| | | if (encodedElement == null) |
| | |
| | | public ASN1Boolean decodeAsBoolean() |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | return ASN1Boolean.decodeAsBoolean(this); |
| | | } |
| | | |
| | |
| | | public ASN1Enumerated decodeAsEnumerated() |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | return ASN1Enumerated.decodeAsEnumerated(this); |
| | | } |
| | | |
| | |
| | | public ASN1Integer decodeAsInteger() |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | return ASN1Integer.decodeAsInteger(this); |
| | | } |
| | | |
| | |
| | | public ASN1Long decodeAsLong() |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | return ASN1Long.decodeAsLong(this); |
| | | } |
| | | |
| | |
| | | public ASN1Null decodeAsNull() |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | return ASN1Null.decodeAsNull(this); |
| | | } |
| | | |
| | |
| | | public ASN1OctetString decodeAsOctetString() |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | return ASN1OctetString.decodeAsOctetString(this); |
| | | } |
| | | |
| | |
| | | public ASN1Sequence decodeAsSequence() |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | return ASN1Sequence.decodeAsSequence(this); |
| | | } |
| | | |
| | |
| | | public ASN1Set decodeAsSet() |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | return ASN1Set.decodeAsSet(this); |
| | | } |
| | | |
| | |
| | | public static ArrayList<ASN1Element> decodeElements(byte[] encodedElements) |
| | | throws ASN1Exception |
| | | { |
| | | |
| | | |
| | | // Make sure that the element array is not null. |
| | | if (encodedElements == null) |
| | | { |
| | |
| | | */ |
| | | public String getProtocolElementName() |
| | | { |
| | | |
| | | return "ASN.1"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean equals(Object o) |
| | | { |
| | | |
| | | if (this == o) |
| | | { |
| | | return true; |
| | |
| | | */ |
| | | public boolean equalsIgnoreType(ASN1Element element) |
| | | { |
| | | |
| | | return Arrays.equals(value, element.value); |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean equalsIgnoreType(ByteString byteString) |
| | | { |
| | | |
| | | return Arrays.equals(value, byteString.value()); |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean equalsElement(ASN1Element e) |
| | | { |
| | | |
| | | if (this == e) |
| | | { |
| | | return true; |
| | |
| | | */ |
| | | public int hashCode() |
| | | { |
| | | |
| | | int hashCode = type; |
| | | int length = Math.min(20, value.length); |
| | | for (int i=0; i < length; i++) |
| | |
| | | */ |
| | | public String toString() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | toString(buffer); |
| | | return buffer.toString(); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("ASN1Element(type="); |
| | | buffer.append(byteToHex(type)); |
| | | buffer.append(", length="); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer, int indent) |
| | | { |
| | | |
| | | StringBuilder indentBuf = new StringBuilder(indent); |
| | | for (int i=0 ; i < indent; i++) |
| | | { |
| opends/src/server/org/opends/server/protocols/asn1/ASN1Enumerated.java
opends/src/server/org/opends/server/protocols/asn1/ASN1Exception.java
opends/src/server/org/opends/server/protocols/asn1/ASN1Integer.java
opends/src/server/org/opends/server/protocols/asn1/ASN1Long.java
opends/src/server/org/opends/server/protocols/asn1/ASN1Null.java
opends/src/server/org/opends/server/protocols/asn1/ASN1OctetString.java
opends/src/server/org/opends/server/protocols/asn1/ASN1Reader.java
opends/src/server/org/opends/server/protocols/asn1/ASN1Sequence.java
opends/src/server/org/opends/server/protocols/asn1/ASN1Set.java
opends/src/server/org/opends/server/protocols/asn1/ASN1Writer.java
opends/src/server/org/opends/server/protocols/internal/InternalClientConnection.java
opends/src/server/org/opends/server/protocols/internal/InternalConnectionHandler.java
opends/src/server/org/opends/server/protocols/internal/InternalSearchOperation.java
opends/src/server/org/opends/server/protocols/jmx/DirectoryRMIClientSocketFactory.java
opends/src/server/org/opends/server/protocols/jmx/DirectoryRMIServerSocketFactory.java
opends/src/server/org/opends/server/protocols/jmx/JmxClientConnection.java
opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java
opends/src/server/org/opends/server/protocols/jmx/RmiAuthenticator.java
opends/src/server/org/opends/server/protocols/jmx/RmiConnector.java
opends/src/server/org/opends/server/protocols/ldap/AbandonRequestProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/AddRequestProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/AddResponseProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/BindRequestProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/BindResponseProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/CompareRequestProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/CompareResponseProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/DeleteRequestProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/DeleteResponseProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/ExtendedRequestProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/ExtendedResponseProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/IntermediateResponseProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/LDAPAttribute.java
opends/src/server/org/opends/server/protocols/ldap/LDAPClientConnection.java
opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
opends/src/server/org/opends/server/protocols/ldap/LDAPControl.java
opends/src/server/org/opends/server/protocols/ldap/LDAPException.java
opends/src/server/org/opends/server/protocols/ldap/LDAPFilter.java
opends/src/server/org/opends/server/protocols/ldap/LDAPMessage.java
opends/src/server/org/opends/server/protocols/ldap/LDAPModification.java
opends/src/server/org/opends/server/protocols/ldap/LDAPRequestHandler.java
opends/src/server/org/opends/server/protocols/ldap/LDAPStatistics.java
opends/src/server/org/opends/server/protocols/ldap/ModifyDNRequestProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/ModifyDNResponseProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/ModifyRequestProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/ModifyResponseProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/ProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/SearchRequestProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/SearchResultDoneProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/SearchResultEntryProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/SearchResultReferenceProtocolOp.java
opends/src/server/org/opends/server/protocols/ldap/UnbindRequestProtocolOp.java
opends/src/server/org/opends/server/schema/AbsoluteSubtreeSpecificationSyntax.java
opends/src/server/org/opends/server/schema/AttributeTypeSyntax.java
opends/src/server/org/opends/server/schema/AuthPasswordEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/AuthPasswordExactEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/AuthPasswordSyntax.java
opends/src/server/org/opends/server/schema/BinarySyntax.java
opends/src/server/org/opends/server/schema/BitStringEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/BitStringSyntax.java
opends/src/server/org/opends/server/schema/BooleanEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/BooleanSyntax.java
opends/src/server/org/opends/server/schema/CaseExactEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/CaseExactIA5EqualityMatchingRule.java
opends/src/server/org/opends/server/schema/CaseExactIA5SubstringMatchingRule.java
opends/src/server/org/opends/server/schema/CaseExactOrderingMatchingRule.java
opends/src/server/org/opends/server/schema/CaseExactSubstringMatchingRule.java
opends/src/server/org/opends/server/schema/CaseIgnoreEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/CaseIgnoreIA5EqualityMatchingRule.java
opends/src/server/org/opends/server/schema/CaseIgnoreIA5SubstringMatchingRule.java
opends/src/server/org/opends/server/schema/CaseIgnoreListEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/CaseIgnoreListSubstringMatchingRule.java
opends/src/server/org/opends/server/schema/CaseIgnoreOrderingMatchingRule.java
opends/src/server/org/opends/server/schema/CaseIgnoreSubstringMatchingRule.java
opends/src/server/org/opends/server/schema/CertificateListSyntax.java
opends/src/server/org/opends/server/schema/CertificatePairSyntax.java
opends/src/server/org/opends/server/schema/CertificateSyntax.java
opends/src/server/org/opends/server/schema/CountryStringSyntax.java
opends/src/server/org/opends/server/schema/DITContentRuleSyntax.java
opends/src/server/org/opends/server/schema/DITStructureRuleSyntax.java
opends/src/server/org/opends/server/schema/DeliveryMethodSyntax.java
opends/src/server/org/opends/server/schema/DirectoryStringFirstComponentEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/DirectoryStringSyntax.java
opends/src/server/org/opends/server/schema/DistinguishedNameEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/DistinguishedNameSyntax.java
opends/src/server/org/opends/server/schema/DoubleMetaphoneApproximateMatchingRule.java
opends/src/server/org/opends/server/schema/EnhancedGuideSyntax.java
opends/src/server/org/opends/server/schema/FaxNumberSyntax.java
opends/src/server/org/opends/server/schema/FaxSyntax.java
opends/src/server/org/opends/server/schema/GeneralizedTimeEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/GeneralizedTimeOrderingMatchingRule.java
opends/src/server/org/opends/server/schema/GeneralizedTimeSyntax.java
opends/src/server/org/opends/server/schema/GuideSyntax.java
opends/src/server/org/opends/server/schema/IA5StringSyntax.java
opends/src/server/org/opends/server/schema/IntegerEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/IntegerFirstComponentEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/IntegerOrderingMatchingRule.java
opends/src/server/org/opends/server/schema/IntegerSyntax.java
opends/src/server/org/opends/server/schema/JPEGSyntax.java
opends/src/server/org/opends/server/schema/KeywordEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java
opends/src/server/org/opends/server/schema/MatchingRuleSyntax.java
opends/src/server/org/opends/server/schema/MatchingRuleUseSyntax.java
opends/src/server/org/opends/server/schema/NameAndOptionalUIDSyntax.java
opends/src/server/org/opends/server/schema/NameFormSyntax.java
opends/src/server/org/opends/server/schema/NumericStringEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/NumericStringOrderingMatchingRule.java
opends/src/server/org/opends/server/schema/NumericStringSubstringMatchingRule.java
opends/src/server/org/opends/server/schema/NumericStringSyntax.java
opends/src/server/org/opends/server/schema/OIDSyntax.java
opends/src/server/org/opends/server/schema/ObjectClassSyntax.java
opends/src/server/org/opends/server/schema/ObjectIdentifierEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/ObjectIdentifierFirstComponentEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/OctetStringEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/OctetStringOrderingMatchingRule.java
opends/src/server/org/opends/server/schema/OctetStringSubstringMatchingRule.java
opends/src/server/org/opends/server/schema/OctetStringSyntax.java
opends/src/server/org/opends/server/schema/OtherMailboxSyntax.java
opends/src/server/org/opends/server/schema/PostalAddressSyntax.java
opends/src/server/org/opends/server/schema/PresentationAddressEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/PresentationAddressSyntax.java
opends/src/server/org/opends/server/schema/PrintableString.java
opends/src/server/org/opends/server/schema/PrintableStringSyntax.java
opends/src/server/org/opends/server/schema/ProtocolInformationEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/ProtocolInformationSyntax.java
opends/src/server/org/opends/server/schema/SubstringAssertionSyntax.java
opends/src/server/org/opends/server/schema/SupportedAlgorithmSyntax.java
opends/src/server/org/opends/server/schema/TelephoneNumberEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/TelephoneNumberSubstringMatchingRule.java
opends/src/server/org/opends/server/schema/TelephoneNumberSyntax.java
opends/src/server/org/opends/server/schema/TeletexTerminalIdentifierSyntax.java
opends/src/server/org/opends/server/schema/TelexNumberSyntax.java
opends/src/server/org/opends/server/schema/UTCTimeSyntax.java
opends/src/server/org/opends/server/schema/UUIDEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/UUIDOrderingMatchingRule.java
opends/src/server/org/opends/server/schema/UUIDSyntax.java
opends/src/server/org/opends/server/schema/UniqueMemberEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/UserPasswordEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/UserPasswordExactEqualityMatchingRule.java
opends/src/server/org/opends/server/schema/UserPasswordSyntax.java
opends/src/server/org/opends/server/schema/WordEqualityMatchingRule.java
opends/src/server/org/opends/server/synchronization/plugin/MultimasterSynchronization.java
opends/src/server/org/opends/server/synchronization/plugin/SynchronizationDomain.java
opends/src/server/org/opends/server/tasks/AddSchemaFileTask.java
opends/src/server/org/opends/server/tasks/BackupTask.java
opends/src/server/org/opends/server/tasks/ExportTask.java
opends/src/server/org/opends/server/tasks/ImportTask.java
opends/src/server/org/opends/server/tasks/RestartTaskThread.java
opends/src/server/org/opends/server/tasks/RestoreTask.java
opends/src/server/org/opends/server/tasks/ShutdownTask.java
opends/src/server/org/opends/server/tasks/ShutdownTaskThread.java
opends/src/server/org/opends/server/tools/PromptTrustManager.java
opends/src/server/org/opends/server/types/AccountStatusNotification.java
opends/src/server/org/opends/server/types/Attribute.java
opends/src/server/org/opends/server/types/AttributeType.java
opends/src/server/org/opends/server/types/AttributeValue.java
opends/src/server/org/opends/server/types/AuthenticationInfo.java
opends/src/server/org/opends/server/types/BackupConfig.java
opends/src/server/org/opends/server/types/BackupDirectory.java
opends/src/server/org/opends/server/types/BackupInfo.java
opends/src/server/org/opends/server/types/ByteStringFactory.java
opends/src/server/org/opends/server/types/CacheEntry.java
opends/src/server/org/opends/server/types/CancelRequest.java
opends/src/server/org/opends/server/types/CancelledOperationException.java
opends/src/server/org/opends/server/types/ConfigChangeResult.java
opends/src/server/org/opends/server/types/Control.java
opends/src/server/org/opends/server/types/CryptoManager.java
opends/src/server/org/opends/server/types/DITContentRule.java
opends/src/server/org/opends/server/types/DITStructureRule.java
opends/src/server/org/opends/server/types/DN.java
opends/src/server/org/opends/server/types/DirectoryConfig.java
opends/src/server/org/opends/server/types/DirectoryException.java
opends/src/server/org/opends/server/types/Entry.java
opends/src/server/org/opends/server/types/HostPort.java
opends/src/server/org/opends/server/types/InitializationException.java
opends/src/server/org/opends/server/types/IntermediateResponse.java
opends/src/server/org/opends/server/types/InvokableMethod.java
opends/src/server/org/opends/server/types/LDAPURL.java
opends/src/server/org/opends/server/types/LDIFExportConfig.java
opends/src/server/org/opends/server/types/LDIFImportConfig.java
opends/src/server/org/opends/server/types/LockManager.java
opends/src/server/org/opends/server/types/MatchingRuleUse.java
opends/src/server/org/opends/server/types/MemberList.java
opends/src/server/org/opends/server/types/MembershipException.java
opends/src/server/org/opends/server/types/Modification.java
opends/src/server/org/opends/server/types/NameForm.java
opends/src/server/org/opends/server/types/NamedCharacterSet.java
opends/src/server/org/opends/server/types/ObjectClass.java
opends/src/server/org/opends/server/types/RDN.java
opends/src/server/org/opends/server/types/RestoreConfig.java
opends/src/server/org/opends/server/types/Schema.java
opends/src/server/org/opends/server/types/SearchFilter.java
opends/src/server/org/opends/server/types/SearchResultEntry.java
opends/src/server/org/opends/server/types/SearchResultReference.java
opends/src/server/org/opends/server/types/SynchronizationProviderResult.java
opends/src/server/org/opends/server/util/AddChangeRecordEntry.java
opends/src/server/org/opends/server/util/Base64.java
opends/src/server/org/opends/server/util/ChangeRecordEntry.java
opends/src/server/org/opends/server/util/DeleteChangeRecordEntry.java
opends/src/server/org/opends/server/util/EMailMessage.java
opends/src/server/org/opends/server/util/LDIFException.java
opends/src/server/org/opends/server/util/LDIFReader.java
opends/src/server/org/opends/server/util/LDIFWriter.java
opends/src/server/org/opends/server/util/ModifyChangeRecordEntry.java
opends/src/server/org/opends/server/util/ModifyDNChangeRecordEntry.java
opends/src/server/org/opends/server/util/MultiOutputStream.java
opends/src/server/org/opends/server/util/StaticUtils.java
opends/src/statuspanel/org/opends/statuspanel/ConfigFromFile.java
opends/src/statuspanel/org/opends/statuspanel/StatusPanelController.java |