@ConsumerType
public class ResourceChange
extends java.lang.Object
ExternalResourceChangeListener
.
For all events (local and external), the path and the type of change is
set.
Resource provider events are always local events and only provide the path.
Local events for resources provide the names of the properties that
have been added, removed or changed. This information might be missing
for external events.Modifier and Type | Class and Description |
---|---|
static class |
ResourceChange.ChangeType
The type of the change
|
Constructor and Description |
---|
ResourceChange(@NotNull ResourceChange.ChangeType changeType,
@NotNull java.lang.String path,
boolean isExternal)
Create a new change object
|
ResourceChange(@NotNull ResourceChange.ChangeType changeType,
@NotNull java.lang.String path,
boolean isExternal,
java.util.Set<java.lang.String> addedPropertyNames,
java.util.Set<java.lang.String> changedPropertyNames,
java.util.Set<java.lang.String> removedPropertyNames)
Deprecated.
The sets of property names are not supported anymore.
|
Modifier and Type | Method and Description |
---|---|
@Nullable java.util.Set<java.lang.String> |
getAddedPropertyNames()
Deprecated.
As there is no guarantee that this information is contained in the change
event, this should not be used anymore.
|
@Nullable java.util.Set<java.lang.String> |
getChangedPropertyNames()
Deprecated.
As there is no guarantee that this information is contained in the change
event, this should not be used anymore.
|
@NotNull java.lang.String |
getPath()
Get the resource path.
|
@Nullable java.util.Set<java.lang.String> |
getRemovedPropertyNames()
Deprecated.
As there is no guarantee that this information is contained in the change
event, this should not be used anymore.
|
@NotNull ResourceChange.ChangeType |
getType()
Get the type of change
|
@Nullable java.lang.String |
getUserId()
Get the user id of the user initiating the change
|
boolean |
isExternal()
Is this an external event?
|
java.lang.String |
toString() |
public ResourceChange(@NotNull @NotNull ResourceChange.ChangeType changeType, @NotNull @NotNull java.lang.String path, boolean isExternal)
changeType
- The change typepath
- The resource pathisExternal
- {code true} if the change happened on another node@Deprecated public ResourceChange(@NotNull @NotNull ResourceChange.ChangeType changeType, @NotNull @NotNull java.lang.String path, boolean isExternal, java.util.Set<java.lang.String> addedPropertyNames, java.util.Set<java.lang.String> changedPropertyNames, java.util.Set<java.lang.String> removedPropertyNames)
changeType
- The change typepath
- The resource pathisExternal
- {code true} if the change happened on another nodeaddedPropertyNames
- set of added property names, if provided must be immutablechangedPropertyNames
- set of added property names, if provided must be immutableremovedPropertyNames
- set of added property names, if provided must be immutable@NotNull public @NotNull java.lang.String getPath()
@Nullable public @Nullable java.lang.String getUserId()
null
if it's not available.public boolean isExternal()
true
if the event is external.@NotNull public @NotNull ResourceChange.ChangeType getType()
@Deprecated @Nullable public @Nullable java.util.Set<java.lang.String> getChangedPropertyNames()
null
it does not mean
that there are no changed properties. However if an empty set is
returned, it can safely be assumed that there are none. Therefore
returning {code null} is the equivalent of "don't know".null
is returned.@Deprecated @Nullable public @Nullable java.util.Set<java.lang.String> getAddedPropertyNames()
null
it does not mean
that there are no added properties. However if an empty set is
returned, it can safely be assumed that there are none. Therefore
returning {code null} is the equivalent of "don't know".null
is returned.@Deprecated @Nullable public @Nullable java.util.Set<java.lang.String> getRemovedPropertyNames()
null
it does not mean
that there are no removed properties. However if an empty set is
returned, it can safely be assumed that there are none. Therefore
returning {code null} is the equivalent of "don't know".null
is returned.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2018 The Apache Software Foundation. All rights reserved.