| | |
| | | * This class defines a pseudo-connection object that can be used for |
| | | * performing internal operations. |
| | | */ |
| | | public class InternalClientConnection |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.UNCOMMITTED, |
| | | mayInstantiate=true, |
| | | mayExtend=false, |
| | | mayInvoke=true) |
| | | public final class InternalClientConnection |
| | | extends ClientConnection |
| | | { |
| | | /** |
| | |
| | | super.setAuthenticationInfo(authenticationInfo); |
| | | super.setSizeLimit(0); |
| | | super.setTimeLimit(0); |
| | | super.setIdleTimeLimit(0); |
| | | super.setLookthroughLimit(0); |
| | | } |
| | | catch (DirectoryException de) |
| | |
| | | super.setAuthenticationInfo(authInfo); |
| | | super.setSizeLimit(0); |
| | | super.setTimeLimit(0); |
| | | super.setIdleTimeLimit(0); |
| | | super.setLookthroughLimit(0); |
| | | |
| | | connectionID = nextConnectionID.getAndDecrement(); |
| | |
| | | * @return The unique identifier that has been assigned to this |
| | | * connection. |
| | | */ |
| | | @Override() |
| | | public long getConnectionID() |
| | | { |
| | | return connectionID; |
| | |
| | | * @return The connection handler that accepted this client |
| | | * connection. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public ConnectionHandler getConnectionHandler() |
| | | { |
| | | return InternalConnectionHandler.getInstance(); |
| | |
| | | * @return The protocol that the client is using to communicate |
| | | * with the Directory Server. |
| | | */ |
| | | @Override() |
| | | public String getProtocol() |
| | | { |
| | | return "internal"; |
| | |
| | | * |
| | | * @return A string representation of the address of the client. |
| | | */ |
| | | @Override() |
| | | public String getClientAddress() |
| | | { |
| | | return "internal"; |
| | |
| | | * @return A string representation of the address on the server to |
| | | * which the client connected. |
| | | */ |
| | | @Override() |
| | | public String getServerAddress() |
| | | { |
| | | return "internal"; |
| | |
| | | * if the client is not connected over an IP-based |
| | | * connection. |
| | | */ |
| | | @Override() |
| | | public InetAddress getRemoteAddress() |
| | | { |
| | | return null; |
| | |
| | | * connection. It may be <CODE>null</CODE> if the client |
| | | * is not connected over an IP-based connection. |
| | | */ |
| | | @Override() |
| | | public InetAddress getLocalAddress() |
| | | { |
| | | return null; |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | * Specifies the size limit that will be enforced for searches |
| | | * performed using this client connection. This method does nothing |
| | | * because connection-level size limits will never be enforced for |
| | | * internal client connections. |
| | | * |
| | | * @param sizeLimit The size limit that will be enforced for |
| | | * searches performed using this client |
| | | * connection. |
| | | */ |
| | | @Override() |
| | | public void setSizeLimit(int sizeLimit) |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | * Specifies the default maximum number of entries that should |
| | | * be checked for matches during a search. This method does nothing |
| | | * because connection-level lookthrough limits will never be |
| | | * enforced for internal client connections |
| | | * |
| | | * @param lookthroughLimit The default maximum number of |
| | | * entries that should be check for |
| | | * matches during a search. |
| | | */ |
| | | @Override() |
| | | public void setLookthroughLimit(int lookthroughLimit) |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | * Specifies the maximum length of time in milliseconds that this |
| | | * client connection will be allowed to remain idle before it should |
| | | * be disconnected. This method does nothing because internal |
| | | * client connections will not be terminated due to an idle time |
| | | * limit. |
| | | * |
| | | * @param idleTimeLimit The maximum length of time in milliseconds |
| | | * that this client connection will be |
| | | * allowed to remain idle before it should be |
| | | * disconnected. |
| | | */ |
| | | @Override() |
| | | public void setIdleTimeLimit(long idleTimeLimit) |
| | | { |
| | | // No implementation rqeuired. We never want to set a nonzero |
| | | // idle time limit for internal client connections. |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Specifies the time limit that will be enforced for searches |
| | | * performed using this client connection. This method does nothing |
| | | * because connection-level tim elimits will never be enforced for |
| | | * internal client connections. |
| | | * |
| | | * @param timeLimit The time limit that will be enforced for |
| | | * searches performed using this client |
| | | * connection. |
| | | */ |
| | | @Override() |
| | | public void setTimeLimit(int timeLimit) |
| | |
| | | * using a secure mechanism to communicate with the server, |
| | | * or <CODE>false</CODE> if not. |
| | | */ |
| | | @Override() |
| | | public boolean isSecure() |
| | | { |
| | | // Internal connections will generally be considered secure, but |
| | |
| | | * @return The connection security provider for this client |
| | | * connection. |
| | | */ |
| | | @Override() |
| | | public ConnectionSecurityProvider getConnectionSecurityProvider() |
| | | { |
| | | return securityProvider; |
| | |
| | | * for communication on this client |
| | | * connection. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public void setConnectionSecurityProvider(ConnectionSecurityProvider |
| | | securityProvider) |
| | | { |
| | |
| | | * is used to protect communication with this client, or |
| | | * <CODE>null</CODE> if no security is in place. |
| | | */ |
| | | @Override() |
| | | public String getSecurityMechanism() |
| | | { |
| | | return securityProvider.getSecurityMechanismName(); |
| | |
| | | * <CODE>false</CODE>, then it must have already |
| | | * disconnected the client. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public boolean processDataRead(ByteBuffer buffer) |
| | | { |
| | | // This method will not do anything with the data because there is |
| | |
| | | * |
| | | * @param operation The operation for which to send the response. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public void sendResponse(Operation operation) |
| | | { |
| | | // There will not be any response sent by this method, since there |
| | |
| | | * @return Information about the user that is currently |
| | | * authenticated on this connection. |
| | | */ |
| | | @Override() |
| | | public AuthenticationInfo getAuthenticationInfo() |
| | | { |
| | | return authenticationInfo; |
| | |
| | | * connection. It should not be |
| | | * <CODE>null</CODE>. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public void setAuthenticationInfo(AuthenticationInfo |
| | | authenticationInfo) |
| | | { |
| | |
| | | * internal client connections is set when the connection is created |
| | | * and cannot be changed after the fact. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public void setUnauthenticated() |
| | | { |
| | | // No implementation required. |
| | |
| | | * the entry and the search should be |
| | | * terminated. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public void sendSearchEntry(SearchOperation searchOperation, |
| | | SearchResultEntry searchEntry) |
| | | throws DirectoryException |
| | |
| | | * the entry and the search should be |
| | | * terminated. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public boolean sendSearchReference(SearchOperation searchOperation, |
| | | SearchResultReference searchReference) |
| | | throws DirectoryException |
| | |
| | | * @return <CODE>true</CODE> if processing on the associated |
| | | * operation should continue, or <CODE>false</CODE> if not. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | protected boolean sendIntermediateResponseMessage( |
| | | IntermediateResponse intermediateResponse) |
| | | { |
| | |
| | | * may be <CODE>null</CODE> if no |
| | | * notification is to be sent. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public void disconnect(DisconnectReason disconnectReason, |
| | | boolean sendNotification, |
| | | Message message) |
| | |
| | | * @return <CODE>true</CODE> if a bind operation is in progress on |
| | | * this connection, or <CODE>false</CODE> if not. |
| | | */ |
| | | @Override() |
| | | public boolean bindInProgress() |
| | | { |
| | | // For internal operations, we don't care if there are any binds |
| | |
| | | * @param bindInProgress Specifies whether a bind operation is in |
| | | * progress on this client connection. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public void setBindInProgress(boolean bindInProgress) |
| | | { |
| | | // No implementation is required. |
| | |
| | | * @return The set of operations in progress for this client |
| | | * connection. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public Collection<AbstractOperation> getOperationsInProgress() |
| | | { |
| | | return operationList; |
| | |
| | | * or <CODE>null</CODE> if no such operation could be |
| | | * found. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public AbstractOperation getOperationInProgress(int messageID) |
| | | { |
| | | // Internal operations will not be tracked. |
| | |
| | | * from the set of operations in progress, or |
| | | * <CODE>false</CODE> if not. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public boolean removeOperationInProgress(int messageID) |
| | | { |
| | | // No implementation is required, since internal operations will |
| | |
| | | * @return A cancel result that either indicates that the cancel |
| | | * was successful or provides a reason that it was not. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public CancelResult cancelOperation(int messageID, |
| | | CancelRequest cancelRequest) |
| | | { |
| | |
| | | * @param cancelRequest An object providing additional information |
| | | * about how the cancel should be processed. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public void cancelAllOperations(CancelRequest cancelRequest) |
| | | { |
| | | // No implementation is required since internal operations cannot |
| | |
| | | * @param messageID The message ID of the operation that |
| | | * should not be canceled. |
| | | */ |
| | | @org.opends.server.types.PublicAPI( |
| | | stability=org.opends.server.types.StabilityLevel.PRIVATE, |
| | | mayInstantiate=false, |
| | | mayExtend=false, |
| | | mayInvoke=false) |
| | | @Override() |
| | | public void cancelAllOperationsExcept(CancelRequest cancelRequest, |
| | | int messageID) |
| | | { |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | * Retrieves a one-line summary of this client connection in a form |
| | | * that is suitable for including in the monitor entry for the |
| | | * associated connection handler. It should be in a format that is |
| | | * both humand readable and machine parseable (e.g., a |
| | | * space-delimited name-value list, with quotes around the values). |
| | | * |
| | | * @return A one-line summary of this client connection in a form |
| | | * that is suitable for including in the monitor entry for |
| | | * the associated connection handler. |
| | | */ |
| | | @Override() |
| | | public String getMonitorSummary() |
| | | { |
| | | StringBuilder buffer = new StringBuilder(); |
| | |
| | | * @param buffer The buffer to which the information should be |
| | | * appended. |
| | | */ |
| | | @Override() |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | buffer.append("InternalClientConnection(connID="); |