Working with OVS
[vpnservice.git] / mdsalutil / mdsalutil-api / src / main / java / org / opendaylight / vpnservice / datastoreutils / JobQueue.java
1 /*
2  * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.vpnservice.datastoreutils;
10
11 import java.util.concurrent.ConcurrentLinkedQueue;
12
13 public class JobQueue {
14     private ConcurrentLinkedQueue<JobEntry> waitingEntries;
15     private JobEntry executingEntry;
16
17     public JobQueue() {
18         waitingEntries = new ConcurrentLinkedQueue<JobEntry>();
19     }
20
21     public void addEntry(JobEntry entry) {
22         waitingEntries.add(entry); // FIXME - Try/Catch.
23     }
24
25     public ConcurrentLinkedQueue<JobEntry> getWaitingEntries() {
26         return waitingEntries;
27     }
28
29     public JobEntry getExecutingEntry() {
30         return executingEntry;
31     }
32
33     public void setExecutingEntry(JobEntry executingEntry) {
34         this.executingEntry = executingEntry;
35     }
36 }