Class OperationsQueue
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractQueue<E>
-
- java.util.concurrent.LinkedBlockingQueue<OperationRepresentation>
-
- com.cumulocity.sdk.client.devicecontrol.autopoll.OperationsQueue
-
- All Implemented Interfaces:
Serializable
,Iterable<OperationRepresentation>
,Collection<OperationRepresentation>
,BlockingQueue<OperationRepresentation>
,Queue<OperationRepresentation>
public class OperationsQueue extends LinkedBlockingQueue<OperationRepresentation>
This queue is handling operations to be processed. It's based on LinkedBlockingQueue implementation, but it assures that all operations are unique (unique means all operations in queue have unique ids). Every time new operation is added to queue, it is checked that operation with the same id doesn't exists in queue (if it does, new item is not queued).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OperationsQueue()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(OperationRepresentation arg0)
boolean
addAll(Collection<? extends OperationRepresentation> arg0)
boolean
contains(Object arg0)
static OperationsQueue
getInstance()
-
Methods inherited from class java.util.concurrent.LinkedBlockingQueue
clear, drainTo, drainTo, forEach, iterator, offer, offer, peek, poll, poll, put, remainingCapacity, remove, removeAll, removeIf, retainAll, size, spliterator, take, toArray, toArray, toString
-
Methods inherited from class java.util.AbstractQueue
element, remove
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
containsAll, equals, hashCode, isEmpty, parallelStream, stream, toArray
-
-
-
-
Method Detail
-
getInstance
public static OperationsQueue getInstance()
-
add
public boolean add(OperationRepresentation arg0)
- Specified by:
add
in interfaceBlockingQueue<OperationRepresentation>
- Specified by:
add
in interfaceCollection<OperationRepresentation>
- Specified by:
add
in interfaceQueue<OperationRepresentation>
- Overrides:
add
in classAbstractQueue<OperationRepresentation>
-
addAll
public boolean addAll(Collection<? extends OperationRepresentation> arg0)
- Specified by:
addAll
in interfaceCollection<OperationRepresentation>
- Overrides:
addAll
in classAbstractQueue<OperationRepresentation>
-
contains
public boolean contains(Object arg0)
- Specified by:
contains
in interfaceBlockingQueue<OperationRepresentation>
- Specified by:
contains
in interfaceCollection<OperationRepresentation>
- Overrides:
contains
in classLinkedBlockingQueue<OperationRepresentation>
-
-