public class AttributePipe extends PipeBase
The filtering is based on attribute predicates. An attribute predicate is an
object that you provide and that only defines one method
AttributePredicate.matches(String, Object)
. If the "matches()" method
return false, the attribute is discarded from the event stream, else it is
passed to the listeners of this filter.
You can setup a predicate from all attributes (graph, node and edge attributes) and specific predicates for graph, node and edge attributes.
SourceBase.ElementType
Constructor and Description |
---|
AttributePipe() |
Modifier and Type | Method and Description |
---|---|
void |
edgeAttributeAdded(java.lang.String graphId,
long timeId,
java.lang.String edgeId,
java.lang.String attribute,
java.lang.Object value)
A edge attribute was added.
|
void |
edgeAttributeChanged(java.lang.String graphId,
long timeId,
java.lang.String edgeId,
java.lang.String attribute,
java.lang.Object oldValue,
java.lang.Object newValue)
A edge attribute was changed.
|
void |
edgeAttributeRemoved(java.lang.String graphId,
long timeId,
java.lang.String edgeId,
java.lang.String attribute)
A edge attribute was removed.
|
AttributePredicate |
getEdgeAttributeFilter()
The filter for all edge attributes.
|
AttributePredicate |
getGlobalAttributeFilter()
The filter for all graph, node and edge attributes.
|
AttributePredicate |
getGraphAttributeFilter()
The filter for all graph attributes.
|
AttributePredicate |
getNodeAttributeFilter()
The filter for all node attributes.
|
void |
graphAttributeAdded(java.lang.String graphId,
long timeId,
java.lang.String attribute,
java.lang.Object value)
A graph attribute was added.
|
void |
graphAttributeChanged(java.lang.String graphId,
long timeId,
java.lang.String attribute,
java.lang.Object oldValue,
java.lang.Object newValue)
A graph attribute was changed.
|
void |
graphAttributeRemoved(java.lang.String graphId,
long timeId,
java.lang.String attribute)
A graph attribute was removed.
|
void |
nodeAttributeAdded(java.lang.String graphId,
long timeId,
java.lang.String nodeId,
java.lang.String attribute,
java.lang.Object value)
A node attribute was added.
|
void |
nodeAttributeChanged(java.lang.String graphId,
long timeId,
java.lang.String nodeId,
java.lang.String attribute,
java.lang.Object oldValue,
java.lang.Object newValue)
A node attribute was changed.
|
void |
nodeAttributeRemoved(java.lang.String graphId,
long timeId,
java.lang.String nodeId,
java.lang.String attribute)
A node attribute was removed.
|
void |
setEdgeAttributeFilter(AttributePredicate filter)
Set an attribute filter for edge attributes only (graph an node attributes
are not filtered by this filter).
|
void |
setGlobalAttributeFilter(AttributePredicate filter)
Set an attribute filter for graph, node and edge attributes.
|
void |
setGraphAttributeFilter(AttributePredicate filter)
Set an attribute filter for graph attributes only (node an edge attributes
are not filtered by this filter).
|
void |
setNodeAttributeFilter(AttributePredicate filter)
Set an attribute filter for node attributes only (graph an edge attributes
are not filtered by this filter).
|
edgeAdded, edgeRemoved, graphCleared, nodeAdded, nodeRemoved, stepBegins
addAttributeSink, addElementSink, addSink, attributeSinks, clearAttributeSinks, clearElementSinks, clearSinks, elementSinks, removeAttributeSink, removeElementSink, removeSink, sendAttributeChangedEvent, sendAttributeChangedEvent, sendEdgeAdded, sendEdgeAdded, sendEdgeAttributeAdded, sendEdgeAttributeAdded, sendEdgeAttributeChanged, sendEdgeAttributeChanged, sendEdgeAttributeRemoved, sendEdgeAttributeRemoved, sendEdgeRemoved, sendEdgeRemoved, sendGraphAttributeAdded, sendGraphAttributeAdded, sendGraphAttributeChanged, sendGraphAttributeChanged, sendGraphAttributeRemoved, sendGraphAttributeRemoved, sendGraphCleared, sendGraphCleared, sendNodeAdded, sendNodeAdded, sendNodeAttributeAdded, sendNodeAttributeAdded, sendNodeAttributeChanged, sendNodeAttributeChanged, sendNodeAttributeRemoved, sendNodeAttributeRemoved, sendNodeRemoved, sendNodeRemoved, sendStepBegins, sendStepBegins
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAttributeSink, addElementSink, addSink, clearAttributeSinks, clearElementSinks, clearSinks, removeAttributeSink, removeElementSink, removeSink
public void setGlobalAttributeFilter(AttributePredicate filter)
filter
- The filter to use, it can be null to disable global attribute
filtering.public void setGraphAttributeFilter(AttributePredicate filter)
filter
- The filter to use, it can be null to disable graph attribute
filtering.public void setNodeAttributeFilter(AttributePredicate filter)
filter
- The filter to use, it can be null to disable node attribute
filtering.public void setEdgeAttributeFilter(AttributePredicate filter)
filter
- The filter to use, it can be null to disable edge attribute
filtering.public AttributePredicate getGlobalAttributeFilter()
public AttributePredicate getGraphAttributeFilter()
public AttributePredicate getNodeAttributeFilter()
public AttributePredicate getEdgeAttributeFilter()
public void edgeAttributeAdded(java.lang.String graphId, long timeId, java.lang.String edgeId, java.lang.String attribute, java.lang.Object value)
AttributeSink
edgeAttributeAdded
in interface AttributeSink
edgeAttributeAdded
in class PipeBase
graphId
- Identifier of the graph where the change occurred.edgeId
- Identifier of the edge whose attribute changed.attribute
- The attribute name.value
- The attribute new value.public void edgeAttributeChanged(java.lang.String graphId, long timeId, java.lang.String edgeId, java.lang.String attribute, java.lang.Object oldValue, java.lang.Object newValue)
AttributeSink
edgeAttributeChanged
in interface AttributeSink
edgeAttributeChanged
in class PipeBase
graphId
- Identifier of the graph where the change occurred.edgeId
- Identifier of the edge whose attribute changed.attribute
- The attribute name.oldValue
- The attribute old value.newValue
- The attribute new value.public void edgeAttributeRemoved(java.lang.String graphId, long timeId, java.lang.String edgeId, java.lang.String attribute)
AttributeSink
edgeAttributeRemoved
in interface AttributeSink
edgeAttributeRemoved
in class PipeBase
graphId
- Identifier of the graph where the attribute was removed.edgeId
- Identifier of the edge whose attribute was removed.attribute
- The removed attribute name.public void graphAttributeAdded(java.lang.String graphId, long timeId, java.lang.String attribute, java.lang.Object value)
AttributeSink
graphAttributeAdded
in interface AttributeSink
graphAttributeAdded
in class PipeBase
graphId
- Identifier of the graph where the attribute changed.attribute
- The attribute name.value
- The attribute new value.public void graphAttributeChanged(java.lang.String graphId, long timeId, java.lang.String attribute, java.lang.Object oldValue, java.lang.Object newValue)
AttributeSink
graphAttributeChanged
in interface AttributeSink
graphAttributeChanged
in class PipeBase
graphId
- Identifier of the graph where the attribute changed.attribute
- The attribute name.oldValue
- The attribute old value.newValue
- The attribute new value.public void graphAttributeRemoved(java.lang.String graphId, long timeId, java.lang.String attribute)
AttributeSink
graphAttributeRemoved
in interface AttributeSink
graphAttributeRemoved
in class PipeBase
graphId
- Identifier of the graph where the attribute was removed.attribute
- The removed attribute name.public void nodeAttributeAdded(java.lang.String graphId, long timeId, java.lang.String nodeId, java.lang.String attribute, java.lang.Object value)
AttributeSink
nodeAttributeAdded
in interface AttributeSink
nodeAttributeAdded
in class PipeBase
graphId
- Identifier of the graph where the change occurred.nodeId
- Identifier of the node whose attribute changed.attribute
- The attribute name.value
- The attribute new value.public void nodeAttributeChanged(java.lang.String graphId, long timeId, java.lang.String nodeId, java.lang.String attribute, java.lang.Object oldValue, java.lang.Object newValue)
AttributeSink
nodeAttributeChanged
in interface AttributeSink
nodeAttributeChanged
in class PipeBase
graphId
- Identifier of the graph where the change occurred.nodeId
- Identifier of the node whose attribute changed.attribute
- The attribute name.oldValue
- The attribute old value.newValue
- The attribute new value.public void nodeAttributeRemoved(java.lang.String graphId, long timeId, java.lang.String nodeId, java.lang.String attribute)
AttributeSink
nodeAttributeRemoved
in interface AttributeSink
nodeAttributeRemoved
in class PipeBase
graphId
- Identifier of the graph where the attribute was removed.nodeId
- Identifier of the node whose attribute was removed.attribute
- The removed attribute name.