| | |
| | | |
| | | |
| | | import java.net.*; |
| | | import java.nio.*; |
| | | import java.util.*; |
| | | import java.util.concurrent.atomic.*; |
| | | import javax.management.Notification; |
| | |
| | | import javax.management.remote.JMXConnectionNotification; |
| | | import org.opends.server.api.*; |
| | | import org.opends.server.core.*; |
| | | import org.opends.server.extensions.*; |
| | | import org.opends.server.protocols.ldap.*; |
| | | import org.opends.server.protocols.internal.InternalSearchOperation ; |
| | | import org.opends.server.protocols.internal.InternalSearchListener; |
| | |
| | | * |
| | | * @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. |
| | | */ |
| | | public ConnectionHandler getConnectionHandler() |
| | | @Override |
| | | public ConnectionHandler<?> getConnectionHandler() |
| | | { |
| | | return jmxConnectionHandler; |
| | | } |
| | |
| | | * @return The protocol that the client is using to communicate with the |
| | | * Directory Server. |
| | | */ |
| | | @Override |
| | | public String getProtocol() |
| | | { |
| | | return "jmx"; |
| | |
| | | * |
| | | * @return A string representation of the address of the client. |
| | | */ |
| | | @Override |
| | | public String getClientAddress() |
| | | { |
| | | return "jmx"; |
| | |
| | | * |
| | | * @return The port number for this connection on the client system. |
| | | */ |
| | | @Override |
| | | public int getClientPort() |
| | | { |
| | | return -1; |
| | |
| | | * @return A string representation of the address on the server to which the |
| | | * client connected. |
| | | */ |
| | | @Override |
| | | public String getServerAddress() |
| | | { |
| | | return "jmx"; |
| | |
| | | * or -1 if there is no server port associated with this |
| | | * connection (e.g. internal client). |
| | | */ |
| | | @Override |
| | | public int getServerPort() |
| | | { |
| | | return -1; |
| | |
| | | * client system. It may be <CODE>null</CODE> if the client is not |
| | | * connected over an IP-based connection. |
| | | */ |
| | | @Override |
| | | public InetAddress getRemoteAddress() |
| | | { |
| | | return null; |
| | |
| | | * be <CODE>null</CODE> if the client is not connected over an |
| | | * IP-based connection. |
| | | */ |
| | | @Override |
| | | public InetAddress getLocalAddress() |
| | | { |
| | | return null; |
| | |
| | | * secure mechanism to communicate with the server, or |
| | | * <CODE>false</CODE> if not. |
| | | */ |
| | | @Override |
| | | public boolean isSecure() |
| | | { |
| | | return false; |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates that the data in the provided buffer has been read from the |
| | | * client and should be processed. The contents of the provided buffer will |
| | | * be in clear-text (the data may have been passed through a connection |
| | | * security provider to obtain the clear-text version), and may contain part |
| | | * or all of one or more client requests. |
| | | * |
| | | * @param buffer The byte buffer containing the data available for reading. |
| | | * |
| | | * @return <CODE>true</CODE> if all the data in the provided buffer was |
| | | * processed and the client connection can remain established, or |
| | | * <CODE>false</CODE> if a decoding error occurred and requests from |
| | | * this client should no longer be processed. Note that if this |
| | | * method does return <CODE>false</CODE>, then it must have already |
| | | * disconnected the client. |
| | | */ |
| | | public boolean processDataRead(ByteBuffer buffer) |
| | | { |
| | | // This method will not do anything with the data because there is no |
| | | // actual "connection" from which information can be read, nor any protocol |
| | | // to use to read it. |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Sends a response to the client based on the information in the provided |
| | | * operation. |
| | | * |
| | | * @param operation The operation for which to send the response. |
| | | */ |
| | | @Override |
| | | public void sendResponse(Operation operation) |
| | | { |
| | | // There will not be any response sent by this method, since there is not an |
| | |
| | | * the entry to the client and the search should |
| | | * be terminated. |
| | | */ |
| | | @Override |
| | | public void sendSearchEntry(SearchOperation searchOperation, |
| | | SearchResultEntry searchEntry) |
| | | throws DirectoryException |
| | |
| | | * the reference to the client and the search |
| | | * should be terminated. |
| | | */ |
| | | @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. |
| | | */ |
| | | @Override |
| | | protected boolean sendIntermediateResponseMessage( |
| | | IntermediateResponse intermediateResponse) |
| | | { |
| | |
| | | * <CODE>null</CODE> if no notification is to be |
| | | * sent. |
| | | */ |
| | | @Override |
| | | public void disconnect(DisconnectReason disconnectReason, |
| | | boolean sendNotification, |
| | | Message message) |
| | |
| | | try |
| | | { |
| | | UnbindOperationBasis unbindOp = new UnbindOperationBasis( |
| | | (ClientConnection) this, |
| | | this, |
| | | this.nextOperationID(), |
| | | this.nextMessageID(), null); |
| | | |
| | |
| | | * |
| | | * @return The set of operations in progress for this client connection. |
| | | */ |
| | | @Override |
| | | public Collection<Operation> getOperationsInProgress() |
| | | { |
| | | return operationList; |
| | |
| | | * @return The operation in progress with the specified message ID, or |
| | | * <CODE>null</CODE> if no such operation could be found. |
| | | */ |
| | | @Override |
| | | public AbstractOperation getOperationInProgress(int messageID) |
| | | { |
| | | // Jmx operations will not be tracked. |
| | |
| | | * @return <CODE>true</CODE> if the operation was found and removed from the |
| | | * set of operations in progress, or <CODE>false</CODE> if not. |
| | | */ |
| | | @Override |
| | | public boolean removeOperationInProgress(int messageID) |
| | | { |
| | | // No implementation is required, since Jmx operations will not be |
| | |
| | | * @return A cancel result that either indicates that the cancel was |
| | | * successful or provides a reason that it was not. |
| | | */ |
| | | @Override |
| | | public CancelResult cancelOperation(int messageID, |
| | | CancelRequest cancelRequest) |
| | | { |
| | |
| | | * @param cancelRequest An object providing additional information about how |
| | | * the cancel should be processed. |
| | | */ |
| | | @Override |
| | | public void cancelAllOperations(CancelRequest cancelRequest) |
| | | { |
| | | // No implementation is required since Jmx operations cannot be |
| | |
| | | * @param messageID The message ID of the operation that should not be |
| | | * canceled. |
| | | */ |
| | | @Override |
| | | public void cancelAllOperationsExcept(CancelRequest cancelRequest, |
| | | int messageID) |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @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("JmxClientConnection(connID="); |
| | |
| | | * Release the cursor in case the iterator was badly used and releaseCursor |
| | | * was never called. |
| | | */ |
| | | @Override |
| | | protected void finalize() |
| | | { |
| | | super.finalize(); |
| | | disconnect(DisconnectReason.OTHER, false, null); |
| | | } |
| | | |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public int getSSF() { |
| | | return 0; |
| | | } |