com.cumulocity.sdk.client.devicecontrol.autopoll
Class OperationsQueue

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue<E>
          extended by java.util.concurrent.LinkedBlockingQueue<OperationRepresentation>
              extended by 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
OperationsQueue()
           
 
Method Summary
 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, iterator, offer, offer, peek, poll, poll, put, remainingCapacity, remove, size, take, toArray, toArray, toString
 
Methods inherited from class java.util.AbstractQueue
element, remove
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Queue
element, remove
 
Methods inherited from interface java.util.Collection
containsAll, equals, hashCode, isEmpty, removeAll, retainAll
 

Constructor Detail

OperationsQueue

public OperationsQueue()
Method Detail

getInstance

public static OperationsQueue getInstance()

add

public boolean add(OperationRepresentation arg0)
Specified by:
add in interface Collection<OperationRepresentation>
Specified by:
add in interface BlockingQueue<OperationRepresentation>
Specified by:
add in interface Queue<OperationRepresentation>
Overrides:
add in class AbstractQueue<OperationRepresentation>

addAll

public boolean addAll(Collection<? extends OperationRepresentation> arg0)
Specified by:
addAll in interface Collection<OperationRepresentation>
Overrides:
addAll in class AbstractQueue<OperationRepresentation>

contains

public boolean contains(Object arg0)
Specified by:
contains in interface Collection<OperationRepresentation>
Specified by:
contains in interface BlockingQueue<OperationRepresentation>
Overrides:
contains in class AbstractCollection<OperationRepresentation>


Copyright © 2013 (C) Cumulocity GmbH. All Rights Reserved.