| | |
| | | * |
| | | * @param operation |
| | | * The operation to be added to the work queue. |
| | | * @param isAllowedInLockDownMode |
| | | * Flag to indicate if the request can be added to the work queue regardless |
| | | * of the server's lock down mode. |
| | | * @throws DirectoryException |
| | | * If a check failed preventing the operation from being added to |
| | | * the queue |
| | | */ |
| | | private static void checkCanEnqueueRequest(Operation operation) |
| | | public static void checkCanEnqueueRequest(Operation operation, boolean isAllowedInLockDownMode) |
| | | throws DirectoryException |
| | | { |
| | | ClientConnection clientConnection = operation.getClientConnection(); |
| | | //Reject or accept the unauthenticated requests based on the configuration |
| | | // settings. |
| | | if ((directoryServer.rejectUnauthenticatedRequests || |
| | | directoryServer.lockdownMode) && |
| | | !clientConnection.getAuthenticationInfo().isAuthenticated()) |
| | | //Reject or accept the unauthenticated requests based on the configuration settings. |
| | | if (!clientConnection.getAuthenticationInfo().isAuthenticated() && |
| | | (directoryServer.rejectUnauthenticatedRequests || |
| | | (directoryServer.lockdownMode && !isAllowedInLockDownMode))) |
| | | { |
| | | switch(operation.getOperationType()) |
| | | { |
| | |
| | | public static void enqueueRequest(Operation operation) |
| | | throws DirectoryException |
| | | { |
| | | checkCanEnqueueRequest(operation); |
| | | checkCanEnqueueRequest(operation, false); |
| | | directoryServer.workQueue.submitOperation(operation); |
| | | } |
| | | |
| | |
| | | public static boolean tryEnqueueRequest(Operation operation) |
| | | throws DirectoryException |
| | | { |
| | | checkCanEnqueueRequest(operation); |
| | | checkCanEnqueueRequest(operation, false); |
| | | return directoryServer.workQueue.trySubmitOperation(operation); |
| | | } |
| | | |