001/* 002 * Copyright 2014-2017 UnboundID Corp. 003 * All Rights Reserved. 004 */ 005/* 006 * Copyright (C) 2014-2017 UnboundID Corp. 007 * 008 * This program is free software; you can redistribute it and/or modify 009 * it under the terms of the GNU General Public License (GPLv2 only) 010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only) 011 * as published by the Free Software Foundation. 012 * 013 * This program is distributed in the hope that it will be useful, 014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 016 * GNU General Public License for more details. 017 * 018 * You should have received a copy of the GNU General Public License 019 * along with this program; if not, see <http://www.gnu.org/licenses>. 020 */ 021package com.unboundid.ldap.listener.interceptor; 022 023 024 025import com.unboundid.ldap.sdk.ExtendedResult; 026import com.unboundid.ldap.sdk.LDAPException; 027import com.unboundid.util.NotExtensible; 028import com.unboundid.util.ThreadSafety; 029import com.unboundid.util.ThreadSafetyLevel; 030 031 032 033/** 034 * This class provides an API that can be used in the course of processing a 035 * result via the {@link InMemoryOperationInterceptor} API. 036 */ 037@NotExtensible() 038@ThreadSafety(level=ThreadSafetyLevel.INTERFACE_NOT_THREADSAFE) 039public interface InMemoryInterceptedResult 040{ 041 /** 042 * Retrieves the connection ID for the associated client connection. 043 * 044 * @return The connection ID for the associated client connection. 045 */ 046 long getConnectionID(); 047 048 049 050 /** 051 * Retrieves the server address to which the client is connected, if 052 * available. 053 * 054 * @return The server address to which the client is connected, or 055 * {@code null} if this is not available for some reason. 056 */ 057 String getConnectedAddress(); 058 059 060 061 /** 062 * Retrieves the server port to which the client is connected, if available. 063 * 064 * @return The server port to which the client is connected, or -1 if this is 065 * not available for some reason. 066 */ 067 int getConnectedPort(); 068 069 070 071 /** 072 * Retrieves the LDAP message ID for this operation. 073 * 074 * @return The LDAP message ID for this operation. 075 */ 076 int getMessageID(); 077 078 079 080 /** 081 * Sends an unsolicited notification message to the client. 082 * 083 * @param unsolicitedNotification The unsolicited notification to send to 084 * the client. It must not be {@code null}. 085 * 086 * @throws LDAPException If a problem is encountered while trying to send 087 * the unsolicited notification. 088 */ 089 void sendUnsolicitedNotification(final ExtendedResult unsolicitedNotification) 090 throws LDAPException; 091 092 093 094 /** 095 * Retrieves the value for a property that has previously been set for this 096 * operation. This can be used to help maintain state information across the 097 * request and response for an operation. 098 * 099 * @param name The name of the property for which to retrieve the 100 * corresponding value. It must not be {@code null}. 101 * 102 * @return The value for the requested property, or {@code null} if there is 103 * no value for the specified property. 104 */ 105 Object getProperty(final String name); 106}