Package org.neo4j.cdc.client.selector
Class EntitySelector
- java.lang.Object
-
- org.neo4j.cdc.client.selector.EntitySelector
-
- All Implemented Interfaces:
Selector
- Direct Known Subclasses:
NodeSelector,RelationshipSelector
public class EntitySelector extends Object implements Selector
Provides a means to filter changes regardless of the entity type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEntitySelector.Builder<T extends EntitySelector.Builder<?,?>,S extends EntitySelector>
-
Constructor Summary
Constructors Modifier Constructor Description protectedEntitySelector(@Nullable EntityOperation operation, @NotNull Set<String> changesTo, @Nullable String executingUser, @Nullable String authenticatedUser, @NotNull Map<String,Object> txMetadata, @NotNull Set<String> includeProperties, @NotNull Set<String> excludeProperties)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeEventapplyProperties(ChangeEvent e)Performs desired filtering of property names based on includeProperties and excludeProperties.Map<String,Object>asMap()Returns a map representation of this selector to be sent over to server.static EntitySelector.Builder<?,?>builder()Returns a builder instance forEntitySelector.booleanequals(Object o)@Nullable StringgetAuthenticatedUser()Authenticated user that performed the change.@NotNull Set<String>getChangesTo()Set of property names that have been added/updated or removed on the entity as a result of the change.@NotNull Set<String>getExcludeProperties()Set of properties to exclude from the returned change events.@Nullable StringgetExecutingUser()Executing user that performed the change.@NotNull Set<String>getIncludeProperties()Set of properties to include in the returned change events.@Nullable EntityOperationgetOperation()Operation type performed on the entity.@NotNull Map<String,Object>getTxMetadata()Transaction metadata to match on the underlying transaction of the change.inthashCode()booleanmatches(ChangeEvent e)Checks if a given change event matches this selector.
-
-
-
Constructor Detail
-
EntitySelector
protected EntitySelector(@Nullable @Nullable EntityOperation operation, @NotNull @NotNull Set<String> changesTo, @Nullable @Nullable String executingUser, @Nullable @Nullable String authenticatedUser, @NotNull @NotNull Map<String,Object> txMetadata, @NotNull @NotNull Set<String> includeProperties, @NotNull @NotNull Set<String> excludeProperties)
-
-
Method Detail
-
getOperation
@Nullable public @Nullable EntityOperation getOperation()
Operation type performed on the entity.- Returns:
- operation type
-
getChangesTo
@NotNull public @NotNull Set<String> getChangesTo()
Set of property names that have been added/updated or removed on the entity as a result of the change.- Returns:
- set of properties
-
getExecutingUser
@Nullable public @Nullable String getExecutingUser()
Executing user that performed the change.- Returns:
- executing user
-
getAuthenticatedUser
@Nullable public @Nullable String getAuthenticatedUser()
Authenticated user that performed the change.- Returns:
- authenticated user
-
getTxMetadata
@NotNull public @NotNull Map<String,Object> getTxMetadata()
Transaction metadata to match on the underlying transaction of the change.- Returns:
- transaction metadata
-
getIncludeProperties
@NotNull public @NotNull Set<String> getIncludeProperties()
Set of properties to include in the returned change events.- Returns:
- set of properties
-
getExcludeProperties
@NotNull public @NotNull Set<String> getExcludeProperties()
Set of properties to exclude from the returned change events.- Returns:
- set of properties
-
matches
public boolean matches(ChangeEvent e)
Checks if a given change event matches this selector.
-
applyProperties
public ChangeEvent applyProperties(ChangeEvent e)
Performs desired filtering of property names based on includeProperties and excludeProperties.- Specified by:
applyPropertiesin interfaceSelector- Parameters:
e- change event to apply filtering on- Returns:
- a new change event with filters applied
-
asMap
public Map<String,Object> asMap()
Returns a map representation of this selector to be sent over to server.
-
builder
public static EntitySelector.Builder<?,?> builder()
Returns a builder instance forEntitySelector.- Returns:
- builder instance
-
-