Package com.adaptris.core.runtime
Class MessageErrorDigest
- All Implemented Interfaces:
Serializable
,Iterable<MessageDigestErrorEntry>
,Collection<MessageDigestErrorEntry>
,List<MessageDigestErrorEntry>
public class MessageErrorDigest
extends AbstractCollection<MessageDigestErrorEntry>
implements Serializable, List<MessageDigestErrorEntry>
MessageErrorDigest that contains a fixed size list of the last n errors.
Note that while this list implements the List
interface, the optional operations List.add(int, Object)
,
List.addAll(int, Collection)
and List.set(int, Object)
will throw an UnsupportedOperationException
.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Default max messages = 100 -
Constructor Summary
ConstructorsConstructorDescriptionMessageErrorDigest
(int size, MessageErrorDigest digest, int fromIndex) Returns a new MessageErrorDigest which contains a view of the portion of this list between the specified fromIndex, inclusive, the end of the list exclusive.MessageErrorDigest
(int size, MessageErrorDigest digest, int fromIndex, int toIndex) Returns a new MessageErrorDigest which contains a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.MessageErrorDigest
(int size, Collection<MessageDigestErrorEntry> original) Return a new MessageErrorDigest which contains this collection ofMessageDigestErrorEntry
objects.MessageErrorDigest
(MessageErrorDigest digest, int fromIndex) Returns a new MessageErrorDigest which contains a view of the portion of this list between the specified fromIndex, inclusive, the end of the list exclusive.MessageErrorDigest
(MessageErrorDigest digest, int fromIndex, int toIndex) Returns a new MessageErrorDigest which contains a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.MessageErrorDigest
(Collection<MessageDigestErrorEntry> original) Return a new MessageErrorDigest which contains this collection ofMessageDigestErrorEntry
objects. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(int index, MessageDigestErrorEntry element) boolean
boolean
addAll
(int index, Collection<? extends MessageDigestErrorEntry> c) get
(int index) int
int
iterator()
int
listIterator
(int index) remove
(int index) set
(int index, MessageDigestErrorEntry element) void
setMaxMessages
(int maxMessages) Set the maximum number of messages this digester will cache.int
size()
subList
(int fromIndex, int toIndex) Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Field Details
-
DEFAULT_MAX_MESSAGES
public static final int DEFAULT_MAX_MESSAGESDefault max messages = 100- See Also:
-
-
Constructor Details
-
MessageErrorDigest
public MessageErrorDigest() -
MessageErrorDigest
Return a new MessageErrorDigest which contains this collection ofMessageDigestErrorEntry
objects.The max size of the list is set to be
DEFAULT_MAX_MESSAGES
- Parameters:
original
- the original collection of errors.
-
MessageErrorDigest
Return a new MessageErrorDigest which contains this collection ofMessageDigestErrorEntry
objects.- Parameters:
size
- the size of the new list.original
- the original collection of errors.
-
MessageErrorDigest
Returns a new MessageErrorDigest which contains a view of the portion of this list between the specified fromIndex, inclusive, the end of the list exclusive.The max size of the list is set to be
DEFAULT_MAX_MESSAGES
- Parameters:
digest
- the original digestfromIndex
- low endpoint (inclusive) of the subList- See Also:
-
MessageErrorDigest
Returns a new MessageErrorDigest which contains a view of the portion of this list between the specified fromIndex, inclusive, the end of the list exclusive.- Parameters:
size
- the max size of the new list.digest
- the original digestfromIndex
- low endpoint (inclusive) of the subList- See Also:
-
MessageErrorDigest
Returns a new MessageErrorDigest which contains a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.- Parameters:
digest
- the originalfromIndex
- low endpoint (inclusive) of the subListtoIndex
- high endpoint (exclusive) of the subList- See Also:
-
MessageErrorDigest
Returns a new MessageErrorDigest which contains a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.The max size of the list is set to be
DEFAULT_MAX_MESSAGES
- Parameters:
size
- the max size of the new listdigest
- the originalfromIndex
- low endpoint (inclusive) of the subListtoIndex
- high endpoint (exclusive) of the subList- See Also:
-
-
Method Details
-
getMaxMessages
public int getMaxMessages() -
setMaxMessages
public void setMaxMessages(int maxMessages) Set the maximum number of messages this digester will cache. If the internal cache fills up, then a First in, First out algorithm is used to continue caching any messages that have failed.- Parameters:
maxMessages
- the max number of messages.
-
addAll
- Specified by:
addAll
in interfaceList<MessageDigestErrorEntry>
-
add
- Specified by:
add
in interfaceCollection<MessageDigestErrorEntry>
- Specified by:
add
in interfaceList<MessageDigestErrorEntry>
- Overrides:
add
in classAbstractCollection<MessageDigestErrorEntry>
-
get
- Specified by:
get
in interfaceList<MessageDigestErrorEntry>
-
set
- Specified by:
set
in interfaceList<MessageDigestErrorEntry>
-
add
- Specified by:
add
in interfaceList<MessageDigestErrorEntry>
-
remove
- Specified by:
remove
in interfaceList<MessageDigestErrorEntry>
-
indexOf
- Specified by:
indexOf
in interfaceList<MessageDigestErrorEntry>
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<MessageDigestErrorEntry>
-
listIterator
- Specified by:
listIterator
in interfaceList<MessageDigestErrorEntry>
-
listIterator
- Specified by:
listIterator
in interfaceList<MessageDigestErrorEntry>
-
subList
- Specified by:
subList
in interfaceList<MessageDigestErrorEntry>
-
iterator
- Specified by:
iterator
in interfaceCollection<MessageDigestErrorEntry>
- Specified by:
iterator
in interfaceIterable<MessageDigestErrorEntry>
- Specified by:
iterator
in interfaceList<MessageDigestErrorEntry>
- Specified by:
iterator
in classAbstractCollection<MessageDigestErrorEntry>
-
size
public int size()- Specified by:
size
in interfaceCollection<MessageDigestErrorEntry>
- Specified by:
size
in interfaceList<MessageDigestErrorEntry>
- Specified by:
size
in classAbstractCollection<MessageDigestErrorEntry>
-