package org.opendaylight.openflowplugin.api.openflow.md.util;
/**
- * @deprecated enum in api is not something what we would like to see in case it is evolving
- * TODO: remove class for lithium release
- *
- * List of Openflow versions supported by the plugin
- * Note: If you add a version here, make sure to update org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil as well.
- * Created by kramesha on 5/2/14.
+ * List of Openflow versions supported by the plugin.
+ * Note: If you add a version here,
+ * make sure to update org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil as well.
+ * @deprecated enum in api is not something what we would like to see in case it is evolving.
*/
public enum OpenflowVersion {
}
/**
+ * Getter.
* @return the version
*/
public short getVersion() {
-/**
+/*
* Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
+ *
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
* still null result, poll will return null. <br>
* Iterating keeps last position so this polling is supposed to be fairly
* distributed.
- *
+ *
* @param <T> common item type of zipped queues
*/
public class PollableQueuesPriorityZipper<T> {
private Queue<T> prioritizedSource;
private PollableQueuesZipper<T> zipper;
- /**
- * default ctor
- */
public PollableQueuesPriorityZipper() {
zipper = new PollableQueuesZipper<>();
}
/**
- * Add all member queues before first invocation of
- * {@link PollableQueuesPriorityZipper#poll()}
- *
- * @param queue
- * to be added to group
+ * Add all member queues before first invocation of {@link PollableQueuesPriorityZipper#poll()}.
+ * @param queue to be added to group
*/
public void addSource(Queue<T> queue) {
zipper.addSource(queue);
}
/**
+ * Next common product.
* @return next common product of polling member groups
*/
public T poll() {
-/**
+/*
* Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
- *
+ *
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
/**
* Zipper groups together a list of queues and exposes one poll method. Polling iterates through
- * all groups and returns first not-null result of poll method on each queue. If after polling each
- * grouped queue for one time there is still null result, poll will return null.
+ * all groups and returns first not-null result of poll method on each queue. If after polling each
+ * grouped queue for one time there is still null result, poll will return null.
* <br>
* Iterating keeps last position so this polling is supposed to be fairly distributed.
- *
+ *
* @param <T> common item type of zipped queues
*/
public class PollableQueuesZipper<T> {
-
+
private List<Queue<T>> sources;
private Iterator<Queue<T>> cursor;
-
- /**
- * default ctor
- */
+
public PollableQueuesZipper() {
sources = new ArrayList<>();
}
-
+
/**
- * Add all member queues before first invocation of {@link PollableQueuesZipper#poll()}
+ * Add all member queues before first invocation of {@link PollableQueuesZipper#poll()}.
* @param queue to be added to group
*/
public void addSource(Queue<T> queue) {
}
/**
+ * Next common product.
* @return next common product of polling member groups
*/
public T poll() {
if (cursor == null) {
cursor = Iterators.cycle(sources);
}
-
+
Queue<T> queue;
for (int i = 0; i < sources.size(); i++) {
queue = cursor.next();
break;
}
}
-
+
return item;
}
}