You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ad...@apache.org on 2014/10/05 01:28:47 UTC
[6/7] Remove savvis-symphonyvpdc,
which hasn't been published in over a year.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/b91fd46c/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/config/VPDCRestClientModule.java
----------------------------------------------------------------------
diff --git a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/config/VPDCRestClientModule.java b/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/config/VPDCRestClientModule.java
deleted file mode 100644
index 9d8a444..0000000
--- a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/config/VPDCRestClientModule.java
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.savvis.vpdc.config;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL;
-import static org.jclouds.rest.config.BinderUtils.bindHttpApi;
-import static org.jclouds.savvis.vpdc.reference.VPDCConstants.PROPERTY_VPDC_TIMEOUT_TASK_COMPLETED;
-import static org.jclouds.util.Predicates2.retry;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.jclouds.compute.domain.CIMOperatingSystem;
-import org.jclouds.domain.Credentials;
-import org.jclouds.http.HttpErrorHandler;
-import org.jclouds.http.annotation.ClientError;
-import org.jclouds.http.annotation.Redirection;
-import org.jclouds.http.annotation.ServerError;
-import org.jclouds.json.Json;
-import org.jclouds.location.Provider;
-import org.jclouds.location.suppliers.ImplicitLocationSupplier;
-import org.jclouds.rest.ConfiguresRestClient;
-import org.jclouds.rest.config.RestClientModule;
-import org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier;
-import org.jclouds.savvis.vpdc.VPDCApi;
-import org.jclouds.savvis.vpdc.VPDCAsyncApi;
-import org.jclouds.savvis.vpdc.domain.internal.VCloudSession;
-import org.jclouds.savvis.vpdc.features.BrowsingApi;
-import org.jclouds.savvis.vpdc.features.BrowsingAsyncApi;
-import org.jclouds.savvis.vpdc.features.FirewallApi;
-import org.jclouds.savvis.vpdc.features.FirewallAsyncApi;
-import org.jclouds.savvis.vpdc.features.ServiceManagementApi;
-import org.jclouds.savvis.vpdc.features.ServiceManagementAsyncApi;
-import org.jclouds.savvis.vpdc.features.VMApi;
-import org.jclouds.savvis.vpdc.features.VMAsyncApi;
-import org.jclouds.savvis.vpdc.handlers.VPDCErrorHandler;
-import org.jclouds.savvis.vpdc.internal.LoginApi;
-import org.jclouds.savvis.vpdc.internal.LoginAsyncApi;
-import org.jclouds.savvis.vpdc.internal.VCloudToken;
-import org.jclouds.savvis.vpdc.location.FirstNetwork;
-import org.jclouds.savvis.vpdc.predicates.TaskSuccess;
-import org.jclouds.util.Strings2;
-
-import com.google.common.base.Function;
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.base.Predicate;
-import com.google.common.base.Supplier;
-import com.google.common.base.Suppliers;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Iterables;
-import com.google.inject.Injector;
-import com.google.inject.Provides;
-import com.google.inject.Scopes;
-import com.google.inject.TypeLiteral;
-
-@ConfiguresRestClient
-public class VPDCRestClientModule extends RestClientModule<VPDCApi, VPDCAsyncApi> {
- @Override
- protected void configure() {
- super.configure();
- bindHttpApi(binder(), LoginApi.class, LoginAsyncApi.class);
- }
-
- @VCloudToken
- @Provides
- @Singleton
- protected Supplier<String> provideVCloudToken(Supplier<VCloudSession> cache) {
- return Suppliers.compose(new Function<VCloudSession, String>() {
-
- @Override
- public String apply(VCloudSession input) {
- return checkNotNull(input.getVCloudToken(), "No token present in session");
- }
-
- }, cache);
- }
-
- @Provides
- @org.jclouds.savvis.vpdc.internal.Org
- @Singleton
- protected Supplier<Set<org.jclouds.savvis.vpdc.domain.Resource>> provideOrgs(Supplier<VCloudSession> cache,
- @org.jclouds.location.Provider final Supplier<Credentials> creds) {
- return Suppliers.compose(new Function<VCloudSession, Set<org.jclouds.savvis.vpdc.domain.Resource>>() {
-
- @Override
- public Set<org.jclouds.savvis.vpdc.domain.Resource> apply(VCloudSession input) {
- checkState(input.getOrgs().size() > 0, "No orgs present for user: " + creds.get());
- return input.getOrgs();
- }
-
- }, cache);
- }
-
- @Provides
- @org.jclouds.savvis.vpdc.internal.Org
- @Singleton
- protected Supplier<String> provideDefaultOrgId(
- @org.jclouds.savvis.vpdc.internal.Org Supplier<Set<org.jclouds.savvis.vpdc.domain.Resource>> orgs) {
- return Suppliers.compose(new Function<Set<org.jclouds.savvis.vpdc.domain.Resource>, String>() {
-
- @Override
- public String apply(Set<org.jclouds.savvis.vpdc.domain.Resource> input) {
- return Iterables.get(input, 0).getId();
- }
-
- }, orgs);
- }
-
- @Provides
- @Singleton
- protected Predicate<String> successTester(Injector injector,
- @Named(PROPERTY_VPDC_TIMEOUT_TASK_COMPLETED) long completed) {
- return retry(injector.getInstance(TaskSuccess.class), completed);
- }
-
- public static final Map<Class<?>, Class<?>> DELEGATE_MAP = ImmutableMap.<Class<?>, Class<?>> builder()//
- .put(BrowsingApi.class, BrowsingAsyncApi.class)//
- .put(VMApi.class, VMAsyncApi.class)//
- .put(FirewallApi.class, FirewallAsyncApi.class)//
- .put(ServiceManagementApi.class, ServiceManagementAsyncApi.class)//
- .build();
-
- public VPDCRestClientModule() {
- super(DELEGATE_MAP);
- }
-
- @Singleton
- @Provides
- protected Set<CIMOperatingSystem> provideOperatingSystems(Json json, @Provider String providerName)
- throws IOException {
- return json.fromJson(Strings2.toStringAndClose(getClass().getResourceAsStream(
- "/" + providerName + "/predefined_operatingsystems.json")), new TypeLiteral<Set<CIMOperatingSystem>>() {
- }.getType());
- }
-
- @Provides
- @Singleton
- protected Supplier<VCloudSession> provideVCloudTokenCache(@Named(PROPERTY_SESSION_INTERVAL) long seconds,
- final LoginApi login) {
- return MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.create(authException,
- new Supplier<VCloudSession>() {
-
- @Override
- public VCloudSession get() {
- return login.login();
- }
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(login).add("method", "login").toString();
- }
- }, seconds, TimeUnit.SECONDS);
- }
-
- @Override
- protected void bindErrorHandlers() {
- bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(VPDCErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(VPDCErrorHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(VPDCErrorHandler.class);
- }
-
- @Override
- protected void installLocations() {
- super.installLocations();
- bind(ImplicitLocationSupplier.class).to(FirstNetwork.class).in(Scopes.SINGLETON);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/b91fd46c/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/FirewallRule.java
----------------------------------------------------------------------
diff --git a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/FirewallRule.java b/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/FirewallRule.java
deleted file mode 100644
index 7fa18a7..0000000
--- a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/FirewallRule.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.savvis.vpdc.domain;
-
-import java.net.URI;
-
-import com.google.common.base.Objects;
-
-/**
- * API returns a firewall rule in a firewall service
- */
-public class FirewallRule extends ResourceImpl {
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder extends ResourceImpl.Builder {
-
- private String firewallType;
- private boolean isEnabled;
- private String source;
- private String destination;
- private String port;
- private String policy;
- private String description;
- private boolean isLogged;
- private String protocol;
-
- @Override
- public FirewallRule build() {
- return new FirewallRule(id, name, type, href, firewallType, isEnabled, source, destination, port,
- policy, description, isLogged, protocol);
- }
-
- public Builder firewallType(String firewallType) {
- this.firewallType = firewallType;
- return this;
- }
-
- public Builder isEnabled(boolean isEnabled) {
- this.isEnabled = isEnabled;
- return this;
- }
-
- public Builder source(String source) {
- this.source = source;
- return this;
- }
-
- public Builder destination(String destination) {
- this.destination = destination;
- return this;
- }
-
- public Builder port(String port) {
- this.port = port;
- return this;
- }
-
- public Builder policy(String policy) {
- this.policy = policy;
- return this;
- }
-
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- public Builder isLogged(boolean isLogged) {
- this.isLogged = isLogged;
- return this;
- }
-
- public Builder protocol(String protocol) {
- this.protocol = protocol;
- return this;
- }
-
- public static Builder fromFirewallRule(FirewallRule in) {
- return new Builder().id(in.getId()).name(in.getName()).type(in.getType()).href(in.getHref())
- .firewallType(in.getFirewallType()).isEnabled(in.isEnabled()).source(in.getSource())
- .destination(in.getDestination()).port(in.getPort()).policy(in.getPolicy()).description(in.getDescription())
- .isLogged(in.isLogged()).protocol(in.getProtocol());
- }
-
- @Override
- public Builder id(String id) {
- return Builder.class.cast(super.id(id));
- }
-
- @Override
- public Builder name(String name) {
- return Builder.class.cast(super.name(name));
- }
-
- @Override
- public Builder type(String type) {
- return Builder.class.cast(super.type(type));
- }
-
- @Override
- public Builder href(URI href) {
- return Builder.class.cast(super.href(href));
- }
-
- }
-
- private final String firewallType;
- private final boolean isEnabled;
- private final String source;
- private final String destination;
- private final String port;
- private final String policy;
- private final String description;
- private final boolean isLogged;
- private final String protocol;
-
- public FirewallRule(String id, String name, String type, URI href, String firewallType, boolean isEnabled,
- String source, String destination, String port, String policy, String description, boolean isLogged, String protocol) {
- super(id, name, type, href);
- this.firewallType = firewallType;
- this.isEnabled = isEnabled;
- this.source = source;
- this.destination = destination;
- this.port = port;
- this.policy = policy;
- this.description = description;
- this.isLogged = isLogged;
- this.protocol = protocol;
- }
-
- @Override
- public Builder toBuilder() {
- return Builder.fromFirewallRule(this);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(firewallType, isEnabled, source, destination,
- port, policy, description, isLogged, protocol);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!(obj instanceof FirewallRule))
- return false;
- FirewallRule other = (FirewallRule) obj;
- return Objects.equal(firewallType, other.firewallType) &&
- isEnabled == other.isEnabled &&
- Objects.equal(source, other.source) &&
- Objects.equal(destination, other.destination) &&
- Objects.equal(port, other.port) &&
- Objects.equal(policy, other.policy) &&
- Objects.equal(description, other.description) &&
- isLogged == other.isLogged &&
- Objects.equal(protocol, other.protocol);
- }
-
- public boolean isEnabled() {
- return isEnabled;
- }
-
- public String getSource() {
- return source;
- }
-
- public String getDestination() {
- return destination;
- }
-
- public String getFirewallType() {
- return firewallType;
- }
-
- public String getPort() {
- return port;
- }
-
- public String getPolicy() {
- return policy;
- }
-
- public String getDescription() {
- return description;
- }
-
- public boolean isLogged() {
- return isLogged;
- }
-
- public String getProtocol() {
- return protocol;
- }
-
- @Override
- public String toString() {
- return "[firewallType=" + firewallType + ", isEnabled=" + isEnabled + ", description=" + description + ", source=" + source + ", destination=" + destination
- + ", port=" + port + ", protocol=" + protocol + ", policy=" + policy + ", isLogged=" + isLogged;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/b91fd46c/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/FirewallService.java
----------------------------------------------------------------------
diff --git a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/FirewallService.java b/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/FirewallService.java
deleted file mode 100644
index 5e4a6d6..0000000
--- a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/FirewallService.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.savvis.vpdc.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-import java.util.Set;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-/**
- * API returns the firewall service containing firewall rules for a given VDC
- */
-public class FirewallService extends ResourceImpl {
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder extends ResourceImpl.Builder {
- private boolean isEnabled;
- private Set<FirewallRule> firewallRules = Sets.newLinkedHashSet();
-
- @Override
- public FirewallService build() {
- return new FirewallService(id, name, type, href, isEnabled, firewallRules);
- }
-
- public Builder isEnabled(boolean isEnabled) {
- this.isEnabled = isEnabled;
- return this;
- }
-
- public Builder firewallRule(FirewallRule in) {
- this.firewallRules.add(checkNotNull(in, "firewallRule"));
- return this;
- }
-
- public Builder firewallRules(Set<FirewallRule> firewallRules) {
- this.firewallRules.addAll(checkNotNull(firewallRules, "firewallRules"));
- return this;
- }
-
- public static Builder fromFirewallService(FirewallService in) {
- return new Builder().id(in.getId()).name(in.getName()).type(in.getType()).href(in.getHref())
- .isEnabled(in.isEnabled()).firewallRules(in.getFirewallRules());
- }
-
- @Override
- public Builder id(String id) {
- return Builder.class.cast(super.id(id));
- }
-
- @Override
- public Builder name(String name) {
- return Builder.class.cast(super.name(name));
- }
-
- @Override
- public Builder type(String type) {
- return Builder.class.cast(super.type(type));
- }
-
- @Override
- public Builder href(URI href) {
- return Builder.class.cast(super.href(href));
- }
-
- }
-
- private final boolean isEnabled;
- private final Set<FirewallRule> firewallRules;
-
- public FirewallService(String id, String name, String type, URI href, boolean isEnabled, Set<FirewallRule> firewallRules) {
- super(id, name, type, href);
- this.isEnabled = isEnabled;
- this.firewallRules = ImmutableSet.copyOf(checkNotNull(firewallRules, "firewallRules"));
- }
-
- @Override
- public Builder toBuilder() {
- return Builder.fromFirewallService(this);
- }
-
- public Set<FirewallRule> getFirewallRules() {
- return firewallRules;
- }
-
- public boolean isEnabled() {
- return isEnabled;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/b91fd46c/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Link.java
----------------------------------------------------------------------
diff --git a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Link.java b/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Link.java
deleted file mode 100644
index 81e091e..0000000
--- a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Link.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.savvis.vpdc.domain;
-
-import java.net.URI;
-
-/**
- * Location of a Rest resource
- */
-public class Link extends ResourceImpl {
- protected final String rel;
-
- public Link( String id,String name, String type, URI href, String rel) {
- super(id, name, type, href);
- this.rel = rel;
- }
-
- public String getRel() {
- return rel;
- }
-
- public int compareTo(Link that) {
- return (this == that) ? 0 : getHref().compareTo(that.getHref());
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((rel == null) ? 0 : rel.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- Link other = (Link) obj;
- if (rel == null) {
- if (other.rel != null)
- return false;
- } else if (!rel.equals(other.rel))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[id=" + id + ", href=" + href + ", name=" + name + ", type=" + type + ", rel=" + rel + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/b91fd46c/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Network.java
----------------------------------------------------------------------
diff --git a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Network.java b/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Network.java
deleted file mode 100644
index 44f408e..0000000
--- a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Network.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.savvis.vpdc.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-import java.util.Map;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Maps;
-
-/**
- * Various network features such NAT Public IP, Gateway and Netmask.
- */
-public class Network extends ResourceImpl {
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder extends ResourceImpl.Builder {
- private String gateway;
- private String netmask;
- private Map<String, String> internalToExternalNATRules = Maps.newLinkedHashMap();
-
- public Builder gateway(String gateway) {
- this.gateway = gateway;
- return this;
- }
-
- public Builder netmask(String netmask) {
- this.netmask = netmask;
- return this;
- }
-
- public Builder internalToExternalNATRule(String internalIP, String externalIP) {
- this.internalToExternalNATRules.put(checkNotNull(internalIP, "internalIP"),
- checkNotNull(externalIP, "externalIP"));
- return this;
- }
-
- public Builder internalToExternalNATRules(Map<String, String> internalToExternalNATRules) {
- this.internalToExternalNATRules.putAll(checkNotNull(internalToExternalNATRules, "internalToExternalNATRules"));
- return this;
- }
-
- @Override
- public Network build() {
- return new Network(id, name, type, href, gateway, netmask, internalToExternalNATRules);
- }
-
- public static Builder fromNetwork(Network in) {
- return new Builder().id(in.getId()).name(in.getName()).type(in.getType()).href(in.getHref())
- .gateway(in.getGateway()).internalToExternalNATRules(in.getInternalToExternalNATRules())
- .netmask(in.getNetmask());
- }
-
- @Override
- public Builder id(String id) {
- return Builder.class.cast(super.id(id));
- }
-
- @Override
- public Builder name(String name) {
- return Builder.class.cast(super.name(name));
- }
-
- @Override
- public Builder type(String type) {
- return Builder.class.cast(super.type(type));
- }
-
- @Override
- public Builder href(URI href) {
- return Builder.class.cast(super.href(href));
- }
-
- }
-
- @Nullable
- private final String gateway;
- private final String netmask;
- private final Map<String, String> internalToExternalNATRules;
-
- public Network(String id, String name, String type, URI href, @Nullable String gateway, String netmask,
- Map<String, String> internalToExternalNATRules) {
- super(id, name, type, href);
- this.gateway = gateway;
- this.netmask = netmask;
- this.internalToExternalNATRules = ImmutableMap.copyOf(checkNotNull(internalToExternalNATRules,
- "internalToExternalNATRules"));
- }
-
- /**
- * @return IP of the network's gateway
- */
- public String getGateway() {
- return gateway;
- }
-
- /**
- * @return IP of the network's netmask
- */
- public String getNetmask() {
- return netmask;
- }
-
- /**
- * @return map of internal to external ip when it has any nat1to1 enabled deployed VApp
- */
- public Map<String, String> getInternalToExternalNATRules() {
- return internalToExternalNATRules;
- }
-
- @Override
- public Builder toBuilder() {
- return Builder.fromNetwork(this);
- }
-
- @Override
- public String toString() {
- return "[id=" + id + ", href=" + href + ", name=" + name + ", type=" + type + ", gateway=" + gateway
- + ", netmask=" + netmask + ", internalToExternalNATRules=" + internalToExternalNATRules + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/b91fd46c/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/NetworkConfigSection.java
----------------------------------------------------------------------
diff --git a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/NetworkConfigSection.java b/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/NetworkConfigSection.java
deleted file mode 100644
index baf9e73..0000000
--- a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/NetworkConfigSection.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.savvis.vpdc.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Map;
-
-import org.jclouds.ovf.Section;
-
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Maps;
-
-public class NetworkConfigSection extends Section<NetworkConfigSection> {
-
- @SuppressWarnings("unchecked")
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder toBuilder() {
- return builder().fromNetworkConfigSection(this);
- }
-
- public static class Builder extends Section.Builder<NetworkConfigSection> {
- private String network;
- private String fenceMode;
- private Boolean dhcp;
- private String gateway;
- private String netmask;
- private Map<String, String> internalToExternalNATRules = Maps.newLinkedHashMap();
-
- public Builder network(String network) {
- this.network = network;
- return this;
- }
-
- public Builder fenceMode(String fenceMode) {
- this.fenceMode = fenceMode;
- return this;
- }
-
- public Builder dhcp(Boolean dhcp) {
- this.dhcp = dhcp;
- return this;
- }
-
- public Builder gateway(String gateway) {
- this.gateway = gateway;
- return this;
- }
-
- public Builder netmask(String netmask) {
- this.netmask = netmask;
- return this;
- }
-
- public Builder internalToExternalNATRule(String internalIP, String externalIP) {
- this.internalToExternalNATRules.put(checkNotNull(internalIP, "internalIP"), checkNotNull(externalIP,
- "externalIP"));
- return this;
- }
-
- public Builder internalToExternalNATRules(Map<String, String> internalToExternalNATRules) {
- this.internalToExternalNATRules.putAll(checkNotNull(internalToExternalNATRules, "internalToExternalNATRules"));
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public NetworkConfigSection build() {
- return new NetworkConfigSection(info, network, fenceMode, dhcp, gateway, netmask, internalToExternalNATRules);
- }
-
- public Builder fromNetworkConfigSection(NetworkConfigSection in) {
- return fromSection(in).network(in.getNetwork()).fenceMode(in.getFenceMode()).dhcp(in.getDhcp()).gateway(
- in.getGateway()).netmask(in.getNetmask()).internalToExternalNATRules(
- in.getInternalToExternalNATRules());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder fromSection(Section<NetworkConfigSection> in) {
- return Builder.class.cast(super.fromSection(in));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder info(String info) {
- return Builder.class.cast(super.info(info));
- }
-
- }
-
- private final String network;
- private final String fenceMode;
- private final Boolean dhcp;
- private final String gateway;
- private final String netmask;
- private final Map<String, String> internalToExternalNATRules;
-
- public NetworkConfigSection(String info, String network, String fenceMode, Boolean dhcp, String gateway,
- String netmask, Map<String, String> internalToExternalNATRules) {
- super(info);
- this.network = network;
- this.fenceMode = fenceMode;
- this.dhcp = dhcp;
- this.gateway = gateway;
- this.netmask = netmask;
- this.internalToExternalNATRules = ImmutableMap.copyOf(checkNotNull(internalToExternalNATRules,
- "internalToExternalNATRules"));
- }
-
- /**
- * @return IP of the network's gateway
- */
- public String getGateway() {
- return gateway;
- }
-
- /**
- * @return IP of the network's netmask
- */
- public String getNetmask() {
- return netmask;
- }
-
- /**
- * @return map of internal to external ip when it has any nat1to1 enabled deployed VApp
- */
- public Map<String, String> getInternalToExternalNATRules() {
- return internalToExternalNATRules;
- }
-
- public String getNetwork() {
- return network;
- }
-
- public String getFenceMode() {
- return fenceMode;
- }
-
- public Boolean getDhcp() {
- return dhcp;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((network == null) ? 0 : network.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- NetworkConfigSection other = (NetworkConfigSection) obj;
- if (network == null) {
- if (other.network != null)
- return false;
- } else if (!network.equals(other.network))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return String.format(
- "[info=%s, network=%s, dhcp=%s, fenceMode=%s, gateway=%s, internalToExternalNATRules=%s, netmask=%s]",
- info, network, dhcp, fenceMode, gateway, internalToExternalNATRules, netmask);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/b91fd46c/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/NetworkConnectionSection.java
----------------------------------------------------------------------
diff --git a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/NetworkConnectionSection.java b/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/NetworkConnectionSection.java
deleted file mode 100644
index 2200d92..0000000
--- a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/NetworkConnectionSection.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.savvis.vpdc.domain;
-
-import org.jclouds.ovf.Section;
-
-public class NetworkConnectionSection extends Section<NetworkConnectionSection> {
-
- @SuppressWarnings("unchecked")
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder toBuilder() {
- return builder().fromNetworkConnectionSection(this);
- }
-
- public static class Builder extends Section.Builder<NetworkConnectionSection> {
- private String network;
- private String ipAddress;
-
- public Builder network(String network) {
- this.network = network;
- return this;
- }
-
- public Builder ipAddress(String ipAddress) {
- this.ipAddress = ipAddress;
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public NetworkConnectionSection build() {
- return new NetworkConnectionSection(info, network, ipAddress);
- }
-
- public Builder fromNetworkConnectionSection(NetworkConnectionSection in) {
- return fromSection(in).network(in.getNetwork()).ipAddress(in.getIpAddress());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder fromSection(Section<NetworkConnectionSection> in) {
- return Builder.class.cast(super.fromSection(in));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder info(String info) {
- return Builder.class.cast(super.info(info));
- }
-
- }
-
- private final String network;
- private final String ipAddress;
-
- public NetworkConnectionSection(String info, String network, String ipAddress) {
- super(info);
- this.network = network;
- this.ipAddress = ipAddress;
- }
-
- public String getNetwork() {
- return network;
- }
-
- public String getIpAddress() {
- return ipAddress;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((network == null) ? 0 : network.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- NetworkConnectionSection other = (NetworkConnectionSection) obj;
- if (network == null) {
- if (other.network != null)
- return false;
- } else if (!network.equals(other.network))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return String.format("[info=%s, network=%s, ipAddress=%s]", info, network, ipAddress);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/b91fd46c/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Org.java
----------------------------------------------------------------------
diff --git a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Org.java b/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Org.java
deleted file mode 100644
index de2b0bb..0000000
--- a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Org.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.savvis.vpdc.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-/**
- * A cloud can contain one or more Organizations. There are two types of Organizations, hard-walled
- * and soft-walled.
- * <ul>
- * <li>A hard-walled Organization provides a secure environment for a single tenant of a
- * multi-tenant cloud.All resources in a hard-walled Organization are isolated from other
- * Organizations, hard- or soft-walled,in the cloud.</li>
- * <li>A soft-walled Organization supports access, by users who have appropriate privileges, to
- * other soft-walled Organizations in a cloud. Soft-walled Organizations have boundaries similar to
- * those that separate departments of a corporate entity. In such environments, the Organization
- * controls the resources owned by a single department. Most users are restricted to the resources
- * available in a single Organization but a few might have privileges in other Organizations, if
- * allowed by the administrators of those Organizations.</li>
- * </ul>
- */
-public class Org extends ResourceImpl {
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder extends ResourceImpl.Builder {
- private String description;
- private Set<Link> vDCs = Sets.newLinkedHashSet();
- private Set<Link> images = Sets.newLinkedHashSet();
-
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- public Builder vDC(Link vDC) {
- this.vDCs.add(checkNotNull(vDC, "vDC"));
- return this;
- }
-
- public Builder vDCs(Set<Link> vDCs) {
- this.vDCs.addAll(checkNotNull(vDCs, "vDCs"));
- return this;
- }
-
- public Builder image(Link image) {
- this.images.add(checkNotNull(image, "image"));
- return this;
- }
-
- public Builder images(Set<Link> images) {
- this.images.addAll(checkNotNull(images, "images"));
- return this;
- }
-
- @Override
- public Org build() {
- return new Org(id, name, type, href, description, vDCs, images);
- }
-
- public static Builder fromOrg(Org in) {
- return new Builder().id(in.getId()).name(in.getName()).type(in.getType()).href(in.getHref())
- .description(in.getDescription()).images(in.getImages()).vDCs(in.getVDCs());
- }
-
- @Override
- public Builder id(String id) {
- return Builder.class.cast(super.id(id));
- }
-
- @Override
- public Builder name(String name) {
- return Builder.class.cast(super.name(name));
- }
-
- @Override
- public Builder type(String type) {
- return Builder.class.cast(super.type(type));
- }
-
- @Override
- public Builder href(URI href) {
- return Builder.class.cast(super.href(href));
- }
-
- }
-
- @Nullable
- private final String description;
- private final Set<Link> vDCs;
- private final Set<Link> images;
-
- public Org(String id, String name, String type, URI href, @Nullable String description, Set<Link> vDCs,
- Set<Link> images) {
- super(id, name, type, href);
- this.description = description;
- this.vDCs = ImmutableSet.copyOf(checkNotNull(vDCs, "vDCs"));
- this.images = ImmutableSet.copyOf(checkNotNull(images, "images"));
- }
-
- /**
- * {@inheritDoc}
- */
- public String getName() {
- return name;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * {@inheritDoc}
- */
- public Set<Link> getVDCs() {
- return vDCs;
- }
-
- /**
- * {@inheritDoc}
- */
- public Set<Link> getImages() {
- return images;
- }
-
- @Override
- public Builder toBuilder() {
- return Builder.fromOrg(this);
- }
-
- @Override
- public String toString() {
- return "[id=" + id + ", href=" + href + ", name=" + name + ", type=" + type + ", description=" + description
- + ", vDCs=" + vDCs + ", images=" + images + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/b91fd46c/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Resource.java
----------------------------------------------------------------------
diff --git a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Resource.java b/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Resource.java
deleted file mode 100644
index 6dec857..0000000
--- a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Resource.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.savvis.vpdc.domain;
-
-import java.net.URI;
-
-/**
- * Location of a Rest resource
- */
-public interface Resource extends Comparable<Resource> {
-
- String getId();
-
- String getName();
-
- String getType();
-
- URI getHref();
-
- int compareTo(Resource that);
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/b91fd46c/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/ResourceImpl.java
----------------------------------------------------------------------
diff --git a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/ResourceImpl.java b/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/ResourceImpl.java
deleted file mode 100644
index 2aeb750..0000000
--- a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/ResourceImpl.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.savvis.vpdc.domain;
-
-import java.net.URI;
-
-/**
- * Location of a Rest resource
- */
-public class ResourceImpl implements Resource {
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- protected String id;
- protected String name;
- protected String type;
- protected URI href;
-
- public Builder id(String id) {
- this.id = id;
- return this;
- }
-
- public Builder name(String name) {
- this.name = name;
- return this;
- }
-
- public Builder type(String type) {
- this.type = type;
- return this;
- }
-
- public Builder href(URI href) {
- this.href = href;
- return this;
- }
-
- public ResourceImpl build() {
- return new ResourceImpl(id, name, type, href);
- }
-
- public static Builder fromResource(ResourceImpl in) {
- return new Builder().id(in.getId()).name(in.getName()).type(in.getType()).href(in.getHref());
- }
- }
-
- protected final String id;
- protected final String name;
- protected final String type;
- protected final URI href;
-
- public ResourceImpl(String id, String name, String type, URI href) {
- this.id = id;
- this.name = name;
- this.type = type;
- this.href = href;
- }
-
- public String getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- public String getType() {
- return type;
- }
-
- public URI getHref() {
- return href;
- }
-
- public int compareTo(Resource that) {
- return (this == that) ? 0 : getHref().compareTo(that.getHref());
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((href == null) ? 0 : href.hashCode());
- result = prime * result + ((id == null) ? 0 : id.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((type == null) ? 0 : type.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- ResourceImpl other = (ResourceImpl) obj;
- if (href == null) {
- if (other.href != null)
- return false;
- } else if (!href.equals(other.href))
- return false;
- if (id == null) {
- if (other.id != null)
- return false;
- } else if (!id.equals(other.id))
- return false;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- if (type == null) {
- if (other.type != null)
- return false;
- } else if (!type.equals(other.type))
- return false;
- return true;
- }
-
- public Builder toBuilder() {
- return Builder.fromResource(this);
- }
-
- @Override
- public String toString() {
- return "[id=" + id + ", href=" + href + ", name=" + name + ", type=" + type + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/b91fd46c/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Task.java
----------------------------------------------------------------------
diff --git a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Task.java b/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Task.java
deleted file mode 100644
index 6844134..0000000
--- a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/Task.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.savvis.vpdc.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-import java.util.Date;
-
-import org.jclouds.javax.annotation.Nullable;
-
-/**
- * The result of a api request cannot be returned immediately, the server creates a task entity
- * and returns its URL to the api. The api can use this URL in a subsequent GET request to
- * obtain the current status of the task.
- *
- * @see <a href="https://api.sandbox.savvis.net/doc/spec/api/getTask.html" />
- */
-public class Task extends ResourceImpl {
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder extends ResourceImpl.Builder {
- private Status status;
- private Date startTime;
- private Date endTime;
- private Resource owner;
- private Resource result;
- private TaskError error;
-
- public Builder status(Status status) {
- this.status = status;
- return this;
- }
-
- public Builder startTime(Date startTime) {
- this.startTime = startTime;
- return this;
- }
-
- public Builder endTime(Date endTime) {
- this.endTime = endTime;
- return this;
- }
-
- public Builder owner(Resource owner) {
- this.owner = owner;
- return this;
- }
-
- public Builder result(Resource result) {
- this.result = result;
- return this;
- }
-
- public Builder error(TaskError error) {
- this.error = error;
- return this;
- }
-
- @Override
- public Builder id(String id) {
- return Builder.class.cast(super.id(id));
- }
-
- @Override
- public Builder name(String name) {
- return Builder.class.cast(super.name(name));
- }
-
- @Override
- public Builder type(String type) {
- return Builder.class.cast(super.type(type));
- }
-
- @Override
- public Builder href(URI href) {
- return Builder.class.cast(super.href(href));
- }
-
- @Override
- public Task build() {
- return new Task(id, name, type, href, status, startTime, endTime, owner, result, error);
- }
-
- public static Builder fromTask(Task in) {
- return new Builder().id(in.getId()).name(in.getName()).type(in.getType()).href(in.getHref())
- .status(in.getStatus()).startTime(in.getStartTime()).endTime(in.getEndTime()).owner(in.getOwner())
- .error(in.getError()).result(in.getResult());
- }
- }
-
- public enum Status {
- /**
- * Savvis VPDC successfully provisioned and available for use.
- */
- SUCCESS,
- /**
- * Savvis VPDC is processing the user request, please wait for the provisioning process to
- * complete.
- */
- RUNNING,
-
- /**
- * Savvis VPDC is processing the user request, please wait for the provisioning process to
- * complete.
- */
- QUEUED,
- /**
- * Savvis VPDC is failed, please kindly contact Savvis administrator for further
- * clarification/assistance with the respective request data.
- */
- ERROR,
- /**
- * Unexpected Savvus VPDC Status, Savvis VPDC is failed, please kindly contact Savvis
- * administrator for further clarification/assistance with the respective request data.
- */
- NONE, UNRECOGNIZED;
- public String value() {
- return name().toLowerCase();
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static Status fromValue(String status) {
- try {
- return valueOf(checkNotNull(status, "status").toUpperCase());
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
- }
-
- private final Status status;
- private final Date startTime;
- private final Date endTime;
- private final Resource owner;
- private final Resource result;
- private final TaskError error;
-
- public Task(String id, String name, String type, URI href, Status status, Date startTime, Date endTime,
- Resource result, Resource owner, TaskError error) {
- super(id, name, type, href);
- this.status = status;
- this.startTime = startTime;
- this.endTime = endTime;
- this.owner = owner;
- this.result = result;
- this.error = error;
- }
-
- /**
- * The current status of the task.
- */
- public Status getStatus() {
- return status;
- }
-
- /**
- * date and time when the task was started.
- */
- public Date getStartTime() {
- return startTime;
- }
-
- /**
- * date and time when the task completed. Does not appear for running tasks.
- */
- @Nullable
- public Date getEndTime() {
- return endTime;
- }
-
- /**
- * A link to the object that owns the task. For copy operations, the owner is the copy that is
- * being created. For delete operations, the owner is the deleted object, so this element is not
- * included. For all other operations, the owner is the object to which the request was made.
- */
- @Nullable
- public Resource getOwner() {
- return owner;
- }
-
- /**
- * Result is represent outcome of request url. if any VM related operation, the result will
- * present as get VApp. if any VMDK related operation, the result will present as get VMKD
- */
- @Nullable
- public Resource getResult() {
- return result;
- }
-
- /**
- * error message or related information returned by the task
- */
- @Nullable
- public TaskError getError() {
- return error;
- }
-
- public Builder toBuilder() {
- return Builder.fromTask(this);
- }
-
- @Override
- public String toString() {
- return "[id=" + id + ", name=" + name + ", type=" + type + ", href=" + href + ", status=" + status
- + ", startTime=" + startTime + ", endTime=" + endTime + ", owner=" + owner + ", result=" + result
- + ", error=" + error + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/b91fd46c/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/TaskError.java
----------------------------------------------------------------------
diff --git a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/TaskError.java b/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/TaskError.java
deleted file mode 100644
index b222464..0000000
--- a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/TaskError.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.savvis.vpdc.domain;
-
-import org.jclouds.javax.annotation.Nullable;
-
-public class TaskError {
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
-
- private String message;
- private int majorErrorCode = -1;
- private int minorErrorCode = -1;
- private String vendorSpecificErrorCode;
-
- public Builder message(String message) {
- this.message = message;
- return this;
- }
-
- public Builder majorErrorCode(int majorErrorCode) {
- this.majorErrorCode = majorErrorCode;
- return this;
- }
-
- public Builder minorErrorCode(int minorErrorCode) {
- this.minorErrorCode = minorErrorCode;
- return this;
- }
-
- public Builder vendorSpecificErrorCode(String vendorSpecificErrorCode) {
- this.vendorSpecificErrorCode = vendorSpecificErrorCode;
- return this;
- }
-
- public TaskError build() {
- return new TaskError(message, majorErrorCode, minorErrorCode, vendorSpecificErrorCode);
- }
- }
-
- private final String message;
- private final int majorErrorCode;
- private final int minorErrorCode;
- private final String vendorSpecificErrorCode;
-
- public TaskError(String message, int majorErrorCode, int minorErrorCode, @Nullable String vendorSpecificErrorCode) {
- this.message = message;
- this.majorErrorCode = majorErrorCode;
- this.minorErrorCode = minorErrorCode;
- this.vendorSpecificErrorCode = vendorSpecificErrorCode;
- }
-
- /**
- *
- * @return message describing the error
- */
- public String getMessage() {
- return message;
- }
-
- /**
- *
- * @return matches the HTTP status code
- */
- public int getMajorErrorCode() {
- return majorErrorCode;
- }
-
- /**
- *
- * @return matches the minor code, typically -1
- */
- public int getMinorErrorCode() {
- return minorErrorCode;
- }
-
- /**
- *
- * @return optional additional information about the source of the error
- */
- @Nullable
- public String getVendorSpecificErrorCode() {
- return vendorSpecificErrorCode;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + majorErrorCode;
- result = prime * result + ((message == null) ? 0 : message.hashCode());
- result = prime * result + minorErrorCode;
- result = prime * result + ((vendorSpecificErrorCode == null) ? 0 : vendorSpecificErrorCode.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- TaskError other = (TaskError) obj;
- if (majorErrorCode != other.majorErrorCode)
- return false;
- if (message == null) {
- if (other.message != null)
- return false;
- } else if (!message.equals(other.message))
- return false;
- if (minorErrorCode != other.minorErrorCode)
- return false;
- if (vendorSpecificErrorCode == null) {
- if (other.vendorSpecificErrorCode != null)
- return false;
- } else if (!vendorSpecificErrorCode.equals(other.vendorSpecificErrorCode))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[message=" + message + ", majorErrorCode=" + majorErrorCode + ", minorErrorCode=" + minorErrorCode
- + ", vendorSpecificErrorCode=" + vendorSpecificErrorCode + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/b91fd46c/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/VDC.java
----------------------------------------------------------------------
diff --git a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/VDC.java b/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/VDC.java
deleted file mode 100644
index 0021dc2..0000000
--- a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/VDC.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.savvis.vpdc.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.base.CaseFormat;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-/**
- * VDC is a virtual data center ,the API returns a list of VAPPs own by given bill site Id.
- */
-public class VDC extends ResourceImpl {
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder extends ResourceImpl.Builder {
- private String description;
- private Status status;
- private Set<Resource> resourceEntities = Sets.newLinkedHashSet();
- private Set<Resource> availableNetworks = Sets.newLinkedHashSet();
-
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- public Builder status(Status status) {
- this.status = status;
- return this;
- }
-
- public Builder resourceEntity(Resource resourceEntity) {
- this.resourceEntities.add(checkNotNull(resourceEntity, "resourceEntity"));
- return this;
- }
-
- public Builder resourceEntities(Set<Resource> resourceEntities) {
- this.resourceEntities.addAll(checkNotNull(resourceEntities, "resourceEntities"));
- return this;
- }
-
- public Builder availableNetwork(Resource availableNetwork) {
- this.availableNetworks.add(checkNotNull(availableNetwork, "availableNetwork"));
- return this;
- }
-
- public Builder availableNetworks(Set<Resource> availableNetworks) {
- this.availableNetworks.addAll(checkNotNull(availableNetworks, "availableNetworks"));
- return this;
- }
-
- @Override
- public VDC build() {
- return new VDC(id, name, type, href, description, status, resourceEntities, availableNetworks);
- }
-
- public static Builder fromVDC(VDC in) {
- return new Builder().id(in.getId()).name(in.getName()).type(in.getType()).href(in.getHref())
- .status(in.getStatus()).description(in.getDescription()).availableNetworks(in.getAvailableNetworks())
- .resourceEntities(in.getResourceEntities());
- }
-
- @Override
- public Builder id(String id) {
- return Builder.class.cast(super.id(id));
- }
-
- @Override
- public Builder name(String name) {
- return Builder.class.cast(super.name(name));
- }
-
- @Override
- public Builder type(String type) {
- return Builder.class.cast(super.type(type));
- }
-
- @Override
- public Builder href(URI href) {
- return Builder.class.cast(super.href(href));
- }
-
- }
-
- public enum Status {
- /**
- * Savvis VPDC successfully provisioned and available for use
- */
- DEPLOYED,
- /**
- * Savvis VPDC need to be provisioned and cannot invoke any of the VCloud (post request method
- * type) API's
- */
- DESIGNING,
- /**
- * Savvis VPDC need to be provisioned and cannot invoke any of the VCloud (post request method
- * type) API's
- */
- SAVED,
- /**
- * Please wait for the provisioning process to complete and cannot invoke any of the VCloud
- * (post request method type) API's
- */
- INQUEUE,
- /**
- * Please wait for the provisioning process to complete and cannot invoke any of the VCloud
- * (post request method type) API's
- */
- PROVISIONING,
- /**
- * Please kindly contact Savvis administrator for further clarification/assistance with the
- * respective request data. and cannot invoke any of the VCloud (post request method type)
- * API's
- */
- PARTIALLY_DEPLOYED,
- /**
- * Please kindly contact Savvis administrator for further clarification/assistance with the
- * respective request data and cannot invoke any of the VCloud (post request method type)
- * API's
- */
- FAILED, UNRECOGNIZED;
- @Override
- public String toString() {
- return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name());
- }
-
- public static Status fromValue(String status) {
- try {
- return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(status, "status")));
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
- }
-
- @Nullable
- private final String description;
- private final VDC.Status status;
- private final Set<Resource> resourceEntities;
- private final Set<Resource> availableNetworks;
-
- public VDC(String id, String name, String type, URI href, @Nullable String description, VDC.Status status,
- Set<Resource> resourceEntities, Set<Resource> availableNetworks) {
- super(id, name, type, href);
- this.description = description;
- this.status = checkNotNull(status, "status");
- this.resourceEntities = ImmutableSet.copyOf(checkNotNull(resourceEntities, "resourceEntities"));
- this.availableNetworks = ImmutableSet.copyOf(checkNotNull(availableNetworks, "availableNetworks"));
- }
-
- /**
- * {@inheritDoc}
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * {@inheritDoc}
- */
- public VDC.Status getStatus() {
- return status;
- }
-
- /**
- * {@inheritDoc}
- */
- public Set<Resource> getResourceEntities() {
- return resourceEntities;
- }
-
- /**
- * {@inheritDoc}
- */
- public Set<Resource> getAvailableNetworks() {
- return availableNetworks;
- }
-
- @Override
- public Builder toBuilder() {
- return Builder.fromVDC(this);
- }
-
- @Override
- public String toString() {
- return "[id=" + id + ", href=" + href + ", name=" + name + ", type=" + type + ", description=" + description
- + ", status=" + status + ", resourceEntities=" + resourceEntities + ", availableNetworks="
- + availableNetworks + "]";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/b91fd46c/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/VM.java
----------------------------------------------------------------------
diff --git a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/VM.java b/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/VM.java
deleted file mode 100644
index 1f56703..0000000
--- a/savvis-symphonyvpdc/src/main/java/org/jclouds/savvis/vpdc/domain/VM.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.savvis.vpdc.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-import java.util.Set;
-
-import org.jclouds.ovf.NetworkSection;
-import org.jclouds.ovf.OperatingSystemSection;
-import org.jclouds.ovf.ProductSection;
-import org.jclouds.ovf.Section;
-import org.jclouds.ovf.VirtualHardwareSection;
-import org.jclouds.ovf.internal.BaseVirtualSystem;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Multimap;
-import com.google.common.collect.Sets;
-
-/**
- * A virtual application (vApp) is a software solution, packaged in OVF containing one or more
- * virtual machines. A vApp can be authored by Developers at ISVs and VARs or by IT Administrators
- * in Enterprises and Service Providers.
- */
-public class VM extends BaseVirtualSystem<VM> implements Resource {
- /**
- * Objects such as vAppTemplate, vApp, and Vm have a status attribute whose value indicates the
- * state of the object. Status for an object, such as a vAppTemplate or vApp, whose Children (Vm
- * objects) each have a status of their own, is computed from the status of the Children.
- *
- * <h2>NOTE</h2>
- * <p/>
- * The deployment status of an object is indicated by the value of its deployed attribute.
- *
- * @since vcloud api 0.8
- *
- */
- public enum Status {
-
- /**
- * When the VM is in Designing,Saved,Inqueue, has issue in pre provisioning or any exception
- * cases. VM is not in Savvis VPDC (may the VM has been removed) or cannot get VM state due to
- * unknown exception
- */
- UNRESOLVED,
- /**
- * When the Savvis VPDC is in Provisioning, PartiallyDeployed, Failed and the VM failed in
- * provisioning or pending infrastructure notification
- */
- RESOLVED,
- /**
- * When the VM is deployed in vmware and powered off.
- */
- OFF,
- /**
- * We do not support suspended state.
- */
- SUSPENDED,
- /**
- * When the VM is deployed in vmware and powered on.
- */
- ON,
- /**
- * The VM is deployed in vmware but the state of VM may be Uninitialized, Start, Stop, Resume,
- * Reset, RebootGuest, Error, Failed, Unknown, PoweringOn, PoweringOff, Suspending, Stopping,
- * Starting, Resetting, RebootingGuest. Please call back the Get VApp Power State API after
- * few minute.
- */
- UNKNOWN, UNRECOGNIZED;
-
- public String value() {
- switch (this) {
- case UNRESOLVED:
- return "0";
- case RESOLVED:
- return "1";
- case OFF:
- return "2";
- case SUSPENDED:
- return "3";
- case ON:
- return "4";
- case UNKNOWN:
- return "5";
- default:
- return "UNRECOGNIZED";
- }
- }
-
- public static Status fromValue(String status) {
- try {
- return fromValue(Integer.parseInt(checkNotNull(status, "status")));
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
- public static Status fromValue(int v) {
- switch (v) {
- case 0:
- return UNRESOLVED;
- case 1:
- return RESOLVED;
- case 2:
- return OFF;
- case 3:
- return SUSPENDED;
- case 4:
- return ON;
- case 5:
- return UNKNOWN;
- default:
- return UNRECOGNIZED;
- }
- }
-
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder extends BaseVirtualSystem.Builder<VM> {
- protected String type;
- protected URI href;
- protected Status status;
- protected NetworkSection networkSection;
- protected Set<NetworkConfigSection> networkConfigSections = Sets.newLinkedHashSet();
- protected Set<NetworkConnectionSection> networkConnectionSections = Sets.newLinkedHashSet();
-
- public Builder id(String id) {
- this.id = id;
- return this;
- }
-
- public Builder name(String name) {
- this.name = name;
- return this;
- }
-
- public Builder type(String type) {
- this.type = type;
- return this;
- }
-
- public Builder href(URI href) {
- this.href = href;
- return this;
- }
-
- public Builder status(Status status) {
- this.status = status;
- return this;
- }
-
- public Builder networkSection(NetworkSection networkSection) {
- this.networkSection = networkSection;
- return this;
- }
-
- /**
- * @see VM#getNetworkConfigSections
- */
- public Builder networkConfigSection(NetworkConfigSection networkConfigSection) {
- this.networkConfigSections.add(checkNotNull(networkConfigSection, "networkConfigSection"));
- return this;
- }
-
- /**
- * @see VM#getNetworkConfigSections
- */
- public Builder networkConfigSections(Iterable<NetworkConfigSection> networkConfigSections) {
- this.networkConfigSections = ImmutableSet.<NetworkConfigSection> copyOf(checkNotNull(networkConfigSections,
- "networkConfigSections"));
- return this;
- }
-
- /**
- * @see VM#getNetworkConnectionSections
- */
- public Builder networkConnectionSection(NetworkConnectionSection networkConnectionSection) {
- this.networkConnectionSections.add(checkNotNull(networkConnectionSection, "networkConnectionSection"));
- return this;
- }
-
- /**
- * @see VM#getNetworkConnectionSections
- */
- public Builder networkConnectionSections(Iterable<NetworkConnectionSection> networkConnectionSections) {
- this.networkConnectionSections = ImmutableSet.<NetworkConnectionSection> copyOf(checkNotNull(
- networkConnectionSections, "networkConnectionSections"));
- return this;
- }
-
- @Override
- public VM build() {
- return new VM(id, info, name, operatingSystem, virtualHardwareSections, productSections, additionalSections, type,
- href, status, networkSection, networkConfigSections, networkConnectionSections);
- }
-
- public Builder fromVM(VM in) {
- return fromVirtualSystem(in).type(in.getType()).href(in.getHref()).status(in.getStatus()).networkSection(
- in.getNetworkSection()).networkConfigSections(in.getNetworkConfigSections())
- .networkConnectionSections(in.getNetworkConnectionSections());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder additionalSection(String name, Section additionalSection) {
- return Builder.class.cast(super.additionalSection(name, additionalSection));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder additionalSections(Multimap<String, Section> additionalSections) {
- return Builder.class.cast(super.additionalSections(additionalSections));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder fromSection(Section<VM> in) {
- return Builder.class.cast(super.fromSection(in));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder fromVirtualSystem(BaseVirtualSystem<VM> in) {
- return Builder.class.cast(super.fromVirtualSystem(in));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder virtualHardwareSection(VirtualHardwareSection virtualHardwareSection) {
- return Builder.class.cast(super.virtualHardwareSection(virtualHardwareSection));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder virtualHardwareSections(Iterable<? extends VirtualHardwareSection> virtualHardwareSections) {
- return Builder.class.cast(super.virtualHardwareSections(virtualHardwareSections));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder info(String info) {
- return Builder.class.cast(super.info(info));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder operatingSystemSection(OperatingSystemSection operatingSystem) {
- return Builder.class.cast(super.operatingSystemSection(operatingSystem));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder productSection(ProductSection productSection) {
- return Builder.class.cast(super.productSection(productSection));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder productSections(Iterable<? extends ProductSection> productSections) {
- return Builder.class.cast(super.productSections(productSections));
- }
- }
-
- protected final String type;
- protected final URI href;
- protected final Status status;
- protected final NetworkSection networkSection;
- protected final Set<NetworkConfigSection> networkConfigSections;
- protected final Set<NetworkConnectionSection> networkConnectionSections;
-
- public VM(String id, String info, String name, OperatingSystemSection operatingSystem,
- Iterable<? extends VirtualHardwareSection> virtualHardwareSections,
- Iterable<? extends ProductSection> productSections, Multimap<String, Section> additionalSections,
- String type, URI href, Status status, NetworkSection networkSection,
- Iterable<NetworkConfigSection> networkConfigSections,
- Iterable<NetworkConnectionSection> networkConnectionSections) {
- super(id, info, name, operatingSystem, virtualHardwareSections, productSections, additionalSections);
- this.type = type;
- this.href = href;
- this.status = status;
- this.networkSection = networkSection;
- this.networkConfigSections = ImmutableSet.copyOf(checkNotNull(networkConfigSections, "networkConfigSections"));
- this.networkConnectionSections = ImmutableSet.copyOf(checkNotNull(networkConnectionSections,
- "networkConnectionSections"));
- }
-
- public Status getStatus() {
- return status;
- }
-
- public NetworkSection getNetworkSection() {
- return networkSection;
- }
-
- public Set<NetworkConfigSection> getNetworkConfigSections() {
- return networkConfigSections;
- }
-
- public Set<NetworkConnectionSection> getNetworkConnectionSections() {
- return networkConnectionSections;
- }
-
- public String getType() {
- return type;
- }
-
- public URI getHref() {
- return href;
- }
-
- @Override
- public String toString() {
- return String
- .format(
- "[id=%s, name=%s, info=%s, href=%s,status=%s, type=%s, virtualHardwareSections=%s, operatingSystem=%s, productSections=%s, networkSection=%s, networkConfigSections=%s, networkConnectionSections=%s, additionalSections=%s]",
- id, name, info, href, status, type, virtualHardwareSections, operatingSystem, productSections,
- networkSection, networkConfigSections, networkConnectionSections, additionalSections);
- }
-
- @Override
- public int compareTo(Resource that) {
- return (this == that) ? 0 : getHref().compareTo(that.getHref());
- }
-
- public Builder toBuilder() {
- return builder().fromVM(this);
- }
-
-}