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/24 06:10:40 UTC
[7/8] JCLOUDS-757 drop fgcp provider.
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/ResourceIdToSystemId.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/ResourceIdToSystemId.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/ResourceIdToSystemId.java
deleted file mode 100644
index 12c3918..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/ResourceIdToSystemId.java
+++ /dev/null
@@ -1,48 +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.fujitsu.fgcp.compute.functions;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.inject.Singleton;
-
-import com.google.common.base.Function;
-
-/**
- * Determines the id of the virtual system that a server, load balancer or disk
- * is part of.
- */
-@Singleton
-public class ResourceIdToSystemId implements Function<String, String> {
-
- @Override
- public String apply(String id) {
- checkNotNull(id, "resource id");
-
- Pattern pattern = Pattern.compile("^(\\w+-\\w+)\\b.*");
- Matcher matcher = pattern.matcher((String) id);
-
- checkArgument(matcher.find(),
- "no valid resource id found: " + id.toString());
-
- return matcher.group(1);
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/ServerTypeToHardware.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/ServerTypeToHardware.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/ServerTypeToHardware.java
deleted file mode 100644
index 9f2e327..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/ServerTypeToHardware.java
+++ /dev/null
@@ -1,64 +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.fujitsu.fgcp.compute.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.HardwareBuilder;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.fujitsu.fgcp.domain.ServerType;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterables;
-
-/**
- * Created by IntelliJ IDEA.
- */
-@Singleton
-public class ServerTypeToHardware implements Function<ServerType, Hardware> {
- private final CPUToProcessor cpuToProcessor;
- private final DiskToVolume diskToVolume;
-
- @Inject
- public ServerTypeToHardware(CPUToProcessor cpuToProcessor,
- DiskToVolume diskToVolume) {
- this.cpuToProcessor = checkNotNull(cpuToProcessor);
- this.diskToVolume = checkNotNull(diskToVolume);
- }
-
- @Override
- public Hardware apply(ServerType from) {
- checkNotNull(from, "ServerType");
- HardwareBuilder builder = new HardwareBuilder();
-
- builder.ids(from.getId());
- builder.name(from.getName());
- builder.ram((int) (1000d * Double.valueOf(from.getMemory().getSize())));
- builder.processor(cpuToProcessor.apply(from.getCpu()));
- builder.supportsImage(Predicates.<Image> alwaysTrue());
- // all servers are 64bit. The OS however may be 32 bit.
- builder.is64Bit(true);
- builder.volumes(Iterables.transform(from.getDisks(), diskToVolume));
-
- return builder.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/SingleElementResponseToElement.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/SingleElementResponseToElement.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/SingleElementResponseToElement.java
deleted file mode 100644
index a2e9872..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/SingleElementResponseToElement.java
+++ /dev/null
@@ -1,32 +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.fujitsu.fgcp.compute.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.fujitsu.fgcp.xml.internal.SingleElementResponse;
-
-import com.google.common.base.Function;
-
-public class SingleElementResponseToElement implements
- Function<SingleElementResponse, Object> {
-
- @Override
- public Object apply(SingleElementResponse r) {
- return checkNotNull(r, "response").getElement();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/VServerMetadataToNodeMetadata.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/VServerMetadataToNodeMetadata.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/VServerMetadataToNodeMetadata.java
deleted file mode 100644
index cd06717..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/functions/VServerMetadataToNodeMetadata.java
+++ /dev/null
@@ -1,240 +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.fujitsu.fgcp.compute.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
-import javax.annotation.Resource;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.jclouds.collect.Memoized;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.NodeMetadata.Status;
-import org.jclouds.compute.domain.NodeMetadataBuilder;
-import org.jclouds.compute.functions.GroupNamingConvention;
-import org.jclouds.compute.reference.ComputeServiceConstants;
-import org.jclouds.domain.Location;
-import org.jclouds.domain.LoginCredentials;
-import org.jclouds.fujitsu.fgcp.compute.strategy.VServerMetadata;
-import org.jclouds.fujitsu.fgcp.domain.VServer;
-import org.jclouds.fujitsu.fgcp.domain.VServerStatus;
-import org.jclouds.fujitsu.fgcp.domain.VServerWithVNICs;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.base.Supplier;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
-@Singleton
-public class VServerMetadataToNodeMetadata implements
- Function<VServerMetadata, NodeMetadata> {
-
- public static final Map<VServerStatus, Status> vServerToStatus = ImmutableMap
- .<VServerStatus, Status> builder()
- .put(VServerStatus.DEPLOYING, Status.PENDING)
- .put(VServerStatus.RUNNING, Status.RUNNING)
- .put(VServerStatus.STOPPING, Status.PENDING)
- .put(VServerStatus.STOPPED, Status.SUSPENDED)
- .put(VServerStatus.STARTING, Status.PENDING)
- .put(VServerStatus.FAILOVER, Status.RUNNING)
- .put(VServerStatus.UNEXPECTED_STOP, Status.SUSPENDED)
- .put(VServerStatus.RESTORING, Status.PENDING)
- .put(VServerStatus.BACKUP_ING, Status.PENDING)
- .put(VServerStatus.ERROR, Status.ERROR)
- .put(VServerStatus.START_ERROR, Status.ERROR)
- .put(VServerStatus.STOP_ERROR, Status.ERROR)
- .put(VServerStatus.CHANGE_TYPE, Status.PENDING)
- .put(VServerStatus.REGISTERING, Status.PENDING)
- .put(VServerStatus.UNRECOGNIZED, Status.UNRECOGNIZED).build();
-
- @Resource
- @Named(ComputeServiceConstants.COMPUTE_LOGGER)
- protected Logger logger = Logger.NULL;
-
- protected final Supplier<Set<? extends Location>> locations;
- protected final Supplier<Set<? extends Image>> images;
- protected final Supplier<Set<? extends Hardware>> hardwares;
- protected final GroupNamingConvention nodeNamingConvention;
-
- private static class FindImageForVServer implements Predicate<Image> {
- private final VServer server;
-
- private FindImageForVServer(VServer server) {
- this.server = server;
- }
-
- @Override
- public boolean apply(Image input) {
- return input.getId().equals(server.getDiskimageId());
- }
- }
-
- protected Image parseImage(VServer from) {
- try {
- return Iterables.find(images.get(), new FindImageForVServer(from));
- } catch (NoSuchElementException e) {
- logger.warn("could not find a matching image for server %s", from);
- }
- return null;
- }
-
- private static class FindHardwareForServerType implements
- Predicate<Hardware> {
- private final String type;
-
- private FindHardwareForServerType(String type) {
- this.type = type;
- }
-
- @Override
- public boolean apply(Hardware input) {
- return input.getName().equals(type);
- }
- }
-
- protected Hardware parseHardware(String from) {
- try {
- return Iterables.find(hardwares.get(),
- new FindHardwareForServerType(from));
- } catch (NoSuchElementException e) {
- logger.warn(
- "could not find a matching hardware for server type %s",
- from);
- }
- return null;
- }
-
- private static class FindLocationForVServer implements Predicate<Location> {
- private final VServerWithVNICs server;
-
- private FindLocationForVServer(VServerWithVNICs server) {
- this.server = server;
- }
-
- @Override
- public boolean apply(Location input) {
- return input.getId().equals(
- Iterables.getLast(server.getVnics()).getNetworkId());
- }
- }
-
- protected Location parseLocation(VServerWithVNICs from) {
- try {
- return Iterables.find(locations.get(), new FindLocationForVServer(
- from));
- } catch (NoSuchElementException e) {
- logger.warn("could not find a matching realm for server %s", from);
- }
- return null;
- }
-
- @Inject
- VServerMetadataToNodeMetadata(
- @Memoized Supplier<Set<? extends Location>> locations,
- @Memoized Supplier<Set<? extends Image>> images,
- @Memoized Supplier<Set<? extends Hardware>> hardwares,
- GroupNamingConvention.Factory namingConvention) {
- this.images = checkNotNull(images, "images");
- this.locations = checkNotNull(locations, "locations");
- this.hardwares = checkNotNull(hardwares, "hardwares");
- this.nodeNamingConvention = checkNotNull(namingConvention,
- "namingConvention").createWithoutPrefix();
- }
-
- @Override
- public NodeMetadata apply(VServerMetadata from) {
- NodeMetadataBuilder builder = new NodeMetadataBuilder();
-
- builder.ids(from.getId());
- builder.name(from.getName());
- builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from
- .getName()));
- if (from.getStatus() == null)
- System.out.println("status null for: " + from.getId() + ": "
- + from.getName());
-
- builder.status(vServerToStatus.get(from.getStatus()));
- builder.privateAddresses(ImmutableSet.<String> of());
- builder.publicAddresses(ImmutableSet.<String> of());
-
- //
- // if (from.getIps() != null) {
- //
- // builder.publicAddresses(Collections2.transform(from.getIps(),
- // new Function<PublicIP, String>() {
- //
- // @Override
- // public String apply(PublicIP input) {
- // return input.getAddress();
- // }
- //
- // }));
- // }
-
- if (from.getServer() != null) {
-
- builder.imageId(from.getServer().getDiskimageId());
- builder.hardware(parseHardware(from.getServer().getType()));
-
- LoginCredentials.Builder credentialsBuilder = LoginCredentials
- .builder().password(from.getInitialPassword());
-
- Image image = parseImage(from.getServer());
- // image will not be found if server was created a while back and
- // the image has since been destroyed or discontinued (like an old
- // CentOS version)
- if (image != null) {
-
- builder.operatingSystem(image.getOperatingSystem());
- String user = image.getDefaultCredentials().getUser();
- credentialsBuilder.identity(user);
- }
-
- builder.credentials(credentialsBuilder.build());
-
- if (from.getServer() instanceof VServerWithVNICs) {
-
- VServerWithVNICs server = (VServerWithVNICs) from.getServer();
- builder.location(parseLocation(server));
- List<String> ips = Lists.newArrayList();
- if (server.getVnics() != null && server.getVnics().iterator().next().getPrivateIp() != null) {
- ips.add(server.getVnics().iterator().next().getPrivateIp());
- }
- builder.privateAddresses(ips);
- }
- }
- if (from.getTemplate() != null) {
- // when creating a new node
- builder.location(from.getTemplate().getLocation());
- }
-
- return builder.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/options/FGCPTemplateOptions.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/options/FGCPTemplateOptions.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/options/FGCPTemplateOptions.java
deleted file mode 100644
index 61d7e9b..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/options/FGCPTemplateOptions.java
+++ /dev/null
@@ -1,23 +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.fujitsu.fgcp.compute.options;
-
-import org.jclouds.compute.options.TemplateOptions;
-
-public class FGCPTemplateOptions extends TemplateOptions {
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/predicates/ServerStarted.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/predicates/ServerStarted.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/predicates/ServerStarted.java
deleted file mode 100644
index e0afeb2..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/predicates/ServerStarted.java
+++ /dev/null
@@ -1,54 +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.fujitsu.fgcp.compute.predicates;
-
-import javax.annotation.Resource;
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.fujitsu.fgcp.FGCPApi;
-import org.jclouds.fujitsu.fgcp.domain.VServerStatus;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Predicate;
-
-@Singleton
-public class ServerStarted implements Predicate<String> {
-
- private final FGCPApi api;
-
- @Resource
- protected Logger logger = Logger.NULL;
-
- @Inject
- public ServerStarted(FGCPApi api) {
- this.api = api;
- }
-
- public boolean apply(String serverId) {
- logger.trace("looking for status on server %s", serverId);
-
- VServerStatus status = api.getVirtualServerApi().getStatus(serverId);
- logger.trace("looking for status on server %s: currently: %s",
- serverId, status);
-
- if (status == VServerStatus.ERROR || status == VServerStatus.START_ERROR)
- throw new IllegalStateException("server in error: " + status);
- return status == VServerStatus.RUNNING;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/predicates/ServerStopped.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/predicates/ServerStopped.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/predicates/ServerStopped.java
deleted file mode 100644
index ba1bf3e..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/predicates/ServerStopped.java
+++ /dev/null
@@ -1,55 +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.fujitsu.fgcp.compute.predicates;
-
-import javax.annotation.Resource;
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.fujitsu.fgcp.FGCPApi;
-import org.jclouds.fujitsu.fgcp.domain.VServerStatus;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Predicate;
-
-@Singleton
-public class ServerStopped implements Predicate<String> {
-
- private final FGCPApi api;
-
- @Resource
- protected Logger logger = Logger.NULL;
-
- @Inject
- public ServerStopped(FGCPApi api) {
- this.api = api;
- }
-
- public boolean apply(String serverId) {
- logger.trace("looking for status on server %s", serverId);
-
- VServerStatus status = api.getVirtualServerApi().getStatus(serverId);
- logger.trace("looking for status on server %s: currently: %s",
- serverId, status);
-
- if (status == VServerStatus.ERROR || status == VServerStatus.STOP_ERROR)
- throw new IllegalStateException("server not around or in error: "
- + status);
- return status == VServerStatus.STOPPED;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/predicates/SystemStatusNormal.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/predicates/SystemStatusNormal.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/predicates/SystemStatusNormal.java
deleted file mode 100644
index 2c9ac74..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/predicates/SystemStatusNormal.java
+++ /dev/null
@@ -1,54 +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.fujitsu.fgcp.compute.predicates;
-
-import javax.annotation.Resource;
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.fujitsu.fgcp.FGCPApi;
-import org.jclouds.fujitsu.fgcp.domain.VSystemStatus;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Predicate;
-
-@Singleton
-public class SystemStatusNormal implements Predicate<String> {
-
- private final FGCPApi api;
-
- @Resource
- protected Logger logger = Logger.NULL;
-
- @Inject
- public SystemStatusNormal(FGCPApi api) {
- this.api = api;
- }
-
- public boolean apply(String systemId) {
- logger.trace("looking for status on system %s", systemId);
-
- VSystemStatus status = api.getVirtualSystemApi().getStatus(systemId);
- logger.trace("looking for status on system %s: currently: %s",
- systemId, status);
-
- if (status == VSystemStatus.ERROR)
- throw new IllegalStateException("system in error: " + status);
- return status == VSystemStatus.NORMAL;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/strategy/FGCPComputeServiceAdapter.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/strategy/FGCPComputeServiceAdapter.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/strategy/FGCPComputeServiceAdapter.java
deleted file mode 100644
index ef3698b..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/strategy/FGCPComputeServiceAdapter.java
+++ /dev/null
@@ -1,289 +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.fujitsu.fgcp.compute.strategy;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static com.google.common.collect.Iterables.contains;
-import static com.google.common.collect.Iterables.filter;
-import static org.jclouds.util.Predicates2.retry;
-
-import java.util.Set;
-
-import javax.annotation.Resource;
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.jclouds.compute.ComputeServiceAdapter;
-import org.jclouds.compute.domain.OsFamily;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.compute.reference.ComputeServiceConstants;
-import org.jclouds.compute.reference.ComputeServiceConstants.Timeouts;
-import org.jclouds.domain.Location;
-import org.jclouds.domain.LoginCredentials;
-import org.jclouds.fujitsu.fgcp.FGCPApi;
-import org.jclouds.fujitsu.fgcp.compute.functions.ResourceIdToFirewallId;
-import org.jclouds.fujitsu.fgcp.compute.functions.ResourceIdToSystemId;
-import org.jclouds.fujitsu.fgcp.compute.predicates.ServerStarted;
-import org.jclouds.fujitsu.fgcp.compute.predicates.ServerStopped;
-import org.jclouds.fujitsu.fgcp.compute.strategy.VServerMetadata.Builder;
-import org.jclouds.fujitsu.fgcp.domain.DiskImage;
-import org.jclouds.fujitsu.fgcp.domain.ServerType;
-import org.jclouds.fujitsu.fgcp.domain.VServer;
-import org.jclouds.fujitsu.fgcp.domain.VServerStatus;
-import org.jclouds.fujitsu.fgcp.domain.VServerWithDetails;
-import org.jclouds.fujitsu.fgcp.domain.VServerWithVNICs;
-import org.jclouds.fujitsu.fgcp.domain.VSystem;
-import org.jclouds.fujitsu.fgcp.domain.VSystemWithDetails;
-import org.jclouds.logging.Logger;
-import org.jclouds.rest.ResourceNotFoundException;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.ImmutableSet;
-
-/**
- * Defines the connection between the {@link org.jclouds.fujitsu.fgcp.FGCPApi}
- * implementation and the jclouds {@link org.jclouds.compute.ComputeService}.
- */
-@Singleton
-public class FGCPComputeServiceAdapter implements
- ComputeServiceAdapter<VServerMetadata, ServerType, DiskImage, Location> {
-
- @Resource
- @Named(ComputeServiceConstants.COMPUTE_LOGGER)
- protected Logger logger = Logger.NULL;
-
- private final FGCPApi api;
- protected Predicate<String> serverStopped = null;
- protected Predicate<String> serverStarted = null;
- protected Predicate<String> serverCreated = null;
- protected ResourceIdToFirewallId toFirewallId = null;
- protected ResourceIdToSystemId toSystemId = null;
-
- @Inject
- public FGCPComputeServiceAdapter(FGCPApi api, ServerStopped serverStopped,
- ServerStarted serverStarted, Timeouts timeouts,
- ResourceIdToFirewallId toFirewallId,
- ResourceIdToSystemId toSystemId) {
- this.api = checkNotNull(api, "api");
- this.serverStopped = retry(checkNotNull(serverStopped), timeouts.nodeSuspended);
- this.serverStarted = retry(checkNotNull(serverStarted), timeouts.nodeRunning);
- this.serverCreated = retry(checkNotNull(serverStopped), timeouts.nodeRunning);
- this.toFirewallId = checkNotNull(toFirewallId, "ResourceIdToFirewallId");
- this.toSystemId = checkNotNull(toSystemId, "ResourceIdToSystemId");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public NodeAndInitialCredentials<VServerMetadata> createNodeWithGroupEncodedIntoName(
- String group, String name, Template template) {
- String id = api.getVirtualSystemApi().createServer(name,
- template.getHardware().getName(), template.getImage().getId(),
- template.getLocation().getId());
-
- // wait until fully created (i.e. transitions to stopped status)
- checkState(serverCreated.apply(id), "node %s not reaching STOPPED state after creation", id);
- resumeNode(id);
- // don't wait until fully started, template "optionToNotBlock" takes care of that
- VServerMetadata server = getNode(id);
-
- // do we need this?
- server.setTemplate(template);
- String user = template.getImage().getOperatingSystem().getFamily() == OsFamily.WINDOWS ? "Administrator" : "root";
-
- return new NodeAndInitialCredentials<VServerMetadata>(server, id, LoginCredentials.builder().identity(user)
- .password(server.getInitialPassword()).build());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Iterable<ServerType> listHardwareProfiles() {
- return api.getVirtualDCApi().listServerTypes();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Iterable<DiskImage> listImages() {
- return api.getVirtualDCApi().listDiskImages();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public DiskImage getImage(String id) {
- return api.getDiskImageApi().get(id);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Iterable<Location> listLocations() {
- // Not using the adapter to determine locations
- // see SystemAndNetworkSegmentToLocationSupplier
- return ImmutableSet.<Location> of();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public VServerMetadata getNode(String id) {
- Builder builder = VServerMetadata.builder();
- builder.id(id);
-
- try {
- VServerWithDetails server = api.getVirtualServerApi().getDetails(id);
- // skip FWs and SLBs
- if (isFWorSLB(server)) {
- return null;
- }
- VServerStatus status = api.getVirtualServerApi().getStatus(id);
- logger.trace("Node %s [%s] - %s", id, status, server);
- builder.serverWithDetails(server);
- builder.status(status);
- builder.initialPassword(api.getVirtualServerApi().getInitialPassword(id));
-
- // mapped public ips?
-// String fwId = toFirewallId.apply(id);
- // futures.add(asyncApi.getBuiltinServerApi().getConfiguration(fwId,
- // BuiltinServerConfiguration.FW_RULE));
- } catch (ResourceNotFoundException e) {
- return null;
- }
-
- return builder.build();
- }
-
- private boolean isFWorSLB(VServer server) {
- String serverType = server.getType();
- return "firewall".equals(serverType) || "slb".equals(serverType);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Iterable<VServerMetadata> listNodes() {
- ImmutableSet.Builder<VServerMetadata> servers = ImmutableSet.<VServerMetadata> builder();
-
- Set<VSystem> systems = api.getVirtualDCApi().listVirtualSystems();
- for (VSystem system : systems) {
-
- VSystemWithDetails systemDetails = api.getVirtualSystemApi().getDetails(system.getId());
-
- for (VServerWithVNICs server : systemDetails.getServers()) {
-
- // skip FWs and SLBs
- if (!isFWorSLB(server)) {
- servers.add(getNode(server.getId()));
- }
- }
- }
-
- return servers.build();
- }
-
- @Override
- public Iterable<VServerMetadata> listNodesByIds(final Iterable<String> ids) {
- return filter(listNodes(), new Predicate<VServerMetadata>() {
-
- @Override
- public boolean apply(VServerMetadata server) {
- return contains(ids, server.getId());
- }
- });
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void destroyNode(String id) {
- // ensure it is stopped first
- suspendNode(id);
- checkState(serverStopped.apply(id), "could not stop %s before destroying it", id);
- api.getVirtualServerApi().destroy(id);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void rebootNode(String id) {
- suspendNode(id);
- checkState(serverStopped.apply(id), "could not stop %s before restarting it", id);
- resumeNode(id);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void resumeNode(String id) {
- try {
- api.getVirtualServerApi().start(id);
- } catch (IllegalStateException ise) {
- if (!(ise.getMessage().contains("ALREADY_STARTED") || ise.getMessage().contains("STARTING"))) {
- throw ise;
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void suspendNode(String id) {
- try {
- api.getVirtualServerApi().stop(id);
- } catch (IllegalStateException ise) {
- if (ise.getMessage().contains("ALREADY_STOPPED") || ise.getMessage().contains("STOPPING")) {
- logger.trace("suspendNode({0}) - {1}", id, ise.getMessage());
- // ignore as it has/will reach the desired destination state
- } else if (ise.getMessage().contains("STARTING")) {
- // wait till running, then try to stop again
- logger.trace("suspendNode({0}) - {1} - waiting to reach RUNNING state", id, ise.getMessage());
- checkState(serverStarted.apply(id), "starting %s didn't reach RUNNING state", id);
- logger.trace("suspendNode({0}) - now RUNNING, trying to stop again", id);
- try {
- api.getVirtualServerApi().stop(id);
- } catch (IllegalStateException e) {
- if (e.getMessage().contains("ALREADY_STOPPED") || e.getMessage().contains("STOPPING")) {
- logger.trace("suspendNode({0}) - {1}", id, e.getMessage());
- // ignore as it has/will reach the desired destination state
- } else {
- throw e;
- }
- }
- } else {
- throw ise;
- }
- } catch (RuntimeException e) {
- logger.error(e, "suspendNode({0}) - exception occurred!", id);
- throw e;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/strategy/VServerMetadata.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/strategy/VServerMetadata.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/strategy/VServerMetadata.java
deleted file mode 100644
index 359be62..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/compute/strategy/VServerMetadata.java
+++ /dev/null
@@ -1,174 +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.fujitsu.fgcp.compute.strategy;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import org.jclouds.compute.domain.Template;
-import org.jclouds.fujitsu.fgcp.domain.DiskImage;
-import org.jclouds.fujitsu.fgcp.domain.PublicIP;
-import org.jclouds.fujitsu.fgcp.domain.VServer;
-import org.jclouds.fujitsu.fgcp.domain.VServerStatus;
-import org.jclouds.fujitsu.fgcp.domain.VServerWithVNICs;
-
-import com.google.common.collect.ImmutableSet;
-
-/**
- * Holds metadata on a virtual server, both static (name, id, type, etc.) and
- * dynamic (status, mapped public IPs, etc.).
- */
-public class VServerMetadata {
-
- protected VServer server;
- protected String id;
- protected String name;
- protected Template template;
- protected String initialPassword;
- protected VServerStatus status = VServerStatus.UNRECOGNIZED;
- protected Set<PublicIP> ips;
- protected DiskImage image;
-
- public VServerMetadata(VServer server, String initialPassword,
- VServerStatus status, DiskImage image, Set<PublicIP> publicIps) {
- this.server = checkNotNull(server, "server");
- this.initialPassword = initialPassword;
- this.status = status;
- this.image = image;
- this.ips = publicIps;
- id = server.getId();
- name = server.getName();
- }
-
- public VServerMetadata(String id, String name, Template template,
- VServerStatus status) {
- this.id = checkNotNull(id, "id");
- this.name = checkNotNull(name, "name");
- this.template = checkNotNull(template, "template");
- this.status = checkNotNull(status, "status");
- }
-
- public VServer getServer() {
- return server;
- }
-
- public String getId() {
- return id;
- }
-
- public String getName() {
- return name;
- }
-
- public Template getTemplate() {
- return template;
- }
-
- public void setTemplate(Template template) {
- this.template = template;
- }
-
- public String getInitialPassword() {
- return initialPassword;
- }
-
- public VServerStatus getStatus() {
- return status;
- }
-
- public Set<PublicIP> getIps() {
- return ips;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private VServer server;
- private VServerWithVNICs serverWithDetails;
- private String id;
- private String name;
- private Template template;
- private String initialPassword;
- private VServerStatus status = VServerStatus.UNRECOGNIZED;
- private Set<PublicIP> publicIps = ImmutableSet.of();
- private DiskImage image;
-
- public Builder id(String id) {
- this.id = id;
- return this;
- }
-
- public Builder name(String name) {
- this.name = name;
- return this;
- }
-
- public Builder template(Template template) {
- this.template = template;
- return this;
- }
-
-// public Builder server(VServer server) {
-// this.server = server;
-// return this;
-// }
-
- public Builder serverWithDetails(VServerWithVNICs serverWithDetails) {
- this.serverWithDetails = serverWithDetails;
- return this;
- }
-
- public Builder initialPassword(String password) {
- this.initialPassword = password;
- return this;
- }
-
- public Builder status(VServerStatus status) {
- this.status = status;
- return this;
- }
-
- public Builder image(DiskImage image) {
- this.image = image;
- return this;
- }
-
- public Builder publicIps(Set<PublicIP> publicIps) {
- this.publicIps = publicIps;
- return this;
- }
-
- public VServerMetadata build() {
- if (initialPassword == null) initialPassword = "";
- if (server != null) {
- return new VServerMetadata(server, initialPassword, status,
- image, publicIps);
- } else if (serverWithDetails != null) {
- return new VServerMetadata(serverWithDetails, initialPassword,
- status, image, publicIps);
- } else {
- // sometimes these fields are null because the server is returning a verify error
- if (id == null) id = "dummy-id";
- if (name == null) name = "dummy-name";
- return new VServerMetadata(id, name, template, status);
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/config/FGCPHttpApiModule.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/config/FGCPHttpApiModule.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/config/FGCPHttpApiModule.java
deleted file mode 100644
index 06e076f..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/config/FGCPHttpApiModule.java
+++ /dev/null
@@ -1,108 +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.fujitsu.fgcp.config;
-
-
-import java.util.Calendar;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.SSLContext;
-
-import org.jclouds.date.TimeStamp;
-import org.jclouds.fujitsu.fgcp.FGCPApi;
-import org.jclouds.fujitsu.fgcp.FGCPCredentials;
-import org.jclouds.fujitsu.fgcp.handlers.FGCPServerErrorRetryHandler;
-import org.jclouds.fujitsu.fgcp.handlers.ResponseNotSuccessHandler;
-import org.jclouds.fujitsu.fgcp.http.ChangeReturnCodeTo500IfErrorJavaUrlHttpCommandExecutorService;
-import org.jclouds.fujitsu.fgcp.location.SystemAndNetworkSegmentToLocationSupplier;
-import org.jclouds.fujitsu.fgcp.suppliers.FGCPCredentialsSupplier;
-import org.jclouds.fujitsu.fgcp.suppliers.SSLContextWithKeysSupplier;
-import org.jclouds.fujitsu.fgcp.xml.FGCPJAXBParser;
-import org.jclouds.http.HttpErrorHandler;
-import org.jclouds.http.HttpRetryHandler;
-import org.jclouds.http.annotation.ClientError;
-import org.jclouds.http.annotation.Redirection;
-import org.jclouds.http.annotation.ServerError;
-import org.jclouds.http.config.SSLModule.LogToMapHostnameVerifier;
-import org.jclouds.http.internal.JavaUrlHttpCommandExecutorService;
-import org.jclouds.location.suppliers.ImplicitLocationSupplier;
-import org.jclouds.location.suppliers.LocationsSupplier;
-import org.jclouds.location.suppliers.implicit.FirstNetwork;
-import org.jclouds.rest.ConfiguresHttpApi;
-import org.jclouds.rest.config.HttpApiModule;
-import org.jclouds.xml.XMLParser;
-
-import com.google.common.base.Supplier;
-import com.google.inject.Provides;
-import com.google.inject.Scopes;
-import com.google.inject.TypeLiteral;
-
-
-/**
- * Configures the connection to the FGCP endpoint.
- */
-@ConfiguresHttpApi
-public class FGCPHttpApiModule extends HttpApiModule<FGCPApi> {
-
- public FGCPHttpApiModule() {
- super();
- }
-
- protected FGCPHttpApiModule(Class<FGCPApi> api) {
- super(api);
- }
-
- @Override
- protected void bindErrorHandlers() {
- bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(ResponseNotSuccessHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(ResponseNotSuccessHandler.class);
- bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(ResponseNotSuccessHandler.class);
- }
-
- @Override
- protected void bindRetryHandlers() {
- bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(
- FGCPServerErrorRetryHandler.class);
- bind(HttpRetryHandler.class).annotatedWith(ServerError.class).to(
- FGCPServerErrorRetryHandler.class);
- }
-
- @Override
- protected void configure() {
- super.configure();
- bind(XMLParser.class).to(FGCPJAXBParser.class);
- bind(new TypeLiteral<Supplier<FGCPCredentials>>() {}).to(FGCPCredentialsSupplier.class);
- bind(new TypeLiteral<Supplier<SSLContext>>() {
- }).to(new TypeLiteral<SSLContextWithKeysSupplier>() {
- });
- bind(HostnameVerifier.class).to(LogToMapHostnameVerifier.class);
- bind(JavaUrlHttpCommandExecutorService.class).to(ChangeReturnCodeTo500IfErrorJavaUrlHttpCommandExecutorService.class);
- }
-
- @Override
- protected void installLocations() {
- super.installLocations();
- bind(ImplicitLocationSupplier.class).to(FirstNetwork.class).in(Scopes.SINGLETON);
- bind(LocationsSupplier.class).to(SystemAndNetworkSegmentToLocationSupplier.class).in(Scopes.SINGLETON);
- }
-
- @Provides
- @TimeStamp
- protected Calendar provideCalendar() {
- return Calendar.getInstance();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/AddressRange.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/AddressRange.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/AddressRange.java
deleted file mode 100644
index a829758..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/AddressRange.java
+++ /dev/null
@@ -1,53 +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.fujitsu.fgcp.domain;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Describes the address range pool in a contract used for allocating private IP
- * address network segments for virtual systems.
- */
-@XmlRootElement(name = "addressrange")
-public class AddressRange {
- private String range;
-
- private String from;
-
- private String to;
-
- /**
- * @return the range
- */
- public String getRange() {
- return range;
- }
-
- /**
- * @return the from
- */
- public String getFrom() {
- return from;
- }
-
- /**
- * @return the to
- */
- public String getTo() {
- return to;
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServer.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServer.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServer.java
deleted file mode 100644
index 705d9c4..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServer.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.fujitsu.fgcp.domain;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Represents a built-in server, also called extended function module (EFM),
- * such as a firewall or load balancer (SLB).
- */
-@XmlRootElement(name = "efm")
-public class BuiltinServer {
- @XmlElement(name = "efmId")
- private String id;
- @XmlElement(name = "efmType")
- private BuiltinServerType builtinServerType;
- @XmlElement(name = "efmName")
- private String name;
- private String creator;
- private String slbVip;
- private Firewall firewall;
- private SLB loadbalancer;
-
- public enum BuiltinServerType {FW, SLB}
-
- public String getId() {
- return id;
- }
-
- public BuiltinServerType getType() {
- return builtinServerType;
- }
-
- public String getName() {
- return name;
- }
-
- public String getCreator() {
- return creator;
- }
-
- public String getSlbVip() {
- return slbVip;
- }
-
- public Firewall getFirewall() {
- return firewall;
- }
-
- public SLB getLoadbalancer() {
- return loadbalancer;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerBackup.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerBackup.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerBackup.java
deleted file mode 100644
index 5bae70d..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerBackup.java
+++ /dev/null
@@ -1,72 +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.fujitsu.fgcp.domain;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-
-/**
- * Holds information on a backup of a built-in server, such as a firewall or
- * load balancer (SLB).
- */
-@XmlRootElement(name = "backup")
-public class BuiltinServerBackup {
- @XmlElement(name = "backupId")
- private String id;
- @XmlElement(name = "backupTime")
- private String time;
-
- /**
- * @return the id
- */
- public String getId() {
- return id;
- }
-
- /**
- * @return the time
- */
- public String getTime() {
- return time;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(id);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- BuiltinServerBackup that = BuiltinServerBackup.class.cast(obj);
- return Objects.equal(this.id, that.id);
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(this).omitNullValues().add("id", id)
- .add("time", time).toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerConfiguration.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerConfiguration.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerConfiguration.java
deleted file mode 100644
index 5df69ed..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerConfiguration.java
+++ /dev/null
@@ -1,64 +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.fujitsu.fgcp.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.base.CaseFormat;
-
-/**
- * Possible statuses of a built-in server, also called extended function module
- * (EFM), such as a firewall or load balancer (SLB).
- * <p>
- * In addition to statuses that apply to regular virtual servers, it includes
- * statuses relevant to the upgrade process for functionality of the built-in
- * server.
- */
-public enum BuiltinServerConfiguration {
- FW_NAT_RULE,
- FW_DNS,
- FW_POLICY,
- FW_LOG,
- FW_LIMIT_POLICY,
- SLB_RULE,
- SLB_LOAD_STATISTICS,
- SLB_ERROR_STATISTICS,
- SLB_CERTIFICATE_LIST,
- EFM_UPDATE,
- SLB_CONNECTION,
- UNRECOGNIZED;
-
- public String value() {
- return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name());
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static BuiltinServerConfiguration fromValue(String configuration) {
- try {
- return valueOf(CaseFormat.UPPER_CAMEL
- .to(CaseFormat.UPPER_UNDERSCORE,
- checkNotNull(configuration, "configuration")));
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerStatus.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerStatus.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerStatus.java
deleted file mode 100644
index fa84432..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerStatus.java
+++ /dev/null
@@ -1,56 +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.fujitsu.fgcp.domain;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-import com.google.common.base.CaseFormat;
-
-/**
- * Possible statuses of a built-in server, also called extended function module
- * (EFM), such as a firewall or load balancer (SLB).
- * <p>
- * In addition to statuses that apply to regular virtual servers, it includes
- * statuses relevant to the upgrade process for functionality of the built-in
- * server.
- */
-@XmlRootElement(name = "efmStatus")
-public enum BuiltinServerStatus {
- DEPLOYING, RUNNING, STOPPING, STOPPED, STARTING, FAILOVER, UNEXPECTED_STOP, RESTORING, BACKUP_ING, ERROR, EXECUTE_NETWORK_SERVER, START_ERROR, STOP_ERROR, UPDATE, BACKOUT, UNRECOGNIZED;
-
- public String value() {
- return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name());
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static BuiltinServerStatus fromValue(String status) {
- try {
- return valueOf(CaseFormat.UPPER_CAMEL
- .to(CaseFormat.UPPER_UNDERSCORE,
- checkNotNull(status, "status")));
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/CPU.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/CPU.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/CPU.java
deleted file mode 100644
index 33f3931..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/CPU.java
+++ /dev/null
@@ -1,74 +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.fujitsu.fgcp.domain;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-
-/**
- * Describes the virtual CPU of a server.
- */
-@XmlRootElement(name = "cpu")
-public class CPU {
- @XmlElement(name = "cpuArch")
- private String arch;
- @XmlElement(name = "cpuPerf")
- private double speedPerCore;
- @XmlElement(name = "numOfCpu")
- private double cores;
-
- public String getArch() {
- return arch;
- }
-
- public double getSpeedPerCore() {
- return speedPerCore;
- }
-
- public double getCores() {
- return cores;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(cores, speedPerCore, arch);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- CPU that = CPU.class.cast(obj);
- return Objects.equal(this.cores, that.cores)
- && Objects.equal(this.speedPerCore, that.speedPerCore)
- && Objects.equal(this.arch, that.arch);
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(this).omitNullValues()
- .add("cores", cores).add("speedPerCore", speedPerCore)
- .add("arch", arch).toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Cause.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Cause.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Cause.java
deleted file mode 100644
index 4720f96..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Cause.java
+++ /dev/null
@@ -1,96 +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.fujitsu.fgcp.domain;
-
-
-/**
- * Represents a load balancer (SLB) log entry.
- */
-public class Cause {
- private String cat;
-
- private String status;
-
- private String filePath;
-
- private String current;
-
- private String before;
-
- private String today;
-
- private String yesterday;
-
- private String total;
-
- /**
- * @return category
- */
- public String getCat() {
- return cat;
- }
-
- /**
- * @return the status
- */
- public String getStatus() {
- return status;
- }
-
- /**
- * @return the filePath
- */
- public String getFilePath() {
- return filePath;
- }
-
- /**
- * @return the current
- */
- public String getCurrent() {
- return current;
- }
-
- /**
- * @return the before
- */
- public String getBefore() {
- return before;
- }
-
- /**
- * @return the today
- */
- public String getToday() {
- return today;
- }
-
- /**
- * @return the yesterday
- */
- public String getYesterday() {
- return yesterday;
- }
-
- /**
- * @return the total
- */
- public String getTotal() {
- return total;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Direction.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Direction.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Direction.java
deleted file mode 100644
index b3ac788..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Direction.java
+++ /dev/null
@@ -1,110 +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.fujitsu.fgcp.domain;
-
-import java.util.Set;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-/**
- * Grouping of firewall rules pertaining to a particular direction in network
- * traffic, e.g. from the Internet to a server in the DMZ zone, or from a server
- * in the SECURE2 zone to the SECURE1 zone, etc.
- */
-public class Direction {
- private String from;
- private String to;
- private Set<Policy> policies = Sets.newLinkedHashSet();
- private Acceptable acceptable;
- private Prefix prefix;
- private int maxPolicyNum;
-
- enum Acceptable {OK, NG}
- enum Prefix {free, src, dst, proto, srcport, dstport, action, rule, tab}
-
- /**
- * @return the from
- */
- public String getFrom() {
- return from;
- }
-
- /**
- * @return the to
- */
- public String getTo() {
- return to;
- }
-
- /**
- * @return the policies
- */
- public Set<Policy> getPolicies() {
- return policies == null ? ImmutableSet.<Policy> of() : ImmutableSet
- .copyOf(policies);
- }
-
- /**
- * @return the acceptable
- */
- public Acceptable getAcceptable() {
- return acceptable;
- }
-
- /**
- * @return the prefix
- */
- public Prefix getPrefix() {
- return prefix;
- }
-
- /**
- * @return the maxPolicyNum
- */
- public int getMaxPolicyNum() {
- return maxPolicyNum;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(from, to);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Direction that = Direction.class.cast(obj);
- return Objects.equal(this.from, that.from)
- && Objects.equal(this.to, that.to);
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(this).omitNullValues().add("from", from)
- .add("to", to).add("prefix", prefix).add("policies", policies)
- .add("maxPolicyNum", maxPolicyNum)
- .add("acceptable", acceptable).toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Disk.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Disk.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Disk.java
deleted file mode 100644
index ddb31c4..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Disk.java
+++ /dev/null
@@ -1,81 +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.fujitsu.fgcp.domain;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-
-/**
- * Describes a disk as part of the description of hardware represented by a
- * virtual server.
- */
-@XmlRootElement
-public class Disk {
- @XmlElement(name = "diskSize")
- private String size;
-
- @XmlElement(name = "diskUsage")
- private String usage;
-
- @XmlElement(name = "diskType")
- private String type;
-
- public String getSize() {
- return size;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public String getType() {
- return type;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (!(o instanceof Disk))
- return false;
-
- Disk disk = (Disk) o;
-
- if (size != null ? !size.equals(disk.size) : disk.size != null)
- return false;
- if (type != null ? !type.equals(disk.type) : disk.type != null)
- return false;
- if (usage != null ? !usage.equals(disk.usage) : disk.usage != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = size != null ? size.hashCode() : 0;
- result = 31 * result + (usage != null ? usage.hashCode() : 0);
- result = 31 * result + (type != null ? type.hashCode() : 0);
- return result;
- }
-
- @Override
- public String toString() {
- return "Disk{" + "size='" + size + '\'' + ", usage='" + usage + '\''
- + ", type='" + type + '\'' + '}';
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/DiskImage.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/DiskImage.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/DiskImage.java
deleted file mode 100644
index 3d2c0c0..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/DiskImage.java
+++ /dev/null
@@ -1,197 +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.fujitsu.fgcp.domain;
-
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-/**
- * Represents a disk image with pre-installed OS and/or software.
- * <p>
- * It is used as base for the system disk of a virtual server.
- */
-@XmlRootElement(name = "diskimage")
-public class DiskImage {
- @XmlElement(name = "diskimageId")
- private String id;
-
- @XmlElement(name = "diskimageName")
- private String name;
-
- private int size;
-
- private String osName;
-
- private String osType;
-
- private String creatorName;
-
- private String registrant;
-
- private String licenseInfo;
-
- private String description;
-
- @XmlElementWrapper(name = "softwares")
- @XmlElement(name = "software")
- private Set<Software> software = Sets.newLinkedHashSet();
-
- public String getId() {
- return id;
- }
-
- public int getSize() {
- return size;
- }
-
- public String getOsName() {
- return osName;
- }
-
- public String getOsType() {
- return osType;
- }
-
- public String getCreatorName() {
- return creatorName;
- }
-
- public String getRegistrant() {
- return registrant;
- }
-
- public String getLicenseInfo() {
- return licenseInfo;
- }
-
- public String getDescription() {
- return description;
- }
-
- public String getName() {
- return name;
- }
-
- public Set<Software> getSoftware() {
- return software == null ? ImmutableSet.<Software> of() : ImmutableSet
- .copyOf(software);
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String id;
- private String name;
- private int size;
- private String osName;
- private String osType;
- private String creatorName;
- private String registrant;
- private String licenseInfo;
- private String description;
- private Set<Software> software;
-
- public Builder id(String id) {
- this.id = id;
- return this;
- }
-
- public Builder name(String name) {
- this.name = name;
- return this;
- }
-
- public Builder osName(String osName) {
- this.osName = osName;
- return this;
- }
-
- public Builder osType(String osType) {
- this.osType = osType;
- return this;
- }
-
- public Builder creatorName(String creatorName) {
- this.creatorName = creatorName;
- return this;
- }
-
- public Builder registrant(String registrant) {
- this.registrant = registrant;
- return this;
- }
-
- public Builder description(String description) {
- this.description = description;
- return this;
- }
-
- public DiskImage build() {
- DiskImage image = new DiskImage();
-
- image.id = id;
- image.name = name;
- image.size = size;
- image.osName = osName;
- image.osType = osType;
- image.creatorName = creatorName;
- image.registrant = registrant;
- image.licenseInfo = licenseInfo;
- image.description = description;
- image.software = software;
-
- return image;
- }
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(id);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- DiskImage that = DiskImage.class.cast(obj);
- return Objects.equal(this.id, that.id);
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(this).omitNullValues().add("id", id)
- .add("name", name).add("osName", osName).add("osType", osType)
- .add("size", size).add("creatorName", creatorName)
- .add("description", description)
- .add("licenseInfo", licenseInfo).add("registrant", registrant)
- .add("software", software).toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/ErrorStatistics.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/ErrorStatistics.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/ErrorStatistics.java
deleted file mode 100644
index 8322387..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/ErrorStatistics.java
+++ /dev/null
@@ -1,49 +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.fujitsu.fgcp.domain;
-
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-/**
- * Holds statistics of errors reported by a load balancer (SLB).
- */
-@XmlRootElement(name = "errorstatistics")
-public class ErrorStatistics {
- private Period period;
- private Set<Group> groups = Sets.newLinkedHashSet();
-
- /**
- * @return the period
- */
- public Period getPeriod() {
- return period;
- }
-
- /**
- * @return the groups
- */
- public Set<Group> getGroups() {
- return groups == null ? ImmutableSet.<Group> of() : ImmutableSet
- .copyOf(groups);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/EventLog.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/EventLog.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/EventLog.java
deleted file mode 100644
index a5578c8..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/EventLog.java
+++ /dev/null
@@ -1,96 +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.fujitsu.fgcp.domain;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Objects;
-
-/**
- * Represents an entry in the event log.
- */
-@XmlRootElement(name = "errorlog")
-public class EventLog {
- private String title;
- private String message;
- private String startDate;
- private String expiry;
- private String entryDate;
-
- /**
- * @return the title
- */
- public String getTitle() {
- return title;
- }
-
- /**
- * @return the message
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * @return the startDate
- */
- public String getStartDate() {
- return startDate;
- }
-
- /**
- * @return the expiry
- */
- public String getExpiry() {
- return expiry;
- }
-
- /**
- * @return the entryDate
- */
- public String getEntryDate() {
- return entryDate;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(entryDate, message, title);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- EventLog that = EventLog.class.cast(obj);
- return Objects.equal(this.entryDate, that.entryDate)
- && Objects.equal(this.message, that.message)
- && Objects.equal(this.title, that.title);
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(this).omitNullValues()
- .add("entryDate", entryDate).add("title", title)
- .add("message", message).add("startDate", startDate)
- .add("expiry", expiry).toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds-labs/blob/ba795261/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Firewall.java
----------------------------------------------------------------------
diff --git a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Firewall.java b/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Firewall.java
deleted file mode 100644
index 9db9f52..0000000
--- a/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Firewall.java
+++ /dev/null
@@ -1,129 +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.fujitsu.fgcp.domain;
-
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Sets;
-
-/**
- * Represents a firewall (FW).
- */
-@XmlRootElement(name = "fw")
-public class Firewall {
- private NAT nat;
- private Set<Direction> directions = Sets.newLinkedHashSet();
- private String log;
- private String status;
- private String category;
- private String latestVersion;
- private String comment;
- private boolean firmUpdateExist;
- private boolean configUpdateExist;
- private String backout;
- private String updateDate;
- private String currentVersion;
-
- /**
- * @return the nat
- */
- public NAT getNat() {
- return nat;
- }
-
- /**
- * @return the directions
- */
- public Set<Direction> getDirections() {
- return directions == null ? ImmutableSet.<Direction> of()
- : ImmutableSet.copyOf(directions);
- }
-
- /**
- * @return the log
- */
- public String getLog() {
- return log;
- }
-
- /**
- * @return the status
- */
- public String getStatus() {
- return status;
- }
-
- /**
- * @return the category
- */
- public String getCategory() {
- return category;
- }
-
- /**
- * @return the latestVersion
- */
- public String getLatestVersion() {
- return latestVersion;
- }
-
- /**
- * @return the comment
- */
- public String getComment() {
- return comment;
- }
-
- /**
- * @return the firmUpdateExist
- */
- public boolean getFirmUpdateExist() {
- return firmUpdateExist;
- }
-
- /**
- * @return the configUpdateExist
- */
- public boolean getConfigUpdateExist() {
- return configUpdateExist;
- }
-
- /**
- * @return the backout
- */
- public String getBackout() {
- return backout;
- }
-
- /**
- * @return the updateDate
- */
- public String getUpdateDate() {
- return updateDate;
- }
-
- /**
- * @return the currentVersion
- */
- public String getCurrentVersion() {
- return currentVersion;
- }
-
-}