| | |
| | | */ |
| | | public static InternalClientConnection getRootConnection() |
| | | { |
| | | |
| | | return rootConnection; |
| | | } |
| | | |
| | |
| | | */ |
| | | public static long nextOperationID() |
| | | { |
| | | |
| | | long opID = nextOperationID.getAndIncrement(); |
| | | if (opID < 0) |
| | | { |
| | |
| | | */ |
| | | public static int nextMessageID() |
| | | { |
| | | |
| | | int msgID = nextMessageID.getAndIncrement(); |
| | | if (msgID < 0) |
| | | { |
| | |
| | | */ |
| | | public long getConnectionID() |
| | | { |
| | | |
| | | return connectionID; |
| | | } |
| | | |
| | |
| | | */ |
| | | public ConnectionHandler getConnectionHandler() |
| | | { |
| | | |
| | | return InternalConnectionHandler.getInstance(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getProtocol() |
| | | { |
| | | |
| | | return "internal"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getClientAddress() |
| | | { |
| | | |
| | | return "internal"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getServerAddress() |
| | | { |
| | | |
| | | return "internal"; |
| | | } |
| | | |
| | |
| | | */ |
| | | public InetAddress getRemoteAddress() |
| | | { |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | */ |
| | | public InetAddress getLocalAddress() |
| | | { |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean isSecure() |
| | | { |
| | | |
| | | // Internal connections will generally be considered secure, but |
| | | // they may be declared insecure if they are accessed through some |
| | | // external mechanism (e.g., a DSML handler that runs the server |
| | |
| | | */ |
| | | public ConnectionSecurityProvider getConnectionSecurityProvider() |
| | | { |
| | | |
| | | return securityProvider; |
| | | } |
| | | |
| | |
| | | public void setConnectionSecurityProvider(ConnectionSecurityProvider |
| | | securityProvider) |
| | | { |
| | | |
| | | this.securityProvider = securityProvider; |
| | | } |
| | | |
| | |
| | | */ |
| | | public String getSecurityMechanism() |
| | | { |
| | | |
| | | return securityProvider.getSecurityMechanismName(); |
| | | } |
| | | |
| | |
| | | */ |
| | | 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. |
| | |
| | | */ |
| | | public void sendResponse(Operation operation) |
| | | { |
| | | |
| | | // There will not be any response sent by this method, since there |
| | | // is not an actual connection. |
| | | } |
| | |
| | | */ |
| | | public AuthenticationInfo getAuthenticationInfo() |
| | | { |
| | | |
| | | return authenticationInfo; |
| | | } |
| | | |
| | |
| | | public void setAuthenticationInfo(AuthenticationInfo |
| | | authenticationInfo) |
| | | { |
| | | |
| | | // No implementation required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public void setUnauthenticated() |
| | | { |
| | | |
| | | // No implementation required. |
| | | } |
| | | |
| | |
| | | public AddOperation processAdd(ByteString rawEntryDN, |
| | | List<LDAPAttribute> rawAttributes) |
| | | { |
| | | |
| | | AddOperation addOperation = |
| | | new AddOperation(this, nextOperationID(), nextMessageID(), |
| | | new ArrayList<Control>(0), rawEntryDN, |
| | |
| | | Map<AttributeType,List<Attribute>> |
| | | operationalAttributes) |
| | | { |
| | | |
| | | AddOperation addOperation = |
| | | new AddOperation(this, nextOperationID(), nextMessageID(), |
| | | new ArrayList<Control>(0), entryDN, |
| | |
| | | public BindOperation processSimpleBind(ByteString rawBindDN, |
| | | ByteString password) |
| | | { |
| | | |
| | | BindOperation bindOperation = |
| | | new BindOperation(this, nextOperationID(), nextMessageID(), |
| | | new ArrayList<Control>(0), rawBindDN, |
| | |
| | | public BindOperation processSimpleBind(DN bindDN, |
| | | ByteString password) |
| | | { |
| | | |
| | | BindOperation bindOperation = |
| | | new BindOperation(this, nextOperationID(), nextMessageID(), |
| | | new ArrayList<Control>(0), bindDN, |
| | |
| | | String saslMechanism, |
| | | ASN1OctetString saslCredentials) |
| | | { |
| | | |
| | | BindOperation bindOperation = |
| | | new BindOperation(this, nextOperationID(), nextMessageID(), |
| | | new ArrayList<Control>(0), rawBindDN, |
| | |
| | | String saslMechanism, |
| | | ASN1OctetString saslCredentials) |
| | | { |
| | | |
| | | BindOperation bindOperation = |
| | | new BindOperation(this, nextOperationID(), nextMessageID(), |
| | | new ArrayList<Control>(0), bindDN, |
| | |
| | | String attributeType, |
| | | ByteString assertionValue) |
| | | { |
| | | |
| | | CompareOperation compareOperation = |
| | | new CompareOperation(this, nextOperationID(), |
| | | nextMessageID(), |
| | |
| | | AttributeType attributeType, |
| | | ByteString assertionValue) |
| | | { |
| | | |
| | | CompareOperation compareOperation = |
| | | new CompareOperation(this, nextOperationID(), |
| | | nextMessageID(), |
| | |
| | | */ |
| | | public DeleteOperation processDelete(ByteString rawEntryDN) |
| | | { |
| | | |
| | | DeleteOperation deleteOperation = |
| | | new DeleteOperation(this, nextOperationID(), nextMessageID(), |
| | | new ArrayList<Control>(0), rawEntryDN); |
| | |
| | | */ |
| | | public DeleteOperation processDelete(DN entryDN) |
| | | { |
| | | |
| | | DeleteOperation deleteOperation = |
| | | new DeleteOperation(this, nextOperationID(), nextMessageID(), |
| | | new ArrayList<Control>(0), entryDN); |
| | |
| | | public ExtendedOperation processExtendedOperation(String requestOID, |
| | | ASN1OctetString requestValue) |
| | | { |
| | | |
| | | ExtendedOperation extendedOperation = |
| | | new ExtendedOperation(this, nextOperationID(), |
| | | nextMessageID(), |
| | |
| | | public ModifyOperation processModify(ByteString rawEntryDN, |
| | | List<LDAPModification> rawModifications) |
| | | { |
| | | |
| | | ModifyOperation modifyOperation = |
| | | new ModifyOperation(this, nextOperationID(), nextMessageID(), |
| | | new ArrayList<Control>(0), rawEntryDN, |
| | |
| | | public ModifyOperation processModify(DN entryDN, |
| | | List<Modification> modifications) |
| | | { |
| | | |
| | | ModifyOperation modifyOperation = |
| | | new ModifyOperation(this, nextOperationID(), nextMessageID(), |
| | | new ArrayList<Control>(0), entryDN, |
| | |
| | | ByteString rawNewRDN, |
| | | boolean deleteOldRDN) |
| | | { |
| | | |
| | | return processModifyDN(rawEntryDN, rawNewRDN, deleteOldRDN, null); |
| | | } |
| | | |
| | |
| | | boolean deleteOldRDN, |
| | | ByteString rawNewSuperior) |
| | | { |
| | | |
| | | ModifyDNOperation modifyDNOperation = |
| | | new ModifyDNOperation(this, nextOperationID(), |
| | | nextMessageID(), |
| | |
| | | public ModifyDNOperation processModifyDN(DN entryDN, RDN newRDN, |
| | | boolean deleteOldRDN) |
| | | { |
| | | |
| | | return processModifyDN(entryDN, newRDN, deleteOldRDN, null); |
| | | } |
| | | |
| | |
| | | boolean deleteOldRDN, |
| | | DN newSuperior) |
| | | { |
| | | |
| | | ModifyDNOperation modifyDNOperation = |
| | | new ModifyDNOperation(this, nextOperationID(), |
| | | nextMessageID(), |
| | |
| | | SearchScope scope, |
| | | LDAPFilter filter) |
| | | { |
| | | |
| | | return processSearch(rawBaseDN, scope, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, 0, 0, |
| | | false, filter, new LinkedHashSet<String>(0)); |
| | |
| | | boolean typesOnly, LDAPFilter filter, |
| | | LinkedHashSet<String> attributes) |
| | | { |
| | | |
| | | InternalSearchOperation searchOperation = |
| | | new InternalSearchOperation(this, nextOperationID(), |
| | | nextMessageID(), |
| | |
| | | LinkedHashSet<String> attributes, |
| | | InternalSearchListener searchListener) |
| | | { |
| | | |
| | | InternalSearchOperation searchOperation = |
| | | new InternalSearchOperation(this, nextOperationID(), |
| | | nextMessageID(), |
| | |
| | | SearchScope scope, |
| | | SearchFilter filter) |
| | | { |
| | | |
| | | return processSearch(baseDN, scope, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, 0, 0, |
| | | false, filter, new LinkedHashSet<String>(0)); |
| | |
| | | boolean typesOnly, SearchFilter filter, |
| | | LinkedHashSet<String> attributes) |
| | | { |
| | | |
| | | InternalSearchOperation searchOperation = |
| | | new InternalSearchOperation(this, nextOperationID(), |
| | | nextMessageID(), |
| | |
| | | LinkedHashSet<String> attributes, |
| | | InternalSearchListener searchListener) |
| | | { |
| | | |
| | | InternalSearchOperation searchOperation = |
| | | new InternalSearchOperation(this, nextOperationID(), |
| | | nextMessageID(), |
| | |
| | | public void sendSearchEntry(SearchOperation searchOperation, |
| | | SearchResultEntry searchEntry) |
| | | { |
| | | |
| | | ((InternalSearchOperation) searchOperation). |
| | | addSearchEntry(searchEntry); |
| | | } |
| | |
| | | public boolean sendSearchReference(SearchOperation searchOperation, |
| | | SearchResultReference searchReference) |
| | | { |
| | | |
| | | |
| | | ((InternalSearchOperation) |
| | | searchOperation).addSearchReference(searchReference); |
| | | return true; |
| | |
| | | protected boolean sendIntermediateResponseMessage( |
| | | IntermediateResponse intermediateResponse) |
| | | { |
| | | |
| | | |
| | | // FIXME -- Do we need to support internal intermediate responses? |
| | | // If so, then implement this. |
| | | return false; |
| | |
| | | boolean sendNotification, String message, |
| | | int messageID) |
| | | { |
| | | |
| | | // No implementation is required since there is nothing to |
| | | // disconnect. Further, since there is no real disconnect, we can |
| | | // wait to have the garbage collector call |
| | |
| | | */ |
| | | public boolean bindInProgress() |
| | | { |
| | | |
| | | // For internal operations, we don't care if there are any binds |
| | | // in progress. |
| | | return false; |
| | |
| | | */ |
| | | public void setBindInProgress(boolean bindInProgress) |
| | | { |
| | | |
| | | // No implementation is required. |
| | | } |
| | | |
| | |
| | | */ |
| | | public Collection<Operation> getOperationsInProgress() |
| | | { |
| | | |
| | | return operationList; |
| | | } |
| | | |
| | |
| | | */ |
| | | public Operation getOperationInProgress(int messageID) |
| | | { |
| | | |
| | | // Internal operations will not be tracked. |
| | | return null; |
| | | } |
| | |
| | | */ |
| | | public boolean removeOperationInProgress(int messageID) |
| | | { |
| | | |
| | | // No implementation is required, since internal operations will |
| | | // not be tracked. |
| | | return false; |
| | |
| | | public CancelResult cancelOperation(int messageID, |
| | | CancelRequest cancelRequest) |
| | | { |
| | | |
| | | // Internal operations cannot be cancelled. |
| | | return CancelResult.CANNOT_CANCEL; |
| | | } |
| | |
| | | */ |
| | | public void cancelAllOperations(CancelRequest cancelRequest) |
| | | { |
| | | |
| | | // No implementation is required since internal operations cannot |
| | | // be cancelled. |
| | | } |
| | |
| | | public void cancelAllOperationsExcept(CancelRequest cancelRequest, |
| | | int messageID) |
| | | { |
| | | |
| | | // No implementation is required since internal operations cannot |
| | | // be cancelled. |
| | | } |
| | |
| | | */ |
| | | public String getMonitorSummary() |
| | | { |
| | | |
| | | StringBuilder buffer = new StringBuilder(); |
| | | buffer.append("connID=\""); |
| | | buffer.append(connectionID); |
| | |
| | | */ |
| | | public void toString(StringBuilder buffer) |
| | | { |
| | | |
| | | buffer.append("InternalClientConnection(connID="); |
| | | buffer.append(connectionID); |
| | | buffer.append(", authDN=\""); |