Skip to content

Commit

Permalink
Remove deprecated IMap methods accepting EntryListener
Browse files Browse the repository at this point in the history
Replaced with MapListener
  • Loading branch information
taburet committed Oct 21, 2019
1 parent fc77d2a commit 1f95929
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 588 deletions.
Expand Up @@ -101,7 +101,6 @@
import com.hazelcast.config.IndexConfig;
import com.hazelcast.core.EntryEvent;
import com.hazelcast.core.EntryEventType;
import com.hazelcast.core.EntryListener;
import com.hazelcast.core.EntryView;
import com.hazelcast.core.ExecutionCallback;
import com.hazelcast.core.ReadOnly;
Expand Down Expand Up @@ -788,25 +787,13 @@ public UUID addLocalEntryListener(@Nonnull MapListener listener) {
throw new UnsupportedOperationException("Locality is ambiguous for client!");
}

@Override
public UUID addLocalEntryListener(@Nonnull EntryListener<K, V> listener) {
throw new UnsupportedOperationException("Locality is ambiguous for client!");
}

@Override
public UUID addLocalEntryListener(@Nonnull MapListener listener,
@Nonnull Predicate<K, V> predicate,
boolean includeValue) {
throw new UnsupportedOperationException("Locality is ambiguous for client!");
}

@Override
public UUID addLocalEntryListener(@Nonnull EntryListener<K, V> listener,
@Nonnull Predicate<K, V> predicate,
boolean includeValue) {
throw new UnsupportedOperationException("Locality is ambiguous for client!");
}

