Skip to content
Permalink
Browse files
Cleans up neutron code
  • Loading branch information
zack-shoylev committed Sep 9, 2014
1 parent dfd6172 commit d868843563ea9da3ba0f924761903c5bcd4f7e7f
Showing 34 changed files with 290 additions and 281 deletions.
@@ -166,14 +166,14 @@ public String toString() {
/**
* @return the Builder for creating a new floating IP
*/
public static CreateBuilder createOptions(String floatingNetworkId) {
public static CreateBuilder createBuilder(String floatingNetworkId) {
return new CreateBuilder(floatingNetworkId);
}

/**
* @return the Builder for updating a floating IP
*/
public static UpdateBuilder updateOptions() {
public static UpdateBuilder updateBuilder() {
return new UpdateBuilder();
}

@@ -260,8 +260,8 @@ private CreateBuilder(String floatingNetworkId) {
/**
* @return a CreateOptions constructed with this Builder.
*/
public CreateOptions build() {
return new CreateOptions(floatingIP);
public CreateFloatingIP build() {
return new CreateFloatingIP(floatingIP);
}

protected CreateBuilder self() {
@@ -294,22 +294,22 @@ public UpdateBuilder floatingIpAddress(String floatingIpAddress) {
/**
* @return a UpdateOptions constructed with this Builder.
*/
public UpdateOptions build() {
return new UpdateOptions(floatingIP);
public UpdateFloatingIP build() {
return new UpdateFloatingIP(floatingIP);
}

protected UpdateBuilder self() {
return this;
}
}

public static class CreateOptions extends FloatingIP {
private CreateOptions(FloatingIP floatingIP) {
public static class CreateFloatingIP extends FloatingIP {
private CreateFloatingIP(FloatingIP floatingIP) {
super(floatingIP);
}
}
public static class UpdateOptions extends FloatingIP {
private UpdateOptions(FloatingIP floatingIP) {
public static class UpdateFloatingIP extends FloatingIP {
private UpdateFloatingIP(FloatingIP floatingIP) {
super(floatingIP);
}
}
@@ -40,7 +40,7 @@ public String toString() {
return name;
}

/**
/*
* This provides GSON enum support in jclouds.
* */
public static IPv6DHCPMode fromValue(String name){
@@ -16,15 +16,17 @@
*/
package org.jclouds.openstack.neutron.v2.domain;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;
import org.jclouds.javax.annotation.Nullable;
import static com.google.common.base.Preconditions.checkNotNull;

import javax.inject.Named;
import java.beans.ConstructorProperties;

import static com.google.common.base.Preconditions.checkNotNull;
import javax.inject.Named;

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableSet;

/**
* A Neutron network
@@ -367,14 +369,14 @@ public String toString() {
/**
* @return the Builder for creating a new Router
*/
public static CreateBuilder createOptions(String name) {
public static CreateBuilder createBuilder(String name) {
return new CreateBuilder(name);
}

/**
* @return the Builder for updating a Router
*/
public static UpdateBuilder updateOptions() {
public static UpdateBuilder updateBuilder() {
return new UpdateBuilder();
}

@@ -585,8 +587,8 @@ private CreateBuilder(String name) {
/**
* @return a CreateOptions constructed with this Builder.
*/
public CreateOptions build() {
return new CreateOptions(network);
public CreateNetwork build() {
return new CreateNetwork(network);
}

protected CreateBuilder self() {
@@ -607,8 +609,8 @@ private UpdateBuilder() {
/**
* @return a UpdateOptions constructed with this Builder.
*/
public UpdateOptions build() {
return new UpdateOptions(network);
public UpdateNetwork build() {
return new UpdateNetwork(network);
}

protected UpdateBuilder self() {
@@ -620,11 +622,11 @@ protected UpdateBuilder self() {
* Create and Update options - extend the domain class, passed to API update and create calls.
* Essentially the same as the domain class. Ensure validation and safe typing.
*/
public static class CreateOptions extends Network {
public static class CreateNetwork extends Network {
/**
* Copy constructor
*/
private CreateOptions(Network network) {
private CreateNetwork(Network network) {
super(network);
checkNotNull(network.name, "name should not be null");
}
@@ -634,11 +636,11 @@ private CreateOptions(Network network) {
* Create and Update options - extend the domain class, passed to API update and create calls.
* Essentially the same as the domain class. Ensure validation and safe typing.
*/
public static class UpdateOptions extends Network {
public static class UpdateNetwork extends Network {
/**
* Copy constructor
*/
private UpdateOptions(Network network) {
private UpdateNetwork(Network network) {
super(network);
}
}
@@ -17,6 +17,9 @@

package org.jclouds.openstack.neutron.v2.domain;

/**
* Enumerates Network Status.
*/
public enum NetworkStatus {
ACTIVE("active"),
DOWN("down"),
@@ -38,7 +41,7 @@ public String toString() {
return name();
}

/**
/*
* This provides GSON enum support in jclouds.
* @param name The string representation of this enum value.
* @return The corresponding enum value.
@@ -18,10 +18,7 @@
package org.jclouds.openstack.neutron.v2.domain;

/**
* Enumerates supported Network types.
*
* @see <a href=
* "http://docs.openstack.org/api/openstack-network/2.0/content/provider_ext.html">api doc</a>
* Enumerates supported Network types.
*/
public enum NetworkType {
/**
@@ -37,15 +34,15 @@ public enum NetworkType {
*/
VLAN("vlan"),
/**
* Used to describe a Virtual Extensible LAN (VXLAN) network.
* It uses a VLAN-like encapsulation technique to encapsulate MAC-based
* Used to describe a Virtual Extensible LAN (VXLAN) network.
* It uses a VLAN-like encapsulation technique to encapsulate MAC-based
* OSI layer 2 Ethernet frames within layer 4 UDP packets.
*/
VXLAN("vxlan"),
/**
* Used to describe a GRE tunnel network. A virtual network realized as
* packets encapsulated using Generic Routing Encapsulation. GRE tunnel
* packets are routed by the compute node hosts, so GRE tunnels are not
* Used to describe a GRE tunnel network. A virtual network realized as
* packets encapsulated using Generic Routing Encapsulation. GRE tunnel
* packets are routed by the compute node hosts, so GRE tunnels are not
* associated by the openvswitch plugin with specific physical networks.
*/
GRE("gre"),
@@ -65,7 +62,7 @@ public String toString() {
return name;
}

/**
/*
* This provides GSON enum support in jclouds.
* @param name The string representation of this enum value.
* @return The corresponding enum value.
@@ -16,16 +16,18 @@
*/
package org.jclouds.openstack.neutron.v2.domain;

import static com.google.common.base.Preconditions.checkNotNull;

import java.beans.ConstructorProperties;

import javax.inject.Named;

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import org.jclouds.javax.annotation.Nullable;

import javax.inject.Named;
import java.beans.ConstructorProperties;

import static com.google.common.base.Preconditions.checkNotNull;

/**
* A Neutron port
@@ -460,14 +462,14 @@ public String toString() {
/**
* @return the Builder for creating a new Router
*/
public static CreateBuilder createOptions(String networkId) {
public static CreateBuilder createBuilder(String networkId) {
return new CreateBuilder(networkId);
}

/**
* @return the Builder for updating a Router
*/
public static UpdateBuilder updateOptions() {
public static UpdateBuilder updateBuilder() {
return new UpdateBuilder();
}

@@ -702,8 +704,8 @@ private CreateBuilder(String networkId) {
/**
* @return a CreateOptions constructed with this Builder.
*/
public CreateOptions build() {
return new CreateOptions(port);
public CreatePort build() {
return new CreatePort(port);
}

protected CreateBuilder self() {
@@ -724,8 +726,8 @@ private UpdateBuilder() {
/**
* @return a UpdateOptions constructed with this Builder.
*/
public UpdateOptions build() {
return new UpdateOptions(port);
public UpdatePort build() {
return new UpdatePort(port);
}

protected UpdateBuilder self() {
@@ -737,11 +739,11 @@ protected UpdateBuilder self() {
* Create and Update options - extend the domain class, passed to API update and create calls.
* Essentially the same as the domain class. Ensure validation and safe typing.
*/
public static class CreateOptions extends Port {
public static class CreatePort extends Port {
/**
* Copy constructor
*/
private CreateOptions(Port port) {
private CreatePort(Port port) {
super(port);
checkNotNull(port.networkId, "networkId should not be null");
}
@@ -751,11 +753,11 @@ private CreateOptions(Port port) {
* Create and Update options - extend the domain class, passed to API update and create calls.
* Essentially the same as the domain class. Ensure validation and safe typing.
*/
public static class UpdateOptions extends Port {
public static class UpdatePort extends Port {
/**
* Copy constructor
*/
private UpdateOptions(Port port) {
private UpdatePort(Port port) {
super(port);
}
}
@@ -16,12 +16,14 @@
*/
package org.jclouds.openstack.neutron.v2.domain;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import org.jclouds.javax.annotation.Nullable;
import java.beans.ConstructorProperties;

import javax.inject.Named;
import java.beans.ConstructorProperties;

import org.jclouds.javax.annotation.Nullable;

import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;

/**
* A Neutron Router
@@ -125,14 +127,14 @@ public ExternalGatewayInfo getExternalGatewayInfo() {
/**
* @return the Builder for creating a new Router
*/
public static CreateBuilder createOptions() {
public static CreateBuilder createBuilder() {
return new CreateBuilder();
}

/**
* @return the Builder for updating a Router
*/
public static UpdateBuilder updateOptions() {
public static UpdateBuilder updateBuilder() {
return new UpdateBuilder();
}

@@ -237,8 +239,8 @@ private CreateBuilder() {
/**
* @return a CreateOptions constructed with this Builder.
*/
public CreateOptions build() {
return new CreateOptions(router);
public CreateRouter build() {
return new CreateRouter(router);
}

protected CreateBuilder self() {
@@ -256,28 +258,28 @@ private UpdateBuilder() {
/**
* @return a UpdateOptions constructed with this Builder.
*/
public UpdateOptions build() {
return new UpdateOptions(router);
public UpdateRouter build() {
return new UpdateRouter(router);
}

protected UpdateBuilder self() {
return this;
}
}

public static class CreateOptions extends Router{
public static class CreateRouter extends Router{
/**
* Copy constructor
*/
private CreateOptions(Router router) {
private CreateRouter(Router router) {
super(router);
}
}
public static class UpdateOptions extends Router{
public static class UpdateRouter extends Router{
/**
* Copy constructor
*/
private UpdateOptions(Router router) {
private UpdateRouter(Router router) {
super(router);
}
}

0 comments on commit d868843

Please sign in to comment.