@ConsumerType public class ResourceChange extends 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(ResourceChange.ChangeType changeType,
String path,
boolean isExternal)
Create a new change object
|
ResourceChange(ResourceChange.ChangeType changeType,
String path,
boolean isExternal,
Set<String> addedPropertyNames,
Set<String> changedPropertyNames,
Set<String> removedPropertyNames)
Deprecated.
The sets of property names are not supported anymore.
|
Modifier and Type | Method and Description |
---|---|
Set<String> |
getAddedPropertyNames()
Deprecated.
As there is no guarantee that this information is contained in the change
event, this should not be used anymore.
|
Set<String> |
getChangedPropertyNames()
Deprecated.
As there is no guarantee that this information is contained in the change
event, this should not be used anymore.
|
String |
getPath()
Get the resource path.
|
Set<String> |
getRemovedPropertyNames()
Deprecated.
As there is no guarantee that this information is contained in the change
event, this should not be used anymore.
|
ResourceChange.ChangeType |
getType()
Get the type of change
|
String |
getUserId()
Get the user id of the user initiating the change
|
boolean |
isExternal()
Is this an external event?
|
String |
toString() |
public ResourceChange(@Nonnull ResourceChange.ChangeType changeType, @Nonnull String path, boolean isExternal)
changeType
- The change typepath
- The resource pathisExternal
- {code true} if the change happened on another node@Deprecated public ResourceChange(@Nonnull ResourceChange.ChangeType changeType, @Nonnull String path, boolean isExternal, Set<String> addedPropertyNames, Set<String> changedPropertyNames, Set<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@Nonnull public String getPath()
@CheckForNull public String getUserId()
null
if it's not available.public boolean isExternal()
true
if the event is external.@Nonnull public ResourceChange.ChangeType getType()
@Deprecated @CheckForNull public Set<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 @CheckForNull public Set<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 @CheckForNull public Set<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.Copyright © 2017 The Apache Software Foundation. All rights reserved.