tom

Sketching cluster related stuff with Madan..

package org.onlab.onos.cluster;
import org.onlab.onos.event.AbstractEvent;
/**
* Describes cluster-related event.
*/
public class ClusterEvent extends AbstractEvent<ClusterEvent.Type, ControllerInstance> {
/**
* Type of device events.
*/
public enum Type {
/**
* Signifies that a new cluster instance has been administratively added.
*/
INSTANCE_ADDED,
/**
* Signifies that a cluster instance has been administratively removed.
*/
INSTANCE_REMOVED,
/**
* Signifies that a cluster instance became active.
*/
INSTANCE_ACTIVE,
/**
* Signifies that a cluster instance became inactive.
*/
INSTANCE_INACTIVE
}
// TODO: do we need to fix the verv/adjective mix? discuss
/**
* Creates an event of a given type and for the specified instance and the
* current time.
*
* @param type cluster event type
* @param instance cluster device subject
*/
public ClusterEvent(Type type, ControllerInstance instance) {
super(type, instance);
}
/**
* Creates an event of a given type and for the specified device and time.
*
* @param type device event type
* @param instance event device subject
* @param time occurrence time
*/
public ClusterEvent(Type type, ControllerInstance instance, long time) {
super(type, instance, time);
}
}
package org.onlab.onos.cluster;
import java.util.Set;
/**
* Service for obtaining information about the individual instances within
* the controller cluster.
*/
public interface ClusterService {
/**
* Returns the set of current cluster members.
*
* @return set of cluster members
*/
Set<ControllerInstance> getInstances();
/**
* Returns the availability state of the specified controller instance.
*
* @return availability state
*/
ControllerInstance.State getState(ControllerInstance instance);
// TODO: determine if this would be better attached to ControllerInstance directly
// addListener, removeListener
}
package org.onlab.onos.cluster;
import org.onlab.packet.IpAddress;
/**
* Represents a controller instance as a member in a cluster.
*/
public interface ControllerInstance {
/** Represents the operational state of the instance. */
public enum State {
/**
* Signifies that the instance is active and operating normally.
*/
ACTIVE,
/**
* Signifies that the instance is inactive, which means either down or
* up, but not operational.
*/
INACTIVE
}
/**
* Returns the instance identifier.
*
* @return instance identifier
*/
InstanceId id();
/**
* Returns the IP address of the controller instance.
*
* @return IP address
*/
IpAddress ip();
}
package org.onlab.onos.cluster;
/**
* Controller cluster identity.
*/
public interface InstanceId {
}
/**
* Set of abstractions for dealing with controller cluster related topics.
*/
package org.onlab.onos.cluster;
\ No newline at end of file
......@@ -19,7 +19,7 @@ public class FlowRuleEvent extends AbstractEvent<FlowRuleEvent.Type, FlowRule> {
/**
* Signifies that a flow rule has been removed.
*/
RULE_REMOVED,
RULE_REMOVED
}
/**
......
......@@ -23,6 +23,8 @@ public interface FlowRuleService {
*/
Iterable<FlowEntry> getFlowEntries(DeviceId deviceId);
// TODO: add createFlowRule factory method and execute operations method
/**
* Applies the specified flow rules onto their respective devices. These
* flow rules will be retained by the system and re-applied anytime the
......@@ -46,9 +48,6 @@ public interface FlowRuleService {
void removeFlowRules(FlowRule... flowRules);
// void addInitialFlowContributor(InitialFlowContributor contributor);
// void removeInitialFlowContributor(InitialFlowContributor contributor);
/**
* Adds the specified flow rule listener.
*
......
......@@ -7,7 +7,6 @@
description="ONOS 3rd party dependencies">
<bundle>mvn:commons-lang/commons-lang/2.6</bundle>
<bundle>mvn:com.google.guava/guava/18.0</bundle>
<bundle>mvn:io.netty/netty/3.9.2.Final</bundle>
</feature>
......@@ -63,7 +62,7 @@
<feature name="onos-openflow" version="1.0.0"
description="ONOS OpenFlow API, Controller &amp; Providers">
<feature>onos-api</feature>
<bundle>mvn:io.netty/netty/3.9.2.Final</bundle>
<bundle>mvn:org.onlab.onos/onos-of-api/1.0.0-SNAPSHOT</bundle>
<bundle>mvn:org.onlab.onos/onos-of-ctl/1.0.0-SNAPSHOT</bundle>
......@@ -77,8 +76,9 @@
<feature name="onos-app-tvue" version="1.0.0"
description="ONOS sample topology viewer application">
<feature>onos-api</feature>
<feature>onos-thirdparty-web</feature>
<feature>onos-api</feature>
<feature>onos-core</feature>
<bundle>mvn:org.onlab.onos/onos-app-tvue/1.0.0-SNAPSHOT</bundle>
</feature>
......
......@@ -15,107 +15,27 @@
<description>ONOS OpenFlow controller subsystem API</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<powermock.version>1.5.5</powermock.version>
<restlet.version>2.1.4</restlet.version>
<cobertura-maven-plugin.version>2.6</cobertura-maven-plugin.version>
<!-- Following 2 findbugs version needs to be updated in sync to match the
findbugs version used in findbugs-plugin -->
<findbugs.version>3.0.0</findbugs.version>
<findbugs-plugin.version>3.0.0</findbugs-plugin.version>
<findbugs.effort>Max</findbugs.effort>
<findbugs.excludeFilterFile>${project.basedir}/conf/findbugs/exclude.xml
</findbugs.excludeFilterFile>
<checkstyle-plugin.version>2.12</checkstyle-plugin.version>
<!-- To publish javadoc to github,
uncomment com.github.github site-maven-plugin and
see https://github.com/OPENNETWORKINGLAB/ONOS/pull/425
<github.global.server>github</github.global.server>
-->
<metrics.version>3.0.2</metrics.version>
<maven.surefire.plugin.version>2.16</maven.surefire.plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.onlab.onos</groupId>
<artifactId>onos-of-api</artifactId>
</dependency>
<!-- ONOS's direct dependencies -->
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
<version>1.9.6</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<!-- findbugs suppression annotation and @GuardedBy, etc. -->
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
<version>${findbugs.version}</version>
</dependency>
<dependency>
<groupId>org.projectfloodlight</groupId>
<artifactId>openflowj</artifactId>
<version>0.3.8-SNAPSHOT</version>
</dependency>
<!-- Floodlight's dependencies -->
<dependency>
<!-- dependency to old version of netty? -->
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
<version>3.9.2.Final</version>
</dependency>
<!-- Dependency for libraries used for testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-easymock</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
</plugin>
</plugins>
</build>
......
......@@ -26,8 +26,8 @@ rm -fr $ONOS_STAGE # Remove this when package script is completed
mkdir -p $ONOS_STAGE
cd $ONOS_STAGE
# Unroll the Apache Karaf bits and make the ONOS top-level directories.
unzip $KARAF_ZIP
# Unroll the Apache Karaf bits, prune them and make the ONOS top-level directories.
unzip $KARAF_ZIP && rm -rm $KARAF_DIST/demos
mkdir bin
# Stage the ONOS admin scripts
......@@ -43,11 +43,11 @@ perl -pi.old -e "s|^(featuresRepositories=.*)|\1,mvn:org.onlab.onos/onos-feature
# Patch the Apache Karaf distribution file to load ONOS features
perl -pi.old -e 's|^(featuresBoot=.*)|\1,onos-api,onos-core,onos-cli,onos-rest,onos-gui,onos-openflow,onos-app-tvue|' \
/tmp/onos-1.0.0-SNAPSHOT/apache-karaf-3.0.1/etc/org.apache.karaf.features.cfg
$ONOS_STAGE/$KARAF_DIST/etc/org.apache.karaf.features.cfg
# Patch the Apache Karaf distribution with ONOS branding bundle
cp $M2_REPO/org/onlab/onos/onos-branding/$ONOS_VERSION/onos-branding-*.jar \
$ONOS_STAGE/apache-karaf-*/lib
$ONOS_STAGE/$KARAF_DIST/lib
# Now package up the ONOS tar file
cd $ONOS_STAGE_ROOT
......