<id>jboss.releases</id>\r
<name>jboss.releases</name>\r
<url>${nexusproxy}/repositories/jboss.releases/</url>\r
+ <snapshots>\r
+ <enabled>false</enabled>\r
+ </snapshots>\r
+ <releases>\r
+ <enabled>true</enabled>\r
+ </releases>\r
</repository>\r
<!-- OpenDayLight Released artifact -->\r
<repository>\r
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>${enforcer.version}</version>
+ <executions>
+ <execution>
+ <id>enforce-banned-dependencies</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <bannedDependencies>
+ <excludes>
+ <exclude>org.infinispan:infinispan-core:*</exclude>
+ </excludes>
+ <includes>
+ <include>org.infinispan:infinispan-core:[5.3.0.Final]</include>
+ </includes>
+ </bannedDependencies>
+ </rules>
+ <fail>true</fail>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<dependencies>
--- /dev/null
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009 Red Hat Inc. and/or its affiliates and other
+ * contributors as indicated by the @author tags. All rights reserved.
+ * See the copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.infinispan.interceptors.distribution;
+
+import org.infinispan.CacheException;
+import org.infinispan.commands.FlagAffectedCommand;
+import org.infinispan.commands.remote.ClusteredGetCommand;
+import org.infinispan.commands.write.DataWriteCommand;
+import org.infinispan.commands.write.WriteCommand;
+import org.infinispan.container.entries.InternalCacheEntry;
+import org.infinispan.container.entries.InternalCacheValue;
+import org.infinispan.context.InvocationContext;
+import org.infinispan.context.impl.TxInvocationContext;
+import org.infinispan.distribution.DistributionManager;
+import org.infinispan.factories.annotations.Inject;
+import org.infinispan.interceptors.ClusteringInterceptor;
+import org.infinispan.interceptors.locking.ClusteringDependentLogic;
+import org.infinispan.remoting.responses.ClusteredGetResponseValidityFilter;
+import org.infinispan.remoting.responses.ExceptionResponse;
+import org.infinispan.remoting.responses.Response;
+import org.infinispan.remoting.responses.SuccessfulResponse;
+import org.infinispan.remoting.rpc.ResponseFilter;
+import org.infinispan.remoting.rpc.ResponseMode;
+import org.infinispan.remoting.rpc.RpcOptions;
+import org.infinispan.remoting.transport.Address;
+import org.infinispan.transaction.xa.GlobalTransaction;
+import org.infinispan.util.logging.Log;
+import org.infinispan.util.logging.LogFactory;
+
+import java.util.*;
+
+/**
+ * Base class for distribution of entries across a cluster.
+ *
+ * @author Manik Surtani
+ * @author Mircea.Markus@jboss.com
+ * @author Pete Muir
+ * @author Dan Berindei <dan@infinispan.org>
+ * @since 4.0
+ */
+public abstract class BaseDistributionInterceptor extends ClusteringInterceptor {
+
+ protected DistributionManager dm;
+
+ protected ClusteringDependentLogic cdl;
+
+ private static final Log log = LogFactory.getLog(BaseDistributionInterceptor.class);
+
+ @Override
+ protected Log getLog() {
+ return log;
+ }
+
+ @Inject
+ public void injectDependencies(DistributionManager distributionManager, ClusteringDependentLogic cdl) {
+ this.dm = distributionManager;
+ this.cdl = cdl;
+ }
+
+ @Override
+ protected final InternalCacheEntry retrieveFromRemoteSource(Object key, InvocationContext ctx, boolean acquireRemoteLock, FlagAffectedCommand command) throws Exception {
+ GlobalTransaction gtx = acquireRemoteLock ? ((TxInvocationContext)ctx).getGlobalTransaction() : null;
+ ClusteredGetCommand get = cf.buildClusteredGetCommand(key, command.getFlags(), acquireRemoteLock, gtx);
+
+ List<Address> targets = new ArrayList<Address>(stateTransferManager.getCacheTopology().getReadConsistentHash().locateOwners(key));
+ // if any of the recipients has left the cluster since the command was issued, just don't wait for its response
+ targets.retainAll(rpcManager.getTransport().getMembers());
+ ResponseFilter filter = new ClusteredGetResponseValidityFilter(targets, rpcManager.getAddress());
+ RpcOptions options = rpcManager.getRpcOptionsBuilder(ResponseMode.WAIT_FOR_VALID_RESPONSE, false)
+ .responseFilter(filter).build();
+ Map<Address, Response> responses = rpcManager.invokeRemotely(targets, get, options);
+
+ if (!responses.isEmpty()) {
+ for (Response r : responses.values()) {
+ if (r instanceof SuccessfulResponse) {
+ InternalCacheValue cacheValue = (InternalCacheValue) ((SuccessfulResponse) r).getResponseValue();
+ return cacheValue.toInternalCacheEntry(key);
+ }
+ }
+ }
+
+ // TODO If everyone returned null, and the read CH has changed, retry the remote get.
+ // Otherwise our get command might be processed by the old owners after they have invalidated their data
+ // and we'd return a null even though the key exists on
+ return null;
+ }
+
+ protected final Object handleNonTxWriteCommand(InvocationContext ctx, DataWriteCommand command) throws Throwable {
+ if (ctx.isInTxScope()) {
+ throw new CacheException("Attempted execution of non-transactional write command in a transactional invocation context");
+ }
+
+ RecipientGenerator recipientGenerator = new SingleKeyRecipientGenerator(command.getKey());
+
+ // see if we need to load values from remote sources first
+ remoteGetBeforeWrite(ctx, command, recipientGenerator);
+
+ // if this is local mode then skip distributing
+ if (isLocalModeForced(command)) {
+ return invokeNextInterceptor(ctx, command);
+ }
+
+ boolean isSync = isSynchronous(command);
+ if (!ctx.isOriginLocal()) {
+ Object returnValue = invokeNextInterceptor(ctx, command);
+ Address primaryOwner = cdl.getPrimaryOwner(command.getKey());
+ if (primaryOwner.equals(rpcManager.getAddress())) {
+ if (command.isConditional() && !command.isSuccessful()) {
+ log.tracef(
+ "Skipping the replication of the conditional command as it did not succeed on primary owner (%s).",
+ command);
+ return returnValue;
+ }
+ rpcManager.invokeRemotely(recipientGenerator.generateRecipients(), command,
+ rpcManager.getDefaultRpcOptions(isSync));
+ } else {
+ log.errorf("Didn't invoke RPC because primaryOwner (%s) didn't match this node (%s)", primaryOwner,
+ rpcManager.getAddress());
+ log.errorf("Hashcode is (%s) for Key (%s) .. it could be inconsistent in the cluster!",
+ command.getKey().hashCode(), command.getKey());
+ }
+ return returnValue;
+ } else {
+ Address primaryOwner = cdl.getPrimaryOwner(command.getKey());
+ if (primaryOwner.equals(rpcManager.getAddress())) {
+ Object result = invokeNextInterceptor(ctx, command);
+ if (command.isConditional() && !command.isSuccessful()) {
+ log.tracef("Skipping the replication of the conditional command as it did not succeed on primary owner (%s).", command);
+ return result;
+ }
+ List<Address> recipients = recipientGenerator.generateRecipients();
+ log.tracef("I'm the primary owner, sending the command to all (%s) the recipients in order to be applied.", recipients);
+ // check if a single owner has been configured and the target for the key is the local address
+ boolean isSingleOwnerAndLocal = cacheConfiguration.clustering().hash().numOwners() == 1
+ && recipients != null
+ && recipients.size() == 1
+ && recipients.get(0).equals(rpcManager.getTransport().getAddress());
+ if (!isSingleOwnerAndLocal) {
+ rpcManager.invokeRemotely(recipients, command, rpcManager.getDefaultRpcOptions(isSync));
+ }
+ return result;
+ } else {
+ log.tracef("I'm not the primary owner, so sending the command to the primary owner(%s) in order to be forwarded", primaryOwner);
+ log.tracef("Hashcode is (%s) for Key (%s)", command.getKey().hashCode(), command.getKey());
+
+ Object localResult = invokeNextInterceptor(ctx, command);
+ boolean isSyncForwarding = isSync || isNeedReliableReturnValues(command);
+ Map<Address, Response> addressResponseMap = rpcManager.invokeRemotely(Collections.singletonList(primaryOwner), command,
+ rpcManager.getDefaultRpcOptions(isSyncForwarding));
+ if (!isSyncForwarding) return localResult;
+
+ return getResponseFromPrimaryOwner(primaryOwner, addressResponseMap);
+ }
+ }
+ }
+
+ private Object getResponseFromPrimaryOwner(Address primaryOwner, Map<Address, Response> addressResponseMap) {
+ Response fromPrimaryOwner = addressResponseMap.get(primaryOwner);
+ if (fromPrimaryOwner == null) {
+ log.tracef("Primary owner %s returned null", primaryOwner);
+ return null;
+ }
+ if (!fromPrimaryOwner.isSuccessful()) {
+ Throwable cause = fromPrimaryOwner instanceof ExceptionResponse ? ((ExceptionResponse)fromPrimaryOwner).getException() : null;
+ throw new CacheException("Got unsuccessful response from primary owner: " + fromPrimaryOwner, cause);
+ } else {
+ return ((SuccessfulResponse) fromPrimaryOwner).getResponseValue();
+ }
+ }
+
+ protected abstract void remoteGetBeforeWrite(InvocationContext ctx, WriteCommand command, RecipientGenerator keygen) throws Throwable;
+
+ interface RecipientGenerator {
+
+ Collection<Object> getKeys();
+
+ List<Address> generateRecipients();
+ }
+
+ class SingleKeyRecipientGenerator implements RecipientGenerator {
+ private final Object key;
+ private final Set<Object> keys;
+ private List<Address> recipients = null;
+
+ SingleKeyRecipientGenerator(Object key) {
+ this.key = key;
+ keys = Collections.singleton(key);
+ }
+
+ @Override
+ public List<Address> generateRecipients() {
+ if (recipients == null) {
+ recipients = cdl.getOwners(key);
+ }
+ return recipients;
+ }
+
+ @Override
+ public Collection<Object> getKeys() {
+ return keys;
+ }
+ }
+
+ class MultipleKeysRecipientGenerator implements RecipientGenerator {
+
+ private final Collection<Object> keys;
+ private List<Address> recipients = null;
+
+ MultipleKeysRecipientGenerator(Collection<Object> keys) {
+ this.keys = keys;
+ }
+
+ @Override
+ public List<Address> generateRecipients() {
+ if (recipients == null) {
+ recipients = cdl.getOwners(keys);
+ }
+ return recipients;
+ }
+
+ @Override
+ public Collection<Object> getKeys() {
+ return keys;
+ }
+ }
+}
<siteplugin>3.2</siteplugin>
<projectinfo>2.6</projectinfo>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<compiler.version>2.3.2</compiler.version>
<surefire.version>2.15</surefire.version>
<failsafe.version>2.15</failsafe.version>
<releaseplugin.version>2.3.2</releaseplugin.version>
<commons.lang.version>3.1</commons.lang.version>
<jacoco.version>0.5.3.201107060350</jacoco.version>
+ <enforcer.version>1.3.1</enforcer.version>
</properties>
<pluginRepositories>
<id>jboss.releases</id>
<name>jboss.releases</name>
<url>${nexusproxy}/repositories/jboss.releases/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
</repository>
<!-- OpenDayLight Released artifact -->
<repository>
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.LinkedBlockingQueue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.eclipse.osgi.framework.console.CommandInterpreter;
import org.eclipse.osgi.framework.console.CommandProvider;
import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
import org.opendaylight.controller.sal.utils.StatusCode;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class ConnectionManager implements IConnectionManager, IConnectionListener,
ICoordinatorChangeAware, IListenInventoryUpdates,
}
}
- public void started() {
- connectionEventThread = new Thread(new EventHandler(), "ConnectionEvent Thread");
+
+ public void started() {
+ String schemeStr = System.getProperty("connection.scheme");
+ for (ConnectionMgmtScheme scheme : ConnectionMgmtScheme.values()) {
+ AbstractScheme schemeImpl = SchemeFactory.getScheme(scheme, clusterServices);
+ if (schemeImpl != null) {
+ schemes.put(scheme, schemeImpl);
+ if (scheme.name().equalsIgnoreCase(schemeStr)) {
+ activeScheme = scheme;
+ }
+ }
+ }
+
connectionEventThread.start();
registerWithOSGIConsole();
}
public void init() {
- String schemeStr = System.getProperty("connection.scheme");
+ connectionEventThread = new Thread(new EventHandler(), "ConnectionEvent Thread");
this.connectionEvents = new LinkedBlockingQueue<ConnectionMgmtEvent>();
schemes = new ConcurrentHashMap<ConnectionMgmtScheme, AbstractScheme>();
- for (ConnectionMgmtScheme scheme : ConnectionMgmtScheme.values()) {
- AbstractScheme schemeImpl = SchemeFactory.getScheme(scheme, clusterServices);
- if (schemeImpl != null) {
- schemes.put(scheme, schemeImpl);
- if (scheme.name().equalsIgnoreCase(schemeStr)) {
- activeScheme = scheme;
- }
- }
- }
}
- public void stop() {
+ public void stopping() {
connectionEventThread.interrupt();
Set<Node> localNodes = getLocalNodes();
if (localNodes != null) {
*/
protected ConcurrentMap <Node, Set<InetAddress>> nodeConnections;
protected abstract boolean isConnectionAllowedInternal(Node node);
- private String name;
+ private final String name;
+ private final String nodeConnectionsCacheName;
protected AbstractScheme(IClusterGlobalServices clusterServices, ConnectionMgmtScheme type) {
this.clusterServices = clusterServices;
- if (type != null) name = type.name();
- else name = "UNKNOWN";
+ name = (type != null ? type.name() : "UNKNOWN");
+ nodeConnectionsCacheName = "connectionmanager."+name+".nodeconnections";
if (clusterServices != null) {
allocateCaches();
retrieveCaches();
+ } else {
+ log.error("Couldn't retrieve caches for scheme %s. Clustering service unavailable", name);
}
}
return isConnectionAllowedInternal(node);
}
- @SuppressWarnings("deprecation")
public void handleClusterViewChanged() {
log.debug("Handling Cluster View changed notification");
List<InetAddress> controllers = clusterServices.getClusteredControllers();
}
public Set<Node> getNodes(InetAddress controller) {
- if (nodeConnections == null) return null;
ConcurrentMap <InetAddress, Set<Node>> controllerNodesMap = getControllerToNodesMap();
return controllerNodesMap.get(controller);
}
protected Status removeNodeFromController (Node node, InetAddress controller) {
if (node == null || controller == null) {
- return new Status(StatusCode.BADREQUEST);
+ return new Status(StatusCode.BADREQUEST, "Invalid Node or Controller Address Specified.");
}
if (clusterServices == null || nodeConnections == null) {
}
clusterServices.tcommit();
} catch (Exception e) {
- log.error("Excepion in removing Controller from a Node", e);
+ log.error("Exception in removing Controller from a Node", e);
try {
clusterServices.trollback();
} catch (Exception e1) {
*/
private Status putNodeToController (Node node, InetAddress controller) {
if (clusterServices == null || nodeConnections == null) {
- return new Status(StatusCode.SUCCESS);
+ return new Status(StatusCode.INTERNALERROR, "Cluster service unavailable, or node connections info missing.");
}
log.debug("Trying to Put {} to {}", controller.getHostAddress(), node.toString());
if (node == null || controller == null) {
return new Status(StatusCode.BADREQUEST);
}
- if (isLocal(node)) return new Status(StatusCode.SUCCESS);
+ if (isLocal(node)) {
+ return new Status(StatusCode.SUCCESS);
+ }
if (isConnectionAllowed(node)) {
return putNodeToController(node, controller);
} else {
}
}
- @SuppressWarnings("deprecation")
public Status addNode (Node node) {
return addNode(node, clusterServices.getMyAddress());
}
- @SuppressWarnings({ "unchecked", "deprecation" })
+ @SuppressWarnings({ "unchecked" })
private void retrieveCaches() {
if (this.clusterServices == null) {
- log.error("un-initialized clusterServices, can't retrieve cache");
+ log.error("Un-initialized Cluster Services, can't retrieve caches for scheme: {}", name);
return;
}
- nodeConnections = (ConcurrentMap<Node, Set<InetAddress>>) clusterServices.getCache("connectionmanager."+name+".nodeconnections");
+ nodeConnections = (ConcurrentMap<Node, Set<InetAddress>>) clusterServices.getCache(nodeConnectionsCacheName);
if (nodeConnections == null) {
- log.error("\nFailed to get caches");
+ log.error("\nFailed to get cache: {}", nodeConnectionsCacheName);
}
}
- @SuppressWarnings("deprecation")
private void allocateCaches() {
if (this.clusterServices == null) {
- log.error("un-initialized clusterServices, can't create cache");
+ log.error("Un-initialized clusterServices, can't create cache");
return;
}
try {
- clusterServices.createCache("connectionmanager."+name+".nodeconnections", EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL));
+ clusterServices.createCache(nodeConnectionsCacheName, EnumSet.of(IClusterServices.cacheMode.TRANSACTIONAL));
} catch (CacheExistException cee) {
- log.error("\nCache already exists - destroy and recreate if needed");
+ log.debug("\nCache already exists: {}", nodeConnectionsCacheName);
} catch (CacheConfigException cce) {
log.error("\nCache configuration invalid - check cache mode");
} catch (Exception e) {
import java.net.InetAddress;
import java.util.Set;
+
import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
import org.opendaylight.controller.connectionmanager.ConnectionMgmtScheme;
import org.opendaylight.controller.sal.core.Node;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
class AnyControllerScheme extends AbstractScheme {
- private static final Logger logger = LoggerFactory.getLogger(AnyControllerScheme.class);
private static AbstractScheme myScheme= null;
protected AnyControllerScheme(IClusterGlobalServices clusterServices) {
return myScheme;
}
- @SuppressWarnings("deprecation")
@Override
public boolean isConnectionAllowedInternal(Node node) {
- if (nodeConnections == null) return true;
Set <InetAddress> controllers = nodeConnections.get(node);
if (controllers == null || controllers.size() == 0) return true;
return (controllers.size() == 1 && controllers.contains(clusterServices.getMyAddress()));
class SingleControllerScheme extends AbstractScheme {
- private static AbstractScheme myScheme= null;
+ private static AbstractScheme myScheme = null;
protected SingleControllerScheme(IClusterGlobalServices clusterServices) {
super(clusterServices, ConnectionMgmtScheme.SINGLE_CONTROLLER);
return myScheme;
}
- @SuppressWarnings("deprecation")
@Override
public boolean isConnectionAllowedInternal(Node node) {
- if (nodeConnections == null) return true;
// Lets make it simple. The Cluster Coordinator is the master
- if (clusterServices.amICoordinator()) return true;
- return false;
+ return clusterServices.amICoordinator();
}
}
\ No newline at end of file
</activation>
<modules>
<!-- MD-SAL bundles -->
- <module>../../sal/yang-prototype</module>
+ <module>../../md-sal</module>
</modules>
</profile>
</profiles>
private CountDownLatch waitingLatch;
private Status retStatus;
private static final Logger logger = LoggerFactory.getLogger(FlowEntryDistributionOrderFutureTask.class);
+ // Don't wait forever to program, rather timeout if there are issues, and
+ // log an error
+ private long timeout;
+ private static final Long DEFAULTTIMEOUT = 30000L;
/**
* @param order
this.waitingLatch = new CountDownLatch(1);
// No return status yet!
this.retStatus = new Status(StatusCode.UNDEFINED);
+ // Set the timeout
+ String strTimeout = System.getProperty("FlowEntryDistributionOrderFutureTask.timeout",
+ DEFAULTTIMEOUT.toString());
+ try {
+ timeout = Long.parseLong(strTimeout);
+ } catch (Exception e) {
+ timeout = DEFAULTTIMEOUT;
+ }
}
@Override
@Override
public Status get() throws InterruptedException, ExecutionException {
+ boolean didFinish = false;
logger.trace("Getting status for order {}", this.order);
// If i'm done lets return the status as many times as caller wants
if (this.waitingLatch.getCount() == 0L) {
logger.trace("Start waiting for status to come back");
// Wait till someone signal that we are done
- this.waitingLatch.await();
+ didFinish = this.waitingLatch.await(this.timeout, TimeUnit.MILLISECONDS);
- logger.trace("Waiting for the status is over, returning it");
- // Return the known status
- return retStatus;
+ if (didFinish) {
+ logger.trace("Waiting for the status of order {} is over, returning it", this.order);
+ // Return the known status
+ return retStatus;
+ } else {
+ logger.error("Timing out, the workStatus for order {} has not come back in time!", this.order);
+ return new Status(StatusCode.TIMEOUT);
+ }
}
@Override
public Status get(long timeout, TimeUnit unit) throws InterruptedException,
ExecutionException, TimeoutException {
+ boolean didFinish = false;
logger.trace("Getting status for order {}", this.order);
// If i'm done lets return the status as many times as caller wants
if (this.waitingLatch.getCount() == 0L) {
logger.trace("Start waiting for status to come back");
// Wait till someone signal that we are done
- this.waitingLatch.await(timeout, unit);
+ didFinish = this.waitingLatch.await(timeout, unit);
- logger.trace("Waiting for the status is over, returning it");
- // Return the known status, could also be null if didn't return
- return retStatus;
+ if (didFinish) {
+ logger.trace("Waiting for the status is over, returning it");
+ // Return the known status, could also be null if didn't return
+ return retStatus;
+ } else {
+ // No need to bark here as long as this routine could indeed
+ // timeout
+ logger.trace("Timing out, the workStatus for order {} has not come back in time!", this.order);
+ return new Status(StatusCode.TIMEOUT);
+ }
}
@Override
this.waitingLatch.countDown();
logger.trace("Unlocked the Future");
}
+
+ /**
+ * Getter for the workOrder for which the order is waiting for
+ * @return the order
+ */
+ public FlowEntryDistributionOrder getOrder() {
+ return order;
+ }
}
* @return a Future object for monitoring the progress of the result, or
* null in case the processing should take place locally
*/
- private Future<Status> distributeWorkOrder(FlowEntryInstall e, FlowEntryInstall u, UpdateType t) {
+ private FlowEntryDistributionOrderFutureTask distributeWorkOrder(FlowEntryInstall e, FlowEntryInstall u,
+ UpdateType t) {
// A null entry it's an unexpected condition, anyway it's safe to keep
// the handling local
if (e == null) {
* contain the unique id assigned to this request
*/
private Status modifyEntryInternal(FlowEntryInstall currentEntries, FlowEntryInstall newEntries, boolean async) {
- Future<Status> futureStatus = distributeWorkOrder(currentEntries, newEntries, UpdateType.CHANGED);
+ FlowEntryDistributionOrderFutureTask futureStatus =
+ distributeWorkOrder(currentEntries, newEntries, UpdateType.CHANGED);
if (futureStatus != null) {
Status retStatus = new Status(StatusCode.UNDEFINED);
try {
retStatus = futureStatus.get();
+ if (retStatus.getCode()
+ .equals(StatusCode.TIMEOUT)) {
+ // A timeout happened, lets cleanup the workMonitor
+ workMonitor.remove(futureStatus.getOrder());
+ }
} catch (InterruptedException e) {
log.error("", e);
} catch (ExecutionException e) {
* contain the unique id assigned to this request
*/
private Status removeEntryInternal(FlowEntryInstall entry, boolean async) {
- Future<Status> futureStatus = distributeWorkOrder(entry, null, UpdateType.REMOVED);
+ FlowEntryDistributionOrderFutureTask futureStatus = distributeWorkOrder(entry, null, UpdateType.REMOVED);
if (futureStatus != null) {
Status retStatus = new Status(StatusCode.UNDEFINED);
try {
retStatus = futureStatus.get();
+ if (retStatus.getCode()
+ .equals(StatusCode.TIMEOUT)) {
+ // A timeout happened, lets cleanup the workMonitor
+ workMonitor.remove(futureStatus.getOrder());
+ }
} catch (InterruptedException e) {
log.error("", e);
} catch (ExecutionException e) {
* contain the unique id assigned to this request
*/
private Status addEntriesInternal(FlowEntryInstall entry, boolean async) {
- Future<Status> futureStatus = distributeWorkOrder(entry, null, UpdateType.ADDED);
+ FlowEntryDistributionOrderFutureTask futureStatus = distributeWorkOrder(entry, null, UpdateType.ADDED);
if (futureStatus != null) {
Status retStatus = new Status(StatusCode.UNDEFINED);
try {
retStatus = futureStatus.get();
+ if (retStatus.getCode()
+ .equals(StatusCode.TIMEOUT)) {
+ // A timeout happened, lets cleanup the workMonitor
+ workMonitor.remove(futureStatus.getOrder());
+ }
} catch (InterruptedException e) {
log.error("", e);
} catch (ExecutionException e) {
*/
if (fe.getRequestorController()
.equals(clusterContainerService.getMyAddress())) {
- FlowEntryDistributionOrderFutureTask fet = workMonitor.get(fe);
+ FlowEntryDistributionOrderFutureTask fet = workMonitor.remove(fe);
if (fet != null) {
logsync.trace("workStatus response is for us {}", fe);
// Signal we got the status
--- /dev/null
+module opendaylight-flow-types {
+ namespace "urn:opendaylight:flow:types";
+ prefix flow;
+
+ import ietf-inet-types {prefix inet;}
+ import opendaylight-match-types {prefix match;}
+ import ietf-yang-types {prefix yang;}
+ import opendaylight-l2-types {prefix l2t;}
+
+ revision "2013-08-19" {
+ description "Initial revision of flow service";
+ }
+
+
+ typedef vlan-cfi {
+ type int32;
+ }
+
+ grouping address {
+ choice address {
+ case ipv4 {
+ leaf ipv4-address {
+ type inet:ipv4-prefix;
+ }
+ }
+ case ipv6 {
+ leaf ipv6-address {
+ type inet:ipv6-prefix;
+ }
+ }
+ }
+ }
+
+ grouping action {
+ choice action {
+ case output-action {
+ leaf-list output-node-connector {
+ type inet:uri;
+ }
+ }
+
+ case controller-action {
+ leaf max-length {
+ type uint16 {
+ range "0..65294";
+ }
+ }
+ }
+
+ case set-queue-action {
+ leaf queue {
+ type string; // TODO: define queues
+ }
+ }
+
+ case pop-mpls-action {
+ leaf ethernet-type {
+ type uint16; // TODO: define ethertype type
+ }
+ }
+
+ case set-mpls-ttl-action {
+ leaf mpls-ttl {
+ type uint8;
+ }
+ }
+
+ case set-nw-ttl-action {
+ leaf nw-ttl {
+ type uint8;
+ }
+ }
+
+ case push-pbb-action {
+
+ }
+
+ case push-mpls-action {
+
+ }
+
+ case drop-action {
+ }
+
+ case flood-action {
+ }
+
+ case flood-all-action {
+ }
+
+ case hw-path-action {
+ }
+
+ case loopback-action {
+ }
+
+ case pop-vlan-action {
+ }
+
+ case push-vlan-action {
+ leaf tag { // TPID - 16 bits
+ type int32;
+ }
+ leaf pcp { // PCP - 3 bits
+ type int32;
+ }
+ leaf cfi { // CFI - 1 bit (drop eligible)
+ type vlan-cfi;
+ }
+ leaf vlan-id { // VID - 12 bits
+ type l2t:vlan-id;
+ }
+// leaf tci { //TCI = [PCP + CFI + VID]
+// }
+// leaf header { //header = [TPID + TCI]
+// }
+ }
+ case set-dl-dst-action {
+ leaf address {
+ type yang:mac-address;
+ }
+ }
+
+ case set-dl-src-action {
+ leaf address {
+ type yang:mac-address;
+ }
+ }
+ case set-dl-type-action {
+ leaf dl-type {
+ type l2t:ether-type;
+ }
+ }
+ case set-next-hop-action {
+ uses address;
+ }
+ case set-nw-dst-action {
+ uses address;
+ }
+ case set-nw-src-action{
+ uses address;
+ }
+ case set-nw-tos-action {
+ leaf tos {
+ type int32;
+ }
+ }
+
+ case set-tp-dst-action {
+ leaf port {
+ type inet:port-number;
+ }
+ }
+ case set-tp-src-action {
+ leaf port {
+ type inet:port-number;
+ }
+ }
+ case set-vlan-cfi-action {
+ leaf vlan-cfi {
+ type vlan-cfi;
+ }
+ }
+ case set-vlan-id-action {
+ leaf vlan-id {
+ type l2t:vlan-id;
+ }
+ }
+ case set-vlan-pcp-action {
+ leaf vlan-pcp {
+ type l2t:vlan-pcp;
+ }
+ }
+ case sw-path-action {
+ }
+
+
+ }
+ }
+
+ grouping flow {
+ container match {
+ uses match:match;
+ }
+ list action {
+ key "order";
+ leaf order {
+ type int32;
+ }
+ uses action;
+ }
+ leaf priority {
+ type uint16;
+ }
+
+ leaf idle-timeout {
+ type uint16;
+ }
+
+ leaf hard-timeout {
+ type uint16;
+ }
+
+ leaf cookie {
+ type uint64;
+ }
+ }
+
+ grouping flow-statistics {
+ leaf packet-count {
+ type yang:counter64;
+ }
+
+ leaf byte-count {
+ type yang:counter64;
+ }
+
+ container duration {
+ leaf second {
+ type yang:counter64;
+ }
+ leaf nanosecond {
+ type yang:counter64;
+ }
+ }
+ }
+
+ grouping flow-table-statistics {
+ leaf active {
+ type yang:counter64;
+ }
+
+ leaf lookup {
+ type yang:counter64;
+ }
+
+ leaf matched {
+ type yang:counter64;
+ }
+ }
+}
\ No newline at end of file
<modules>
<module>sal-common</module>
<module>sal-common-util</module>
- <module>sal-data-api</module>
+ <!-- Binding Independent -->
+ <module>sal-dom-api</module>
+ <module>sal-dom-broker</module>
+ <module>sal-dom-spi</module>
+ <!-- Binding Aware -->
<module>sal-binding-api</module>
- <module>sal-binding-broker-impl</module>
+ <module>sal-binding-broker</module>
+ <!-- Samples -->
<module>samples</module>
+ <!-- Base Models -->
<module>model</module>
+ <!-- Compability Packages -->
+ <module>sal-compability</module>
</modules>
<properties>
<name>opendaylight.snapshot</name>
<url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
</pluginRepository>
+ <pluginRepository>
+ <id>opendaylight.release</id>
+ <name>opendaylight.release</name>
+ <url>${nexusproxy}/repositories/opendaylight.release/</url>
+ </pluginRepository>
</pluginRepositories>
<repositories>
- <repository>
+
+ <repository>
+ <id>opendaylight-release</id>
+ <name>opendaylight-release</name>
+ <url>${nexusproxy}/repositories/opendaylight.release/</url>
+ </repository>
+ <!-- OpenDayLight Snapshot artifact -->
+ <repository>
+ <id>opendaylight-snapshot</id>
+ <name>opendaylight-snapshot</name>
+ <url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
+ </repository>
+ <repository>
<id>central</id>
<name>central</name>
<url>http://repo1.maven.org/maven2</url>
<repository>
<id>jboss.releases</id>
<name>jboss.releases</name>
- <url>${nexusproxy}/repositories/jboss.releases/</url>
+ <url>${nexusproxy}/repositories/jboss.releases/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
</repository>
<!-- OpenDayLight Released artifact -->
- <repository>
- <id>opendaylight-release</id>
- <name>opendaylight-release</name>
- <url>${nexusproxy}/repositories/opendaylight.release/</url>
- </repository>
- <!-- OpenDayLight Snapshot artifact -->
- <repository>
- <id>opendaylight-snapshot</id>
- <name>opendaylight-snapshot</name>
- <url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
- </repository>
+
</repositories>
<distributionManagement>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
- <version>${maven.bundle.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
</instructions>
</configuration>
</plugin>
-
<plugin>
<groupId>org.eclipse.xtend</groupId>
<artifactId>xtend-maven-plugin</artifactId>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-parent</artifactId>
<version>1.0-SNAPSHOT</version>
- <relativePath>../../sal/yang-prototype/sal/pom.xml</relativePath>
</parent>
<artifactId>sal-compability</artifactId>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
- <type>bundle</type>
<version>14.0.1</version>
</dependency>
</dependencies>
import java.util.Arrays;
import java.util.List;
-import org.opendaylight.controller.sal.action.Controller;
-import org.opendaylight.controller.sal.action.Drop;
-import org.opendaylight.controller.sal.action.Flood;
-import org.opendaylight.controller.sal.action.FloodAll;
-import org.opendaylight.controller.sal.action.HwPath;
-import org.opendaylight.controller.sal.action.Loopback;
-import org.opendaylight.controller.sal.action.Output;
-import org.opendaylight.controller.sal.action.PopVlan;
-import org.opendaylight.controller.sal.action.PushVlan;
-import org.opendaylight.controller.sal.action.SetDlDst;
-import org.opendaylight.controller.sal.action.SetDlSrc;
-import org.opendaylight.controller.sal.action.SetDlType;
-import org.opendaylight.controller.sal.action.SetNextHop;
-import org.opendaylight.controller.sal.action.SetNwDst;
-import org.opendaylight.controller.sal.action.SetNwSrc;
-import org.opendaylight.controller.sal.action.SetNwTos;
-import org.opendaylight.controller.sal.action.SetTpDst;
-import org.opendaylight.controller.sal.action.SetTpSrc;
-import org.opendaylight.controller.sal.action.SetVlanCfi;
-import org.opendaylight.controller.sal.action.SetVlanId;
-import org.opendaylight.controller.sal.action.SetVlanPcp;
-import org.opendaylight.controller.sal.action.SwPath;
+import org.opendaylight.controller.sal.action.*;
import org.opendaylight.controller.sal.core.NodeConnector;
import org.opendaylight.controller.sal.flowprogrammer.Flow;
import org.opendaylight.controller.sal.match.Match;
import org.opendaylight.controller.sal.match.MatchField;
import org.opendaylight.controller.sal.match.MatchType;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.*;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAdded;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAddedBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.action.ControllerActionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.action.OutputActionBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.VlanCfi;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.action.*;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.address.Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.address.address.Ipv4Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.address.address.Ipv6Builder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.flow.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.flow.ActionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.ethernet.match.fields.EthernetDestinationBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.ethernet.match.fields.EthernetSourceBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.ethernet.match.fields.EthernetTypeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.EthernetMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.EthernetMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.IpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.IpMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.Layer3Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.Layer4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.VlanMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.VlanMatchBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.*;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.layer._3.match.ArpMatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.layer._3.match.Ipv4MatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.layer._3.match.Ipv6MatchBuilder;
if (sourceAction instanceof Controller) {
targetAction = new ControllerActionBuilder().build();
} else if (sourceAction instanceof Drop) {
- // TODO: define maping
+ targetAction = new DropActionBuilder().build();
} else if (sourceAction instanceof Flood) {
- // TODO: define maping
+ targetAction = new FloodActionBuilder().build();
} else if (sourceAction instanceof FloodAll) {
- // TODO: define maping
+ targetAction = new FloodAllActionBuilder().build();
} else if (sourceAction instanceof HwPath) {
- // TODO: define maping
+ targetAction = new HwPathActionBuilder().build();
} else if (sourceAction instanceof Loopback) {
- // TODO: define maping
+ targetAction = new LoopbackActionBuilder().build();
} else if (sourceAction instanceof Output) {
NodeConnector nodeConnector = ((Output) sourceAction).getPort();
targetAction = outputActionBuilder.build();
} else if (sourceAction instanceof PopVlan) {
- // TODO: define maping
+ targetAction = new PopVlanActionBuilder().build();
} else if (sourceAction instanceof PushVlan) {
- // TODO: define maping
+ PushVlan pushVlan = (PushVlan) sourceAction;
+ PushVlanActionBuilder pushVlanActionBuilder = new PushVlanActionBuilder();
+
+ pushVlanActionBuilder.setCfi(new VlanCfi(pushVlan.getCfi()));
+ pushVlanActionBuilder.setVlanId(new VlanId(pushVlan.getVlanId()));
+ pushVlanActionBuilder.setPcp(pushVlan.getPcp());
+ pushVlanActionBuilder.setTag(pushVlan.getTag());
+ targetAction = pushVlanActionBuilder.build();
} else if (sourceAction instanceof SetDlDst) {
- // TODO: define maping
+ SetDlDst setDlDst = (SetDlDst) sourceAction;
+ SetDlDstActionBuilder setDlDstActionBuilder = new SetDlDstActionBuilder();
+
+ setDlDstActionBuilder.setAddress(new MacAddress(Arrays.toString(setDlDst.getDlAddress())));
+ targetAction = setDlDstActionBuilder.build();
} else if (sourceAction instanceof SetDlSrc) {
- // TODO: define maping
+ SetDlSrc setDlSrc = (SetDlSrc) sourceAction;
+ SetDlSrcActionBuilder setDlSrcActionBuilder = new SetDlSrcActionBuilder();
+
+ setDlSrcActionBuilder.setAddress(new MacAddress(Arrays.toString(setDlSrc.getDlAddress())));
+ targetAction = setDlSrcActionBuilder.build();
} else if (sourceAction instanceof SetDlType) {
- // TODO: define maping
+ SetDlType setDlType = (SetDlType) sourceAction;
+ SetDlTypeActionBuilder setDlTypeActionBuilder = new SetDlTypeActionBuilder();
+
+ setDlTypeActionBuilder.setDlType(new EtherType(new Long(setDlType.getDlType())));
+ targetAction = setDlTypeActionBuilder.build();
} else if (sourceAction instanceof SetNextHop) {
- // TODO: define maping
+ SetNextHop setNextHop = (SetNextHop) sourceAction;
+ SetNextHopActionBuilder setNextHopActionBuilder = new SetNextHopActionBuilder();
+
+ InetAddress inetAddress = setNextHop.getAddress();
+ setNextHopActionBuilder.setAddress(addressFromAction(inetAddress));
+
+ targetAction = setNextHopActionBuilder.build();
} else if (sourceAction instanceof SetNwDst) {
- // TODO: define maping
+ SetNwDst setNwDst = (SetNwDst) sourceAction;
+ SetNwDstActionBuilder setNwDstActionBuilder = new SetNwDstActionBuilder();
+
+ InetAddress inetAddress = setNwDst.getAddress();
+ setNwDstActionBuilder.setAddress(addressFromAction(inetAddress));
+
+ targetAction = setNwDstActionBuilder.build();
} else if (sourceAction instanceof SetNwSrc) {
- // TODO: define maping
+ SetNwSrc setNwSrc = (SetNwSrc) sourceAction;
+ SetNwSrcActionBuilder setNwSrcActionBuilder = new SetNwSrcActionBuilder();
+
+ InetAddress inetAddress = setNwSrc.getAddress();
+ setNwSrcActionBuilder.setAddress(addressFromAction(inetAddress));
+
+ targetAction = setNwSrcActionBuilder.build();
} else if (sourceAction instanceof SetNwTos) {
- // TODO: define maping
+ SetNwTos setNwTos = (SetNwTos) sourceAction;
+ SetNwTosActionBuilder setNwTosActionBuilder = new SetNwTosActionBuilder();
+
+ setNwTosActionBuilder.setTos(setNwTos.getNwTos());
+ targetAction = setNwTosActionBuilder.build();
} else if (sourceAction instanceof SetTpDst) {
- // TODO: define maping
+ SetTpDst setTpDst = (SetTpDst) sourceAction;
+ SetTpDstActionBuilder setTpDstActionBuilder = new SetTpDstActionBuilder();
+
+ setTpDstActionBuilder.setPort(new PortNumber(setTpDst.getPort()));
+
+ targetAction = setTpDstActionBuilder.build();
} else if (sourceAction instanceof SetTpSrc) {
- // TODO: define maping
+ SetTpSrc setTpSrc = (SetTpSrc) sourceAction;
+ SetTpSrcActionBuilder setTpSrcActionBuilder = new SetTpSrcActionBuilder();
+
+ setTpSrcActionBuilder.setPort(new PortNumber(setTpSrc.getPort()));
+
+ targetAction = setTpSrcActionBuilder.build();
} else if (sourceAction instanceof SetVlanCfi) {
- // TODO: define maping
+ SetVlanCfi setVlanCfi = (SetVlanCfi) sourceAction;
+ SetVlanCfiActionBuilder setVlanCfiActionBuilder = new SetVlanCfiActionBuilder();
+
+ setVlanCfiActionBuilder.setVlanCfi(new VlanCfi(setVlanCfi.getCfi()));
+
+ targetAction = setVlanCfiActionBuilder.build();
} else if (sourceAction instanceof SetVlanId) {
- // TODO: define maping
+ SetVlanId setVlanId = (SetVlanId) sourceAction;
+ SetVlanIdActionBuilder setVlanIdActionBuilder = new SetVlanIdActionBuilder();
+
+ setVlanIdActionBuilder.setVlanId(new VlanId(setVlanId.getVlanId()));
+
+ targetAction = setVlanIdActionBuilder.build();
} else if (sourceAction instanceof SetVlanPcp) {
- // TODO: define maping
+ SetVlanPcp setVlanPcp = (SetVlanPcp) sourceAction;
+ SetVlanPcpActionBuilder setVlanPcpActionBuilder = new SetVlanPcpActionBuilder();
+
+ setVlanPcpActionBuilder.setVlanPcp(new VlanPcp((short) setVlanPcp.getPcp()));
+
+ targetAction = setVlanPcpActionBuilder.build();
} else if (sourceAction instanceof SwPath) {
- // TODO: define maping
+ targetAction = new SwPathActionBuilder().build();
}
targetActionBuilder.setAction(targetAction);
return targetActionBuilder.build();
}
+ private static Address addressFromAction(InetAddress inetAddress) {
+ byte[] byteInetAddresss = inetAddress.getAddress();
+ if (inetAddress instanceof Inet4Address) {
+ Ipv4Builder ipv4Builder = new Ipv4Builder();
+ ipv4Builder.setIpv4Address(new Ipv4Prefix(Arrays.toString(byteInetAddresss)));
+ return ipv4Builder.build();
+ } else if (inetAddress instanceof Inet6Address) {
+ Ipv6Builder ipv6Builder = new Ipv6Builder();
+ ipv6Builder.setIpv6Address(new Ipv6Prefix(Arrays.toString(byteInetAddresss)));
+ return ipv6Builder.build();
+ }
+ return null;
+ }
+
private static List<Uri> nodeConnectorToUri(NodeConnector nodeConnector) {
// TODO Define mapping
return null;
.setAddress(ethernetSourceAddressFrom(sourceMatch));
targetEthMatchBuild.setEthernetSource(ethSourBuild.build());
- final MatchField dataLinkDest = sourceMatch.getField(DL_DST);
- if (dataLinkDest != null && dataLinkDest.getValue() != null) {
- final MacAddress macDestAddress;
- macDestAddress = new MacAddress((String) (dataLinkDest.getValue()));
- EthernetDestinationBuilder ethDestBuild = new EthernetDestinationBuilder().setAddress(macDestAddress);
- targetEthMatchBuild.setEthernetDestination(ethDestBuild.build());
- }
+ EthernetDestinationBuilder ethDestBuild = new EthernetDestinationBuilder()
+ .setAddress(ethernetDestAddressFrom(sourceMatch));
+ targetEthMatchBuild.setEthernetDestination(ethDestBuild.build());
final MatchField dataLinkType = sourceMatch.getField(MatchType.DL_TYPE);
if (dataLinkType != null && dataLinkType.getValue() != null) {
import java.util.List;
import java.util.Set;
-import org.opendaylight.controller.sal.action.Controller;
-import org.opendaylight.controller.sal.action.Output;
+import org.opendaylight.controller.sal.action.*;
import org.opendaylight.controller.sal.core.NodeConnector;
import org.opendaylight.controller.sal.flowprogrammer.Flow;
import org.opendaylight.controller.sal.match.Match;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Dscp;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.*;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.NodeFlow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.action.ControllerAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.action.OutputAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.action.PopMplsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.action.PushMplsAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.action.PushPbbAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.action.PushVlanAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.action.SetMplsTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.action.SetNwTtlAction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.action.SetQueueAction;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.VlanCfi;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.action.action.*;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.address.Address;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.address.address.Ipv4;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.address.address.Ipv6;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev130819.flow.Action;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.EtherType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanPcp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.MacAddressFilter;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.ethernet.match.fields.EthernetType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.EthernetMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.IpMatch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.Layer3Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.Layer4Match;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.VlanMatch;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.*;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.layer._3.match.ArpMatch;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.layer._3.match.Ipv4Match;
import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev130819.match.layer._3.match.Ipv6Match;
} else if (sourceAction instanceof SetQueueAction) {
// TODO: define maping
// targetAction = //no action to map
+ } else if (sourceAction instanceof DropAction) {
+ targetAction.add(new Drop());
+ } else if (sourceAction instanceof FloodAction) {
+ targetAction.add(new Flood());
+ } else if (sourceAction instanceof FloodAllAction) {
+ targetAction.add(new FloodAll());
+ } else if (sourceAction instanceof HwPathAction) {
+ targetAction.add(new HwPath());
+ } else if (sourceAction instanceof LoopbackAction) {
+ targetAction.add(new Loopback());
+ } else if (sourceAction instanceof PopVlanAction) {
+ targetAction.add(new PopVlan());
+ } else if (sourceAction instanceof PushVlanAction) {
+ PushVlanAction pushVlanAction = (PushVlanAction) sourceAction;
+ PushVlan pushVlan = pushVlanFrom(pushVlanAction);
+ if (pushVlan != null) {
+ targetAction.add(pushVlan);
+ }
+ } else if (sourceAction instanceof SetDlDstAction) {
+ MacAddress addressL2Dest = ((SetDlDstAction) sourceAction).getAddress();
+ if (addressL2Dest != null) {
+ String addressValue = addressL2Dest.getValue();
+ if (addressValue != null) {
+ targetAction.add(new SetDlDst(addressValue.getBytes()));
+ }
+ }
+ } else if (sourceAction instanceof SetDlSrcAction) {
+ MacAddress addressL2Src = ((SetDlSrcAction) sourceAction).getAddress();
+ if (addressL2Src != null) {
+ String addressValue = addressL2Src.getValue();
+ if (addressValue != null) {
+ targetAction.add(new SetDlSrc(addressValue.getBytes()));
+ }
+ }
+ } else if (sourceAction instanceof SetDlTypeAction) {
+ EtherType dlType = ((SetDlTypeAction) sourceAction).getDlType();
+ if (dlType != null) {
+ Long dlTypeValue = dlType.getValue();
+ if (dlTypeValue != null) {
+ targetAction.add(new SetDlType(dlTypeValue.intValue()));
+ }
+ }
+ } else if (sourceAction instanceof SetNextHopAction) {
+ Address addressL3 = ((SetNextHopAction) sourceAction).getAddress();
+
+ InetAddress inetAddress = inetAddressFrom(addressL3);
+ if (inetAddress != null) {
+ targetAction.add(new SetNextHop(inetAddress));
+ }
+ } else if (sourceAction instanceof SetNwDstAction) {
+ Address addressL3 = ((SetNwDstAction) sourceAction).getAddress();
+
+ InetAddress inetAddress = inetAddressFrom(addressL3);
+ if (inetAddress != null) {
+ targetAction.add(new SetNwDst(inetAddress));
+ }
+ } else if (sourceAction instanceof SetNwSrcAction) {
+ Address addressL3 = ((SetNwDstAction) sourceAction).getAddress();
+
+ InetAddress inetAddress = inetAddressFrom(addressL3);
+ if (inetAddress != null) {
+ targetAction.add(new SetNwSrc(inetAddress));
+ }
+ } else if (sourceAction instanceof SetNwTosAction) {
+ Integer tos = ((SetNwTosAction) sourceAction).getTos();
+ if (tos != null) {
+ targetAction.add(new SetNwTos(tos));
+ }
+ } else if (sourceAction instanceof SetTpDstAction) {
+ PortNumber port = ((SetTpDstAction) sourceAction).getPort();
+ if (port != null) {
+ Integer portValue = port.getValue();
+ if (port.getValue() != null) {
+ targetAction.add(new SetTpDst(portValue));
+ }
+ }
+ } else if (sourceAction instanceof SetTpSrcAction) {
+ PortNumber port = ((SetTpSrcAction) sourceAction).getPort();
+ if (port != null) {
+ Integer portValue = port.getValue();
+ if (port.getValue() != null) {
+ targetAction.add(new SetTpSrc(portValue));
+ }
+ }
+ } else if (sourceAction instanceof SetVlanCfiAction) {
+ VlanCfi vlanCfi = ((SetVlanCfiAction) sourceAction).getVlanCfi();
+ if (vlanCfi != null) {
+ Integer vlanCfiValue = vlanCfi.getValue();
+ if (vlanCfiValue != null) {
+ targetAction.add(new SetVlanCfi(vlanCfiValue));
+ }
+ }
+ } else if (sourceAction instanceof SetVlanIdAction) {
+ org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId vlanID = ((SetVlanIdAction) sourceAction)
+ .getVlanId();
+ if (vlanID != null) {
+ Integer vlanIdValue = vlanID.getValue();
+ if (vlanIdValue != null) {
+ targetAction.add(new SetVlanId(vlanIdValue));
+ }
+ }
+ } else if (sourceAction instanceof SetVlanPcpAction) {
+ VlanPcp vlanPcp = ((SetVlanPcpAction) sourceAction).getVlanPcp();
+ if (vlanPcp != null) {
+ Short vlanPcpValue = vlanPcp.getValue();
+ if (vlanPcpValue != null) {
+ targetAction.add(new SetVlanPcp(vlanPcpValue));
+ }
+ }
+ } else if (sourceAction instanceof SwPathAction) {
+ targetAction.add(new SwPath());
}
return targetAction;
}
+ private static InetAddress inetAddressFrom(Address addressL3) {
+ if (addressL3 != null) {
+ if (addressL3 instanceof Ipv4) {
+ Ipv4Prefix addressL3Ipv4 = ((Ipv4) addressL3).getIpv4Address();
+ if (addressL3Ipv4 != null) {
+ return inetAddressFrom(addressL3Ipv4);
+ }
+ } else if (addressL3 instanceof Ipv6) {
+ Ipv6Prefix addressL3Ipv6 = ((Ipv6) addressL3).getIpv6Address();
+ if (addressL3Ipv6 != null) {
+ return inetAddressFrom(addressL3Ipv6);
+ }
+ }
+ }
+ return null;
+ }
+
+ private static PushVlan pushVlanFrom(PushVlanAction pushVlanAction) {
+ final int tag;
+ final int pcp;
+ final int cfi;
+ final int vlanId;
+
+ if (pushVlanAction.getTag() != null) {
+ tag = pushVlanAction.getTag();
+ if (pushVlanAction.getPcp() != null) {
+ pcp = pushVlanAction.getPcp();
+ if (pushVlanAction.getCfi() != null && pushVlanAction.getCfi().getValue() != null) {
+ cfi = pushVlanAction.getCfi().getValue();
+ if (pushVlanAction.getVlanId() != null && pushVlanAction.getVlanId().getValue() != null) {
+ vlanId = pushVlanAction.getVlanId().getValue();
+ return new PushVlan(tag, pcp, cfi, vlanId);
+ }
+ }
+ }
+ }
+ return null;
+ }
+
private static NodeConnector fromNodeConnectorRef(Uri uri) {
// TODO: Define mapping
return null;
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-model-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ <version>5.0.0</version>
+ </dependency>
</dependencies>
</project>
--- /dev/null
+package org.opendaylight.controller.sal.core.api;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+public abstract class AbstractConsumer implements Consumer, BundleActivator {
+
+ Broker broker;
+ ServiceReference<Broker> brokerRef;
+ @Override
+ public final void start(BundleContext context) throws Exception {
+ brokerRef = context.getServiceReference(Broker.class);
+ broker = context.getService(brokerRef);
+
+ this.startImpl(context);
+
+ broker.registerConsumer(this,context);
+ }
+
+ public abstract void startImpl(BundleContext context);
+
+ @Override
+ public final void stop(BundleContext context) throws Exception {
+ broker = null;
+ if(brokerRef != null) {
+ context.ungetService(brokerRef);
+ }
+ }
+
+
+ @Override
+ public Collection<ConsumerFunctionality> getConsumerFunctionality() {
+ return Collections.emptySet();
+ }
+
+}
--- /dev/null
+package org.opendaylight.controller.sal.core.api;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+public abstract class AbstractProvider implements BundleActivator, Provider {
+
+ private ServiceReference<Broker> brokerRef;
+ private Broker broker;
+
+ @Override
+ public Collection<ProviderFunctionality> getProviderFunctionality() {
+ return Collections.emptySet();
+ }
+
+ @Override
+ public final void start(BundleContext context) throws Exception {
+ brokerRef = context.getServiceReference(Broker.class);
+ broker = context.getService(brokerRef);
+
+ this.startImpl(context);
+
+ broker.registerProvider(this,context);
+ }
+
+ public abstract void startImpl(BundleContext context);
+
+ @Override
+ public final void stop(BundleContext context) throws Exception {
+ // TODO Auto-generated method stub
+
+ }
+
+}
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.data.api.CompositeNode;
+import org.osgi.framework.BundleContext;
/**
*
* @param cons
* Consumer to be registered.
+ * @param context
* @return a session specific to consumer registration
* @throws IllegalArgumentException
* If the consumer is <code>null</code>.
* @throws IllegalStateException
* If the consumer is already registered.
*/
- ConsumerSession registerConsumer(Consumer cons);
+ ConsumerSession registerConsumer(Consumer cons, BundleContext context);
/**
* Registers the {@link Provider}, which will use the SAL layer.
*
* @param prov
* Provider to be registered.
+ * @param context
* @return a session unique to the provider registration.
* @throws IllegalArgumentException
* If the provider is <code>null</code>.
* @throws IllegalStateException
* If the consumer is already registered.
*/
- ProviderSession registerProvider(Provider prov);
+ ProviderSession registerProvider(Provider prov, BundleContext context);
/**
* {@link Consumer} specific access to the SAL functionality.
</parent>\r
<artifactId>sal-broker-impl</artifactId>\r
<scm>\r
- <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>\r
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>\r
- <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>\r
+ <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>\r
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>\r
+ <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>\r
</scm>\r
\r
<dependencies>\r
<artifactId>guava</artifactId>\r
</dependency>\r
</dependencies>\r
+\r
+ <build>\r
+ <plugins>\r
+ <plugin>\r
+ <groupId>org.apache.felix</groupId>\r
+ <artifactId>maven-bundle-plugin</artifactId>\r
+ <extensions>true</extensions>\r
+ <configuration>\r
+ <instructions>\r
+ <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>\r
+ <Bundle-Activator>org.opendaylight.controller.sal.dom.broker.BrokerActivator</Bundle-Activator>\r
+ </instructions>\r
+ </configuration>\r
+ </plugin>\r
+ </plugins>\r
+ </build>\r
</project>\r
--- /dev/null
+package org.opendaylight.controller.sal.dom.broker;
+
+import java.util.Hashtable;
+
+import org.opendaylight.controller.sal.core.api.Broker;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceRegistration;
+
+public class BrokerActivator implements BundleActivator {
+
+ BrokerImpl broker;
+ private ServiceRegistration<Broker> brokerReg;
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ broker = new BrokerImpl();
+ broker.setBundleContext(context);
+ brokerReg = context.registerService(Broker.class, broker, new Hashtable<String,String>());
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ if(brokerReg != null) {
+ brokerReg.unregister();
+ }
+ }
+}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.sal.core.impl;
+package org.opendaylight.controller.sal.dom.broker;
import java.util.Collection;
import java.util.Collections;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.data.api.CompositeNode;
+import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
// Implementation specific
private ExecutorService executor;
+ private BundleContext bundleContext;
+
@Override
- public ConsumerSession registerConsumer(Consumer consumer) {
+ public ConsumerSession registerConsumer(Consumer consumer,BundleContext ctx) {
checkPredicates(consumer);
log.info("Registering consumer " + consumer);
- ConsumerSessionImpl session = newSessionFor(consumer);
+ ConsumerSessionImpl session = newSessionFor(consumer,ctx);
consumer.onSessionInitiated(session);
sessions.add(session);
return session;
}
@Override
- public ProviderSession registerProvider(Provider provider) {
+ public ProviderSession registerProvider(Provider provider,BundleContext ctx) {
checkPredicates(provider);
- ProviderSessionImpl session = newSessionFor(provider);
+ ProviderSessionImpl session = newSessionFor(provider,ctx);
provider.onSessionInitiated(session);
providerSessions.add(session);
return session;
// Private Factory methods
- private ConsumerSessionImpl newSessionFor(Consumer cons) {
- return new ConsumerSessionImpl(cons);
+ private ConsumerSessionImpl newSessionFor(Consumer provider, BundleContext ctx) {
+ return new ConsumerSessionImpl(provider,ctx);
}
- private ProviderSessionImpl newSessionFor(Provider provider) {
- return new ProviderSessionImpl(provider);
+ private ProviderSessionImpl newSessionFor(Provider provider, BundleContext ctx) {
+ return new ProviderSessionImpl(provider,ctx);
}
private void consumerSessionClosed(ConsumerSessionImpl consumerSessionImpl) {
.synchronizedMap(new HashMap<Class<? extends BrokerService>, BrokerService>());
private boolean closed = false;
+ private BundleContext context;
+
public Consumer getConsumer() {
return consumer;
}
- public ConsumerSessionImpl(Consumer consumer) {
+ public ConsumerSessionImpl(Consumer consumer, BundleContext ctx) {
this.consumer = consumer;
+ this.context = ctx;
}
@Override
private Provider provider;
private Map<QName, RpcImplementation> sessionRpcImpls = Collections.synchronizedMap(new HashMap<QName, RpcImplementation>());
- public ProviderSessionImpl(Provider provider) {
- super(null);
+ public ProviderSessionImpl(Provider provider, BundleContext ctx) {
+ super(null,ctx);
this.provider = provider;
}
}
}
+
+ public void setBundleContext(BundleContext context) {
+ this.bundleContext = context;
+ }
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.sal.core.impl;
+package org.opendaylight.controller.sal.dom.broker;
import java.util.ArrayList;
import java.util.Collections;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.controller.sal.core.impl;
+package org.opendaylight.controller.sal.dom.broker;
import java.util.Collection;
import java.util.Collections;
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+/*
+ * Copyright (c) 2013 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
*/
-package org.opendaylight.controller.sal.core.impl;
\ No newline at end of file
+package org.opendaylight.controller.sal.dom.broker;
\ No newline at end of file
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+ <modelVersion>4.0.0</modelVersion>\r
+ <parent>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal-parent</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </parent>\r
+ <artifactId>sal-core-demo</artifactId>\r
+ <scm>\r
+ <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>\r
+ <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>\r
+ <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>\r
+ </scm>\r
+\r
+ <dependencies>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>sal-broker-impl</artifactId>\r
+ <version>1.0-SNAPSHOT</version>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.opendaylight.controller</groupId>\r
+ <artifactId>yang-data-util</artifactId>\r
+ </dependency>\r
+ <dependency>\r
+ <groupId>org.slf4j</groupId>\r
+ <artifactId>slf4j-simple</artifactId>\r
+ <version>1.7.2</version>\r
+ <scope>runtime</scope>\r
+ </dependency>\r
+ </dependencies>\r
+ <build>\r
+ <plugins>\r
+ <plugin>\r
+ <artifactId>maven-assembly-plugin</artifactId>\r
+ <version>2.4</version>\r
+ <configuration>\r
+ <descriptorRefs>\r
+ <descriptorRef>jar-with-dependencies</descriptorRef>\r
+ </descriptorRefs>\r
+ <archive>\r
+ <manifest>\r
+ <mainClass>org.opendaylight.controller.sal.demo.SALDemo</mainClass>\r
+ </manifest>\r
+ </archive>\r
+ </configuration>\r
+ <executions>\r
+ <execution>\r
+ <id>make-assembly</id>\r
+ <phase>package</phase>\r
+ <goals>\r
+ <goal>single</goal>\r
+ </goals>\r
+ </execution>\r
+ </executions>\r
+ </plugin>\r
+\r
+ </plugins>\r
+\r
+ </build>\r
+</project>\r
props.addAll(prop);
}
nodeConnectorProps.put(entry.getKey(), props);
- notifyInventoryShimListener(entry.getKey(), UpdateType.ADDED,
- entry.getValue());
+ notifyInventoryShimListener(entry.getKey(), UpdateType.ADDED, entry.getValue());
}
// Add this node
}
}
- private void notifyInventoryShimExternalListener(Node node,
- UpdateType type, Set<Property> props) {
+ private void notifyInventoryShimExternalListener(Node node, UpdateType type, Set<Property> props) {
for (IInventoryShimExternalListener s : this.inventoryShimExternalListeners) {
s.updateNode(node, type, props);
}
}
- private void notifyInventoryShimExternalListener(
- NodeConnector nodeConnector, UpdateType type, Set<Property> props) {
+ private void notifyInventoryShimExternalListener(NodeConnector nodeConnector, UpdateType type, Set<Property> props) {
for (IInventoryShimExternalListener s : this.inventoryShimExternalListeners) {
s.updateNodeConnector(nodeConnector, type, props);
}
private void notifyInventoryShimInternalListener(String container,
NodeConnector nodeConnector, UpdateType type, Set<Property> props) {
- IInventoryShimInternalListener inventoryShimInternalListener = inventoryShimInternalListeners
- .get(container);
+ IInventoryShimInternalListener inventoryShimInternalListener = inventoryShimInternalListeners.get(container);
if (inventoryShimInternalListener != null) {
- inventoryShimInternalListener.updateNodeConnector(nodeConnector,
- type, props);
- logger.trace(
- "notifyInventoryShimInternalListener {} type {} for container {}",
- new Object[] { nodeConnector, type, container });
+ inventoryShimInternalListener.updateNodeConnector(nodeConnector, type, props);
+ logger.trace("notifyInventoryShimInternalListener {} type {} for container {}", new Object[] {
+ nodeConnector, type, container });
}
}
notifyInventoryShimInternalListener(container, nodeConnector, type, props);
}
- // Notify DiscoveryService
+ // Notify plugin listeners (Discovery, DataPacket, OFstats etc.)
notifyInventoryShimExternalListener(nodeConnector, type, props);
logger.debug("Connection service accepted the inventory notification for {} {}", nodeConnector, type);
if (isNodeLocal) {
// Now notify other containers
- Set<String> containers = (nodeContainerMap.get(node) == null) ? new HashSet<String>() : new HashSet<String>(
- nodeContainerMap.get(node));
+ Set<String> containers = (nodeContainerMap.get(node) == null) ? new HashSet<String>()
+ : new HashSet<String>(nodeContainerMap.get(node));
containers.add(GlobalConstants.DEFAULT.toString());
for (String container : containers) {
notifyInventoryShimInternalListener(container, node, type, props);
}
- // Notify external listener
+
+ // Notify plugin listeners (Discovery, DataPacket, OFstats etc.)
notifyInventoryShimExternalListener(node, type, props);
logger.debug("Connection service accepted the inventory notification for {} {}", node, type);
private void notifyGlobalInventoryShimInternalListener(Node node, UpdateType type, Set<Property> props) {
for (IInventoryShimInternalListener globalListener : globalInventoryShimInternalListeners) {
globalListener.updateNode(node, type, props);
- logger.trace(
- "notifyGlobalInventoryShimInternalListener {} type {}",
- new Object[] { node, type });
+ logger.trace("notifyGlobalInventoryShimInternalListener {} type {}", new Object[] { node, type });
}
}
import org.slf4j.LoggerFactory;
/**
- * It periodically polls the different OF statistics from the OF switches and
- * caches them for quick retrieval for the above layers' modules It also
- * provides an API to directly query the switch about the statistics
+ * Periodically polls the different OF statistics from the OF switches, caches
+ * them, and publishes results towards SAL. It also provides an API to directly
+ * query the switch for any specific statistics.
*/
-public class OFStatisticsManager implements IOFStatisticsManager,
-IInventoryShimExternalListener, CommandProvider {
+public class OFStatisticsManager implements IOFStatisticsManager, IInventoryShimExternalListener, CommandProvider {
private static final Logger log = LoggerFactory.getLogger(OFStatisticsManager.class);
private static final int INITIAL_SIZE = 64;
private static final long FLOW_STATS_PERIOD = 10000;
* @return true if node is local to this controller. false otherwise.
*/
public boolean isLocal(Node node) {
- if (this.connectionListener == null) return true;
+ if (this.connectionListener == null) return false;
return connectionListener.isLocal(node);
}
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>yang-prototype</artifactId>
- <version>0.5-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>${project.artifactId}</name>
- <description>
- yang-prototype
- </description>
- <scm>
- <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>
- <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>
- </scm>
-
- <modules>
- <module>sal</module>
- <module>concepts-lang</module>
- </modules>
-
- <properties>
- <yangtools.version>0.5.5-SNAPSHOT</yangtools.version>
- <sonar.host.url>https://sonar.opendaylight.org/</sonar.host.url>
- <nexusproxy>http://nexus.opendaylight.org/content</nexusproxy>
- <sitedeploy>dav:http://nexus.opendaylight.org/content/sites/site</sitedeploy>
- <siteplugin>3.2</siteplugin>
- <defaultStylesheet>${project.basedir}/src/site/resources/stylesheet.css</defaultStylesheet>
- <projectinfo>2.6</projectinfo>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <compiler.version>2.3.2</compiler.version>
- <surefire.version>2.13</surefire.version>
- <exam.version>3.0.0</exam.version>
- <url.version>1.5.0</url.version>
- <enunciate.version>1.26.2</enunciate.version>
- <sonar.branch>${user.name}-private-view</sonar.branch>
- <sonar.skippedModules>org.openflow.openflowj,net.sf.jung2</sonar.skippedModules>
- <logback.version>1.0.9</logback.version>
- <slf4j.version>1.7.2</slf4j.version>
- </properties>
-
- <pluginRepositories>
- <pluginRepository>
- <id>central</id>
- <name>maven repo1</name>
- <url>http://repo1.maven.org/maven2</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- </releases>
- </pluginRepository>
- <pluginRepository>
- <id>opendaylight.snapshot</id>
- <name>opendaylight.snapshot</name>
- <url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
- </pluginRepository>
- </pluginRepositories>
-
-
- <repositories>
- <!-- EBR release -->
- <!-- http://repository.springsource.com/maven/bundles/release -->
- <repository>
- <id>ebr-bundles-release</id>
- <name>ebr-bundles-release</name>
- <url>${nexusproxy}/repositories/ebr-bundles-release/</url>
- </repository>
- <!-- EBR external -->
- <!-- http://repository.springsource.com/maven/bundles/external -->
- <repository>
- <id>ebr-bundles-external</id>
- <name>ebr-bundles-external</name>
- <url>${nexusproxy}/repositories/ebr-bundles-external/</url>
- </repository>
- <repository>
- <id>central</id>
- <name>central</name>
- <url>http://repo1.maven.org/maven2</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- </releases>
- </repository>
- <!-- Pax mirror -->
- <!-- https://oss.sonatype.org/content/repositories/ops4j-releases -->
- <repository>
- <id>ops4j-releases</id>
- <name>ops4j-releases</name>
- <url>${nexusproxy}/repositories/ops4j-releases/</url>
- </repository>
- <!-- Third Packages hosted in local maven because not available in
- other places -->
- <repository>
- <id>thirdparty</id>
- <name>thirdparty</name>
- <url>${nexusproxy}/repositories/thirdparty/</url>
- </repository>
- <!-- Jboss mirror -->
- <!-- https://repository.jboss.org/nexus/content/repositories/releases -->
- <repository>
- <id>jboss.releases</id>
- <name>jboss.releases</name>
- <url>${nexusproxy}/repositories/jboss.releases/</url>
- </repository>
- <!-- OpenDayLight Released artifact -->
- <repository>
- <id>opendaylight-release</id>
- <name>opendaylight-release</name>
- <url>${nexusproxy}/repositories/opendaylight.release/</url>
- </repository>
- <!-- OpenDayLight Snapshot artifact -->
- <repository>
- <id>opendaylight-snapshot</id>
- <name>opendaylight-snapshot</name>
- <url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
- </repository>
- </repositories>
-
- <distributionManagement>
- <!-- OpenDayLight Released artifact -->
- <repository>
- <id>opendaylight-release</id>
- <url>${nexusproxy}/repositories/opendaylight.release/</url>
- </repository>
- <!-- OpenDayLight Snapshot artifact -->
- <snapshotRepository>
- <id>opendaylight-snapshot</id>
- <url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
- </snapshotRepository>
- <site>
- <id>${project.artifactId}-site</id>
- <url>./</url>
- </site>
- </distributionManagement>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.10</version>
- <scope>test</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.7.2</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${compiler.version}</version>
- <inherited>true</inherited>
- <configuration>
- <source>1.7</source>
- <target>1.7</target>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>deploy</phase>
- <goals>
- <goal>jar-no-fork</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <!-- explicitly define maven-deploy-plugin after other to
- force exec order -->
- <artifactId>maven-deploy-plugin</artifactId>
- <executions>
- <execution>
- <id>deploy</id>
- <phase>deploy</phase>
- <goals>
- <goal>deploy</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <stylesheetfile>${defaultStylesheet}</stylesheetfile>
- <excludePackageNames>
- *.opendaylight.controller.antlrv4.code.gen
- </excludePackageNames>
- </configuration>
- <executions>
- <execution>
- <id>aggregate</id>
- <goals>
- <goal>aggregate</goal>
- </goals>
- <phase>site</phase>
- </execution>
- <execution>
- <id>attach-javadocs</id>
- <phase>deploy</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>${siteplugin}</version>
- <inherited>false</inherited>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.doxia</groupId>
- <artifactId>doxia-module-markdown</artifactId>
- <version>1.3</version>
- </dependency>
- </dependencies>
- <configuration>
- <siteDirectory>${project.basedir}/src/site</siteDirectory>
- <inputEncoding>UTF-8</inputEncoding>
- <outputEncoding>UTF-8</outputEncoding>
- </configuration>
- </plugin>
- </plugins>
-
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.2.1</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.7</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.15</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>${siteplugin}</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven.doxia</groupId>
- <artifactId>doxia-module-markdown</artifactId>
- <version>1.3</version>
- </dependency>
- </dependencies>
- <configuration>
- <siteDirectory>${project.parent.basedir}/src/site</siteDirectory>
- <inputEncoding>UTF-8</inputEncoding>
- <outputEncoding>UTF-8</outputEncoding>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.9.1</version>
- <configuration>
- <stylesheetfile>${defaultStylesheet}</stylesheetfile>
- </configuration>
- <executions>
- <execution>
- <id>aggregate</id>
- <goals>
- <goal>aggregate</goal>
- </goals>
- <phase>site</phase>
- </execution>
- <execution>
- <id>attach-javadocs</id>
- <phase>deploy</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </pluginManagement>
-
- </build>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.9.1</version>
- <reportSets>
- <reportSet>
- <reports>
- <report>javadoc</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <version>2.4.0</version>
- <configuration>
- <effort>Max</effort>
- <threshold>Low</threshold>
- <goal>site</goal>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>jdepend-maven-plugin</artifactId>
- <version>2.0-beta-2</version>
- </plugin>
- </plugins>
- </reporting>
-
- <profiles>
- <profile>
- <id>viewbuild</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <properties>
- <build.suffix>${project.version}</build.suffix>
- </properties>
- </profile>
- <profile>
- <id>jenkins</id>
- <activation>
- <property>
- <name>BUILDSUFFIX</name>
- </property>
- </activation>
- <properties>
- <build.suffix>${BUILDSUFFIX}</build.suffix>
- </properties>
- </profile>
- </profiles>
-
-</project>
+++ /dev/null
-module opendaylight-flow-types {
- namespace "urn:opendaylight:flow:types";
- prefix flow;
-
- import ietf-inet-types {prefix inet;}
- import opendaylight-match-types {prefix match;}
- import ietf-yang-types {prefix yang;}
-
-
- revision "2013-08-19" {
- description "Initial revision of flow service";
- }
-
- grouping action {
- choice action {
- case output-action {
- leaf-list output-node-connector {
- type inet:uri;
- }
- }
-
- case controller-action {
- leaf max-length {
- type uint16 {
- range "0..65294";
- }
- }
- }
-
- case set-queue-action {
- leaf queue {
- type string; // TODO: define queues
- }
- }
-
- case pop-mpls-action {
- leaf ethernet-type {
- type uint16; // TODO: define ethertype type
- }
- }
-
- case set-mpls-ttl-action {
- leaf mpls-ttl {
- type uint8;
- }
- }
-
- case set-nw-ttl-action {
- leaf nw-ttl {
- type uint8;
- }
- }
-
- case push-pbb-action {
-
- }
-
- case push-mpls-action {
-
- }
-
- case push-vlan-action {
-
- }
- }
- }
-
- grouping flow {
- container match {
- uses match:match;
- }
- list action {
- key "order";
- leaf order {
- type int32;
- }
- uses action;
- }
- leaf priority {
- type uint16;
- }
-
- leaf idle-timeout {
- type uint16;
- }
-
- leaf hard-timeout {
- type uint16;
- }
-
- leaf cookie {
- type uint64;
- }
- }
-
- grouping flow-statistics {
- leaf packet-count {
- type yang:counter64;
- }
-
- leaf byte-count {
- type yang:counter64;
- }
-
- container duration {
- leaf second {
- type yang:counter64;
- }
- leaf nanosecond {
- type yang:counter64;
- }
- }
- }
-
- grouping flow-table-statistics {
- leaf active {
- type yang:counter64;
- }
-
- leaf lookup {
- type yang:counter64;
- }
-
- leaf matched {
- type yang:counter64;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
- <modelVersion>4.0.0</modelVersion>\r
- <parent>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal-parent</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </parent>\r
- <artifactId>sal-core-demo</artifactId>\r
- <scm>\r
- <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>\r
- <developerConnection>scm:git:ssh://git.opendaylight.org:29418/controller.git</developerConnection>\r
- <url>https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL</url>\r
- </scm>\r
-\r
- <dependencies>\r
- <dependency>\r
-\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>sal-broker-impl</artifactId>\r
- <version>1.0-SNAPSHOT</version>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.opendaylight.controller</groupId>\r
- <artifactId>yang-data-util</artifactId>\r
- </dependency>\r
- <dependency>\r
- <groupId>org.slf4j</groupId>\r
- <artifactId>slf4j-simple</artifactId>\r
- <version>1.7.2</version>\r
- <scope>runtime</scope>\r
- </dependency>\r
- </dependencies>\r
- <build>\r
- <plugins>\r
- <plugin>\r
- <artifactId>maven-assembly-plugin</artifactId>\r
- <version>2.4</version>\r
- <configuration>\r
- <descriptorRefs>\r
- <descriptorRef>jar-with-dependencies</descriptorRef>\r
- </descriptorRefs>\r
- <archive>\r
- <manifest>\r
- <mainClass>org.opendaylight.controller.sal.demo.SALDemo</mainClass>\r
- </manifest>\r
- </archive>\r
- </configuration>\r
- <executions>\r
- <execution>\r
- <id>make-assembly</id>\r
- <phase>package</phase>\r
- <goals>\r
- <goal>single</goal>\r
- </goals>\r
- </execution>\r
- </executions>\r
- </plugin>\r
-\r
- </plugins>\r
-\r
- </build>\r
-</project>\r
}
for (InetAddress i : IPs) {
Subnet existingSubnet = subnets.get(i);
- if ((existingSubnet != null)
- && !existingSubnet.isMutualExclusive(newSubnet)) {
- return new Status(StatusCode.CONFLICT);
+ if ((existingSubnet != null) && !existingSubnet.isMutualExclusive(newSubnet)) {
+ return new Status(StatusCode.CONFLICT, "This subnet conflicts with an existing one.");
}
}
return new Status(StatusCode.SUCCESS);
// Presence check
if (subnetsConfigList.containsKey(conf.getName())) {
return new Status(StatusCode.CONFLICT,
- "Subnet with the specified name already configured.");
+ "Subnet with the specified name already exists.");
}
// Semantic check
status = semanticCheck(conf);
static final String TOPONODECONNECTORDB = "topologymanager.nodeConnectorDB";
static final String TOPOUSERLINKSDB = "topologymanager.userLinksDB";
private static final Logger log = LoggerFactory.getLogger(TopologyManagerImpl.class);
- private static final String SAVE = "Save";
private ITopologyService topoService;
private IClusterContainerServices clusterContainerService;
// DB of all the Edges with properties which constitute our topology
if (portsMatch != null) {
portsLength = portsMatch.length;
}
- item.ports = '<span class="nodePorts" style="cursor:pointer;color: #08c" ports='+encodeURIComponent(JSON.stringify(item.ports)) + ' nodeId=' + item.nodeId
- + ' nodeName=' + nodeName
- + '>' + portsLength +'</span>';
+ item.ports = '<span class="nodePorts" style="cursor:pointer;color: #08c" ports='+encodeURIComponent(JSON.stringify(item.ports)) + ' nodeId="' + item.nodeId
+ + '" nodeName="' + nodeName
+ + '">' + portsLength +'</span>';
});
},
delay: 0
if (portsMatch != null) {
portsLength = portsMatch.length;
}
- item.ports = '<span class="nodePorts" style="cursor: pointer;color: #08c" ports='+encodeURIComponent(JSON.stringify(item.ports)) + ' nodeId=' + item.nodeId
- + ' nodeName=' + item.nodeName
- + '>' + portsLength +'</span>';
+ item.ports = '<span class="nodePorts" style="cursor: pointer;color: #08c" ports='+encodeURIComponent(JSON.stringify(item.ports)) + ' nodeId="' + item.nodeId
+ + '" nodeName="' + item.nodeName
+ + '">' + portsLength +'</span>';
});
},
delay: 0
data: data.nodeData,
formatter: function(items) {
$.each(items, function(index, tableRow) {
- tableRow["selector"] = '<input type="checkbox" class="subnetGatewayConfig" id='
- + tableRow["name"] + '></input>';
+ tableRow["selector"] = '<input type="checkbox" class="subnetGatewayConfig" id="'
+ + tableRow["name"] + '"></input>';
var json = tableRow["nodePorts"];
var nodePorts = JSON.parse(json);
var nodePortHtml = "<div>";
$.each(nodePorts, function(index, nodePort) {
nodePortHtml += nodePort["nodePortName"] + " @ " + nodePort["nodeName"];
nodePortHtml += " ";
- nodePortHtml += '<a href="#" id=' + encodeURIComponent(nodePort["nodePortId"]) +
- ' gatewayName=' + tableRow["name"] +
- ' onclick="javascript:one.f.switchmanager.subnetGatewayConfig.actions.deleteNodePort(this);">Remove</a>';
+ nodePortHtml += '<a href="#" id="' + encodeURIComponent(nodePort["nodePortId"]) +
+ '" gatewayName="' + tableRow["name"] +
+ '" onclick="javascript:one.f.switchmanager.subnetGatewayConfig.actions.deleteNodePort(this);">Remove</a>';
nodePortHtml += "<br/>";
});
nodePortHtml += "</div>";
data: data.nodeData,
formatter: function(items) {
$.each(items, function(index, item) {
- item["selector"] = '<input type="checkbox" class="staticRoute" id=' + item["name"] + '></input>';
+ item["selector"] = '<input type="checkbox" class="staticRoute" id="' + item["name"] + '"></input>';
});
},
data: data.nodeData,
formatter: function(items) {
$.each(items, function(index, item) {
- item["selector"] = '<input type="checkbox" class="spanPortConfig" spanPort=' + encodeURIComponent(item["json"]) + ' spanPortNode=' + item["nodeName"] + ' spanPortPort=' + item["spanPortName"] + '></input>';
+ item["selector"] = '<input type="checkbox" class="spanPortConfig" spanPort=' + encodeURIComponent(item["json"]) + ' spanPortNode="' + item["nodeName"] + '" spanPortPort="' + item["spanPortName"] + '"></input>';
});
},
delay: 0
}
@RequestMapping(value = "logout")
- public String login(Map<String, Object> model,
- final HttpServletRequest request) {
+ public String logout(Map<String, Object> model, final HttpServletRequest request) {
IUserManager userManager = (IUserManager) ServiceHelper
.getGlobalInstance(IUserManager.class, this);