public interface CommonFollower<P extends MessageProducer<P>,C extends MessageProducer<C>> extends MessageProducer<P>, MessageConsumer<C>
LogWatch
notifies it of them.
Alternatively, each Follower.tag(String)
will create a Message within
the follower and not notify anyone.Modifier and Type | Method and Description |
---|---|
Future<Message> |
expect(C condition)
Will return a future that will only return when a message arrives that
makes the given condition return true.
|
Future<Message> |
expect(C condition,
MessageAction<S> action)
Will return a future that will only return when a message arrives that
makes the given condition return true, at which point it asynchronously
executes a particular action.
|
SortedSet<Message> |
getMessages()
Retrieve all
MessageDeliveryStatus.ACCEPTED messages that this
follower has been notified of, and tags. |
SortedSet<Message> |
getMessages(MessageComparator order)
Retrieve all
MessageDeliveryStatus.ACCEPTED messages that this
follower has been notified of, and tags, in a given order. |
SortedSet<Message> |
getMessages(SimpleMessageCondition condition)
Retrieve all
MessageDeliveryStatus.ACCEPTED messages that this
follower has been notified of, if a certain condition holds true for
them, and tags. |
SortedSet<Message> |
getMessages(SimpleMessageCondition condition,
MessageComparator order)
Retrieve all
MessageDeliveryStatus.ACCEPTED messages that this
follower has been notified of, if a certain condition holds true for
them, and tags. |
MergingFollower |
mergeWith(Follower f)
Merge this
CommonFollower with another. |
MergingFollower |
mergeWith(MergingFollower f)
Merge this
CommonFollower with another. |
boolean |
write(OutputStream stream)
Will write to a stream the result of
getMessages() , using a
MessageFormatter implementation of its own choosing. |
boolean |
write(OutputStream stream,
MessageComparator order)
Will write to a stream the result of
getMessages(MessageComparator) , using a MessageFormatter
implementation of its own choosing. |
boolean |
write(OutputStream stream,
MessageComparator order,
MessageFormatter formatter)
Will write to a stream the result of
getMessages(MessageComparator) , using given
MessageFormatter . |
boolean |
write(OutputStream stream,
MessageFormatter formatter)
Will write to a stream the result of
getMessages() , using given
MessageFormatter . |
boolean |
write(OutputStream stream,
SimpleMessageCondition condition)
Will write to a stream the result of
getMessages(SimpleMessageCondition) , using a
MessageFormatter implementation of its own choosing. |
boolean |
write(OutputStream stream,
SimpleMessageCondition condition,
MessageComparator order)
Will write to a stream the result of
getMessages(SimpleMessageCondition, MessageComparator) , using a
MessageFormatter implementation of its own choosing. |
boolean |
write(OutputStream stream,
SimpleMessageCondition condition,
MessageComparator order,
MessageFormatter formatter)
Will write to a stream the result of
getMessages(SimpleMessageCondition, MessageComparator) , using
given MessageFormatter . |
boolean |
write(OutputStream stream,
SimpleMessageCondition condition,
MessageFormatter formatter)
Will write to a stream the result of
getMessages(SimpleMessageCondition) , using given
MessageFormatter . |
countConsumers, countMetrics, getMetric, getMetricId, isConsuming, isMeasuring, isMeasuring, startConsuming, startMeasuring, stopConsuming, stopMeasuring, stopMeasuring
isStopped, stop
messageReceived
SortedSet<Message> getMessages()
MessageDeliveryStatus.ACCEPTED
messages that this
follower has been notified of, and tags. They will appear in the order in
which we have been notified of them.SortedSet<Message> getMessages(MessageComparator order)
MessageDeliveryStatus.ACCEPTED
messages that this
follower has been notified of, and tags, in a given order.order
- The comparator that will be used to order the messages.SortedSet<Message> getMessages(SimpleMessageCondition condition)
MessageDeliveryStatus.ACCEPTED
messages that this
follower has been notified of, if a certain condition holds true for
them, and tags. They will be in the order given.condition
- The condition.SortedSet<Message> getMessages(SimpleMessageCondition condition, MessageComparator order)
MessageDeliveryStatus.ACCEPTED
messages that this
follower has been notified of, if a certain condition holds true for
them, and tags. They will be in the order in which we have been notified
of them.condition
- The condition.order
- The comparator that will be used to order the messages.MergingFollower mergeWith(Follower f)
CommonFollower
with another. This
CommonFollower
has a responsibility of notifying the resulting
MergingFollower
of every Message
that it receives, until
such time that MergingFollower.remove(Follower)
is called on it.f
- To merge with.MergingFollower
, that will merge both
CommonFollower
s. If any of the CommonFollower
s
already is a MergingFollower
, the returned instance will
hold every merged CommonFollower
individually and not
compose MergingFollower
s.MergingFollower mergeWith(MergingFollower f)
CommonFollower
with another. This
CommonFollower
has a responsibility of notifying the resulting
MergingFollower
of every Message
that it receives, until
such time that MergingFollower.remove(Follower)
is called on it.f
- To merge with.MergingFollower
, that will merge both
CommonFollower
s. If any of the CommonFollower
s
already is a MergingFollower
, the returned instance will
hold every merged CommonFollower
individually and not
compose MergingFollower
s.boolean write(OutputStream stream)
getMessages()
, using a
MessageFormatter
implementation of its own choosing. Will close
the stream.stream
- Target.boolean write(OutputStream stream, MessageComparator order)
getMessages(MessageComparator)
, using a MessageFormatter
implementation of its own choosing. Will close the stream.stream
- Target.order
- The comparator to pass to
getMessages(MessageComparator)
.boolean write(OutputStream stream, MessageComparator order, MessageFormatter formatter)
getMessages(MessageComparator)
, using given
MessageFormatter
. Will close the stream.stream
- Target.order
- The comparator to pass to
getMessages(MessageComparator)
.formatter
- Formatter to use to transform message into string.boolean write(OutputStream stream, MessageFormatter formatter)
getMessages()
, using given
MessageFormatter
. Will close the stream.stream
- Target.formatter
- Formatter to use to transform message into string.boolean write(OutputStream stream, SimpleMessageCondition condition)
getMessages(SimpleMessageCondition)
, using a
MessageFormatter
implementation of its own choosing. Will close
the stream.stream
- Target.condition
- The condition to pass to
getMessages(SimpleMessageCondition)
.boolean write(OutputStream stream, SimpleMessageCondition condition, MessageComparator order)
getMessages(SimpleMessageCondition, MessageComparator)
, using a
MessageFormatter
implementation of its own choosing. Will close
the stream.stream
- Target.condition
- The condition to pass to
getMessages(SimpleMessageCondition, MessageComparator)
.order
- The comparator to pass to
getMessages(SimpleMessageCondition, MessageComparator)
.boolean write(OutputStream stream, SimpleMessageCondition condition, MessageComparator order, MessageFormatter formatter)
getMessages(SimpleMessageCondition, MessageComparator)
, using
given MessageFormatter
. Will close the stream.stream
- Target.condition
- The condition to pass to
getMessages(SimpleMessageCondition, MessageComparator)
.order
- The comparator to pass to
getMessages(SimpleMessageCondition, MessageComparator)
.formatter
- Formatter to use to transform message into string.boolean write(OutputStream stream, SimpleMessageCondition condition, MessageFormatter formatter)
getMessages(SimpleMessageCondition)
, using given
MessageFormatter
. Will close the stream.stream
- Target.condition
- The condition to pass to
getMessages(SimpleMessageCondition)
.formatter
- Formatter to use to transform message into string.Future<Message> expect(C condition)
condition
- Condition that needs to be true for the future to unblock.Future<Message> expect(C condition, MessageAction<S> action)
condition
- Condition that needs to be true for the future to unblock.action
- Action to execute when the condition becomes true.Copyright © 2015. All rights reserved.