@Override
public UUID addLocalEntryListener(@Nonnull MapListener listener,
@Nonnull Predicate<K, V> predicate,
Expand All @@ -815,14 +802,6 @@ public UUID addLocalEntryListener(@Nonnull MapListener listener,
throw new UnsupportedOperationException("Locality is ambiguous for client!");
}

@Override
public UUID addLocalEntryListener(@Nonnull EntryListener<K, V> listener,
@Nonnull Predicate<K, V> predicate,
@Nullable K key,
boolean includeValue) {
throw new UnsupportedOperationException("Locality is ambiguous for client!");
}

@Override
public String addInterceptor(@Nonnull MapInterceptor interceptor) {
checkNotNull(interceptor, "Interceptor should not be null!");
Expand All @@ -849,14 +828,6 @@ public UUID addEntryListener(@Nonnull MapListener listener, boolean includeValue
return addEntryListenerInternal(listenerAdaptor, includeValue);
}

@Override
public UUID addEntryListener(@Nonnull EntryListener<K, V> listener,
boolean includeValue) {
checkNotNull(listener, NULL_LISTENER_IS_NOT_ALLOWED);
ListenerAdapter<IMapEvent> listenerAdaptor = createListenerAdapter(listener);
return addEntryListenerInternal(listenerAdaptor, includeValue);
}

private UUID addEntryListenerInternal(ListenerAdapter<IMapEvent> listenerAdaptor, boolean includeValue) {
int listenerFlags = setAndGetListenerFlags(listenerAdaptor);
EventHandler<ClientMessage> handler = new ClientMapEventHandler(listenerAdaptor);
Expand Down Expand Up @@ -938,16 +909,6 @@ public UUID addEntryListener(@Nonnull MapListener listener, @Nonnull K key, bool
return addEntryListenerInternal(listenerAdaptor, key, includeValue);
}

@Override
public UUID addEntryListener(@Nonnull EntryListener<K, V> listener,
@Nonnull K key,
boolean includeValue) {
checkNotNull(listener, NULL_LISTENER_IS_NOT_ALLOWED);
checkNotNull(key, NULL_KEY_IS_NOT_ALLOWED);
ListenerAdapter<IMapEvent> listenerAdaptor = createListenerAdapter(listener);
return addEntryListenerInternal(listenerAdaptor, key, includeValue);
}

private UUID addEntryListenerInternal(ListenerAdapter<IMapEvent> listenerAdaptor, K key, boolean includeValue) {
int listenerFlags = setAndGetListenerFlags(listenerAdaptor);
Data keyData = toData(key);
Expand Down Expand Up @@ -993,19 +954,6 @@ public UUID addEntryListener(@Nonnull MapListener listener,
: addEntryListenerInternal(listenerAdaptor, predicate, key, includeValue);
}

@Override
public UUID addEntryListener(@Nonnull EntryListener<K, V> listener,
@Nonnull Predicate<K, V> predicate,
@Nullable K key,
boolean includeValue) {
checkNotNull(listener, NULL_LISTENER_IS_NOT_ALLOWED);
checkNotNull(predicate, NULL_PREDICATE_IS_NOT_ALLOWED);
ListenerAdapter<IMapEvent> listenerAdaptor = createListenerAdapter(listener);
return key == null
? addEntryListenerInternal(listenerAdaptor, predicate, includeValue)
: addEntryListenerInternal(listenerAdaptor, predicate, key, includeValue);
}

private UUID addEntryListenerInternal(@Nonnull ListenerAdapter<IMapEvent> listenerAdaptor,
@Nonnull Predicate<K, V> predicate,
@Nullable K key,
Expand Down Expand Up @@ -1055,16 +1003,6 @@ public UUID addEntryListener(@Nonnull MapListener listener,
return addEntryListenerInternal(listenerAdaptor, predicate, includeValue);
}

@Override
public UUID addEntryListener(@Nonnull EntryListener<K, V> listener,
@Nonnull Predicate<K, V> predicate,
boolean includeValue) {
checkNotNull(listener, NULL_LISTENER_IS_NOT_ALLOWED);
checkNotNull(predicate, NULL_PREDICATE_IS_NOT_ALLOWED);
ListenerAdapter<IMapEvent> listenerAdaptor = createListenerAdapter(listener);
return addEntryListenerInternal(listenerAdaptor, predicate, includeValue);
}

private UUID addEntryListenerInternal(ListenerAdapter<IMapEvent> listenerAdapter,
Predicate<K, V> predicate,
boolean includeValue) {
Expand Down
138 changes: 0 additions & 138 deletions hazelcast/src/main/java/com/hazelcast/map/IMap.java
Expand Up @@ -19,7 +19,6 @@
import com.hazelcast.aggregation.Aggregator;
import com.hazelcast.config.IndexConfig;
import com.hazelcast.config.IndexType;
import com.hazelcast.core.EntryListener;
import com.hazelcast.core.EntryView;
import com.hazelcast.core.ExecutionCallback;
import com.hazelcast.core.Offloadable;
Expand Down Expand Up @@ -1914,29 +1913,6 @@ boolean tryLock(@Nonnull K key,
*/
UUID addLocalEntryListener(@Nonnull MapListener listener);

/**
* Adds a local entry listener for this map. The added listener will only be
* listening for the events (add/remove/update/evict) of the locally owned entries.
* <p>
* Note that entries in distributed map are partitioned across
* the cluster members; each member owns and manages the some portion of the
* entries. Owned entries are called local entries. This
* listener will be listening for the events of local entries. Let's say
* your cluster has member1 and member2. On member2 you added a local listener and from
* member1, you call {@code map.put(key2, value2)}.
* If the key2 is owned by member2 then the local listener will be
* notified for the add/update event. Also note that entries can migrate to
* other nodes for load balancing and/or membership change.
*
* @param listener entry listener
* @return a UUID.randomUUID().toString() which is used as a key to remove the listener
* @throws UnsupportedOperationException if this operation isn't supported, for example on a Hazelcast client
* @throws NullPointerException if the listener is {@code null}
* @see #localKeySet()
* @deprecated please use {@link #addLocalEntryListener(MapListener)} instead
*/
UUID addLocalEntryListener(@Nonnull EntryListener<K, V> listener);

/**
* Adds a {@link MapListener} for this map.
* <p>
Expand All @@ -1956,26 +1932,6 @@ UUID addLocalEntryListener(@Nonnull MapListener listener,
@Nonnull Predicate<K, V> predicate,
boolean includeValue);

/**
* Adds a local entry listener for this map.
* <p>
* The added listener will only be listening for the events
* (add/remove/update/evict) of the locally owned entries.
* The listener will get notified for map add/remove/update/evict events
* filtered by the given predicate.
*
* @param listener entry listener
* @param predicate predicate for filtering entries
* @param includeValue {@code true} if {@code EntryEvent} should contain the value
* @return a UUID.randomUUID().toString() which is used as a key to remove the listener
* @throws NullPointerException if the listener is {@code null}
* @throws NullPointerException if the predicate is {@code null}
* @deprecated please use {@link #addLocalEntryListener(MapListener, com.hazelcast.query.Predicate, boolean)} instead
*/
UUID addLocalEntryListener(@Nonnull EntryListener<K, V> listener,
@Nonnull Predicate<K, V> predicate,
boolean includeValue);

/**
* Adds a local entry listener for this map.
* <p>
Expand All @@ -1998,28 +1954,6 @@ UUID addLocalEntryListener(@Nonnull MapListener listener,
@Nullable K key,
boolean includeValue);

/**
* Adds a local entry listener for this map.
* <p>
* The added listener will only be listening for the events
* (add/remove/update/evict) of the locally owned entries.
* The listener will get notified for map add/remove/update/evict events
* filtered by the given predicate.
*
* @param listener entry listener
* @param predicate predicate for filtering entries
* @param key key to listen fo
* @param includeValue {@code true} if {@code EntryEvent} should contain the value
* @return a UUID.randomUUID().toString() which is used as a key to remove the listener
* @throws NullPointerException if the listener is {@code null}
* @throws NullPointerException if the predicate is {@code null}
* @deprecated please use {@link #addLocalEntryListener(MapListener, com.hazelcast.query.Predicate, Object, boolean)} instead
*/
UUID addLocalEntryListener(@Nonnull EntryListener<K, V> listener,
@Nonnull Predicate<K, V> predicate,
@Nullable K key,
boolean includeValue);

/**
* Adds an interceptor for this map.
* <p>
Expand Down Expand Up @@ -2054,20 +1988,6 @@ UUID addLocalEntryListener(@Nonnull EntryListener<K, V> listener,
*/
UUID addEntryListener(@Nonnull MapListener listener, boolean includeValue);

/**
* Adds an entry listener for this map.
* <p>
* The listener will get notified for all map add/remove/update/evict events.
*
* @param listener the added entry listener for this map
* @param includeValue {@code true} if {@code EntryEvent} should contain the value
* @return a UUID.randomUUID().toString() which is used as a key to remove the listener
* @throws NullPointerException if the specified listener is {@code null}
* @deprecated please use {@link #addEntryListener(MapListener, boolean)} instead
*/
UUID addEntryListener(@Nonnull EntryListener<K, V> listener,
boolean includeValue);

/**
* Removes the specified entry listener.
* <p>
Expand Down Expand Up @@ -2136,30 +2056,6 @@ UUID addEntryListener(@Nonnull EntryListener<K, V> listener,
*/
UUID addEntryListener(@Nonnull MapListener listener, @Nonnull K key, boolean includeValue);

/**
* Adds the specified entry listener for the specified key.
* <p>
* The listener will get notified for all add/remove/update/evict events of
* the specified key only.
* <p>
* <b>Warning:</b>
* <p>
* This method uses {@code hashCode} and {@code equals} of the binary form of
* the {@code key}, not the actual implementations of {@code hashCode} and {@code equals}
* defined in the {@code key}'s class.
*
* @param listener specified entry listener
* @param key key to listen for
* @param includeValue {@code true} if {@code EntryEvent} should contain the value
* @return a UUID.randomUUID().toString() which is used as a key to remove the listener
* @throws NullPointerException if the specified listener is {@code null}
* @throws NullPointerException if the specified key is {@code null}
* @deprecated please use {@link #addEntryListener(MapListener, Object, boolean)} instead
*/
UUID addEntryListener(@Nonnull EntryListener<K, V> listener,
@Nonnull K key,
boolean includeValue);

/**
* Adds a {@link MapListener} for this map.
* <p>
Expand All @@ -2178,22 +2074,6 @@ UUID addEntryListener(@Nonnull MapListener listener,
@Nonnull Predicate<K, V> predicate,
boolean includeValue);

/**
* Adds an continuous entry listener for this map.
* <p>
* The listener will get notified for map add/remove/update/evict events filtered by the given predicate.
*
* @param listener the added continuous entry listener for this map
* @param predicate predicate for filtering entries
* @param includeValue {@code true} if {@code EntryEvent} should contain the value
* @return a UUID.randomUUID().toString() which is used as a key to remove the listener
* @throws NullPointerException if the specified {@code listener} or {@code predicate} is {@code null}
* @deprecated please use {@link #addEntryListener(MapListener, com.hazelcast.query.Predicate, boolean)} instead
*/
UUID addEntryListener(@Nonnull EntryListener<K, V> listener,
@Nonnull Predicate<K, V> predicate,
boolean includeValue);

/**
* Adds a {@link MapListener} for this map.
* <p>
Expand All @@ -2212,24 +2092,6 @@ UUID addEntryListener(@Nonnull MapListener listener,
@Nullable K key,
boolean includeValue);

/**
* Adds an continuous entry listener for this map.
* <p>
* The listener will get notified for map add/remove/update/evict events filtered by the given predicate.
*
* @param listener the continuous entry listener for this map
* @param predicate predicate for filtering entries
* @param key key to listen for
* @param includeValue {@code true} if {@code EntryEvent} should contain the value
* @return a UUID.randomUUID().toString() which is used as a key to remove the listener
* @throws NullPointerException if the specified {@code listener} or {@code predicate} is {@code null}
* @deprecated please use {@link #addEntryListener(MapListener, com.hazelcast.query.Predicate, Object, boolean)} instead
*/
UUID addEntryListener(@Nonnull EntryListener<K, V> listener,
@Nonnull Predicate<K, V> predicate,
@Nullable K key,
boolean includeValue);

/**
* Returns the {@code EntryView} for the specified key.
* <p>
Expand Down

0 comments on commit 1f95929

Please sign in to comment.