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);
+ }
+ }
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/AddressRange.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/AddressRange.java
new file mode 100644
index 0000000000..032a718e16
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/AddressRange.java
@@ -0,0 +1,57 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.
+ *
+ * @author Dies Koper
+ */
+@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;
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServer.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServer.java
new file mode 100644
index 0000000000..911b05c5f0
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServer.java
@@ -0,0 +1,73 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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).
+ *
+ * @author Dies Koper
+ */
+@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;
+ }
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerBackup.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerBackup.java
new file mode 100644
index 0000000000..79374f9356
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerBackup.java
@@ -0,0 +1,75 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.Objects;
+
+/**
+ * Holds information on a backup of a built-in server, such as a firewall or
+ * load balancer (SLB).
+ *
+ * @author Dies Koper
+ */
+@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 Objects.toStringHelper(this).omitNullValues().add("id", id)
+ .add("time", time).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerConfiguration.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerConfiguration.java
new file mode 100644
index 0000000000..5f7fa6ac23
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerConfiguration.java
@@ -0,0 +1,68 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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).
+ *
+ * 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.
+ *
+ * @author Dies Koper
+ */
+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;
+ }
+ }
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerStatus.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerStatus.java
new file mode 100644
index 0000000000..4ee7ba279d
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/BuiltinServerStatus.java
@@ -0,0 +1,60 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.CaseFormat;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Possible statuses of a built-in server, also called extended function module
+ * (EFM), such as a firewall or load balancer (SLB).
+ *
+ * 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.
+ *
+ * @author Dies Koper
+ */
+@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;
+ }
+ }
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/CPU.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/CPU.java
new file mode 100644
index 0000000000..b49b9e8196
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/CPU.java
@@ -0,0 +1,77 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.Objects;
+
+/**
+ * Describes the virtual CPU of a server.
+ *
+ * @author Dies Koper
+ */
+@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 Objects.toStringHelper(this).omitNullValues()
+ .add("cores", cores).add("speedPerCore", speedPerCore)
+ .add("arch", arch).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Cause.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Cause.java
new file mode 100644
index 0000000000..c2863db2b5
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Cause.java
@@ -0,0 +1,100 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.
+ *
+ * @author Dies Koper
+ */
+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;
+ }
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Direction.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Direction.java
new file mode 100644
index 0000000000..b332fdcbb1
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Direction.java
@@ -0,0 +1,113 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.LinkedHashSet;
+import java.util.Set;
+
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * 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.
+ *
+ * @author Dies Koper
+ */
+public class Direction {
+ private String from;
+ private String to;
+ private Set policies = new LinkedHashSet();
+ 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 getPolicies() {
+ return policies == null ? ImmutableSet. 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 Objects.toStringHelper(this).omitNullValues().add("from", from)
+ .add("to", to).add("prefix", prefix).add("policies", policies)
+ .add("maxPolicyNum", maxPolicyNum)
+ .add("acceptable", acceptable).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Disk.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Disk.java
new file mode 100644
index 0000000000..dae088f095
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Disk.java
@@ -0,0 +1,85 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.
+ *
+ * @author Dies Koper
+ */
+@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 + '\'' + '}';
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/DiskImage.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/DiskImage.java
new file mode 100644
index 0000000000..5e2d3e1daf
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/DiskImage.java
@@ -0,0 +1,200 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.LinkedHashSet;
+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.Objects;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Represents a disk image with pre-installed OS and/or software.
+ *
+ * It is used as base for the system disk of a virtual server.
+ *
+ * @author Dies Koper
+ */
+@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 = new LinkedHashSet();
+
+ 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 getSoftware() {
+ return software == null ? ImmutableSet. 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;
+
+ 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 Objects.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();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/ErrorStatistics.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/ErrorStatistics.java
new file mode 100644
index 0000000000..28cb1e764a
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/ErrorStatistics.java
@@ -0,0 +1,53 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.LinkedHashSet;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Holds statistics of errors reported by a load balancer (SLB).
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "errorstatistics")
+public class ErrorStatistics {
+ private Period period;
+ private Set groups = new LinkedHashSet();
+
+ /**
+ * @return the period
+ */
+ public Period getPeriod() {
+ return period;
+ }
+
+ /**
+ * @return the groups
+ */
+ public Set getGroups() {
+ return groups == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(groups);
+ }
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/EventLog.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/EventLog.java
new file mode 100644
index 0000000000..bda7e2303e
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/EventLog.java
@@ -0,0 +1,99 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.Objects;
+
+/**
+ * Represents an entry in the event log.
+ *
+ * @author Dies Koper
+ */
+@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 Objects.toStringHelper(this).omitNullValues()
+ .add("entryDate", entryDate).add("title", title)
+ .add("message", message).add("startDate", startDate)
+ .add("expiry", expiry).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Firewall.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Firewall.java
new file mode 100644
index 0000000000..f466c054b1
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Firewall.java
@@ -0,0 +1,133 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.LinkedHashSet;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Represents a firewall (FW).
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "fw")
+public class Firewall {
+ private NAT nat;
+ private Set directions = new LinkedHashSet();
+ 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 getDirections() {
+ return directions == null ? ImmutableSet. 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;
+ }
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Group.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Group.java
new file mode 100644
index 0000000000..40c36a4bbe
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Group.java
@@ -0,0 +1,226 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.LinkedHashSet;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlEnumValue;
+
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Describes attributes of a software load balancer's (SLB) configuration.
+ *
+ * @author Dies Koper
+ */
+public class Group {
+ private int id;
+
+ private String protocol;
+
+ private int port1;
+
+ private int port2;
+
+ private String balanceType;
+
+ private String uniqueType;
+
+ private String monitorType;
+
+ private int maxConnection;
+
+ private int uniqueRetention;
+
+ private int interval;
+
+ private int timeout;
+
+ private int retryCount;
+
+ private int certNum;
+
+ private Set causes;
+
+ private RecoveryAction recoveryAction;
+
+ private Set targets = new LinkedHashSet();
+
+ private String validity;
+
+ enum RecoveryAction {
+ @XmlEnumValue("switch-back")
+ SWITCH_BACK, @XmlEnumValue("maintenance")
+ MAINTENANCE
+ }
+
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+
+ /**
+ * @return the protocol
+ */
+ public String getProtocol() {
+ return protocol;
+ }
+
+ /**
+ * @return the port1
+ */
+ public int getPort1() {
+ return port1;
+ }
+
+ /**
+ * @return the port2
+ */
+ public int getPort2() {
+ return port2;
+ }
+
+ /**
+ * @return the balanceType
+ */
+ public String getBalanceType() {
+ return balanceType;
+ }
+
+ /**
+ * @return the uniqueType
+ */
+ public String getUniqueType() {
+ return uniqueType;
+ }
+
+ /**
+ * @return the monitorType
+ */
+ public String getMonitorType() {
+ return monitorType;
+ }
+
+ /**
+ * @return the maxConnection
+ */
+ public int getMaxConnection() {
+ return maxConnection;
+ }
+
+ /**
+ * @return the uniqueRetention
+ */
+ public int getUniqueRetention() {
+ return uniqueRetention;
+ }
+
+ /**
+ * @return the interval
+ */
+ public int getInterval() {
+ return interval;
+ }
+
+ /**
+ * @return the timeout
+ */
+ public int getTimeout() {
+ return timeout;
+ }
+
+ /**
+ * @return the retryCount
+ */
+ public int getRetryCount() {
+ return retryCount;
+ }
+
+ /**
+ * @return the certNum
+ */
+ public int getCertNum() {
+ return certNum;
+ }
+
+ /**
+ * @return the causes
+ */
+ public Set getCauses() {
+ return causes == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(causes);
+ }
+
+ /**
+ * @return the recoveryAction
+ */
+ public RecoveryAction getRecoveryAction() {
+ return recoveryAction;
+ }
+
+ /**
+ * @return the targets
+ */
+ public Set getTargets() {
+ return targets == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(targets);
+ }
+
+ /**
+ * @return the validity
+ */
+ public String getValidity() {
+ return validity;
+ }
+
+ @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;
+ Group that = Group.class.cast(obj);
+ return Objects.equal(this.id, that.id);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues().add("id", id)
+ .add("protocol", protocol).add("port1", port1)
+ .add("port2", port2).add("balanceType", balanceType)
+ .add("uniqueType", uniqueType).add("monitorType", monitorType)
+ .add("maxConnection", maxConnection)
+ .add("uniqueRetention", uniqueRetention)
+ .add("interval", interval).add("timeout", timeout)
+ .add("retryCount", retryCount).add("certNum", certNum)
+ .add("causes", causes).add("recoveryAction", recoveryAction)
+ .add("targets", targets).add("validity", validity).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Image.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Image.java
new file mode 100644
index 0000000000..ed8fbacd31
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Image.java
@@ -0,0 +1,114 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.LinkedHashSet;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Holds information on the system disk image of a virtual server, including the
+ * OS and software pre-installed on it.
+ *
+ * @author Dies Koper
+ */
+public class Image {
+ private String id;
+
+ private String serverCategory;
+
+ private String serverApplication;
+
+ private String cpuBit;
+
+ private float sysvolSize;
+
+ private int numOfMaxDisk;
+
+ private int numOfMaxNic;
+
+ @XmlElementWrapper(name = "softwares")
+ @XmlElement(name = "software")
+ private Set software = new LinkedHashSet();
+
+ public String getId() {
+ return id;
+ }
+
+ public String getServerCategory() {
+ return serverCategory;
+ }
+
+ public String getServerApplication() {
+ return serverApplication;
+ }
+
+ public String getCpuBit() {
+ return cpuBit;
+ }
+
+ public float getSysvolSize() {
+ return sysvolSize;
+ }
+
+ public int getNumOfMaxDisk() {
+ return numOfMaxDisk;
+ }
+
+ public int getNumOfMaxNic() {
+ return numOfMaxNic;
+ }
+
+ public Set getSoftware() {
+ return software == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(software);
+ }
+
+ @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;
+ Image that = Image.class.cast(obj);
+ return Objects.equal(this.id, that.id);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues().add("id", id)
+ .add("serverCategory", serverCategory)
+ .add("serverApplication", serverApplication)
+ .add("cpuBit", cpuBit).add("sysvolSize", sysvolSize)
+ .add("numOfMaxDisk", numOfMaxDisk)
+ .add("numOfMaxNic", numOfMaxNic).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Information.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Information.java
new file mode 100644
index 0000000000..a8a822f859
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Information.java
@@ -0,0 +1,105 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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 com.google.common.base.Objects;
+
+/**
+ * Holds information relating to the FGCP service.
+ *
+ * @author Dies Koper
+ */
+public class Information {
+ private int seqno;
+ private String title;
+ private String message;
+ private String startDate;
+ private String expiry;
+ private String entryDate;
+
+ /**
+ * @return the seqno
+ */
+ public int getSeqno() {
+ return seqno;
+ }
+
+ /**
+ * @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(seqno, 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;
+ Information that = Information.class.cast(obj);
+ return Objects.equal(this.seqno, that.seqno)
+ && Objects.equal(this.entryDate, that.entryDate)
+ && Objects.equal(this.message, that.message)
+ && Objects.equal(this.title, that.title);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues()
+ .add("seqno", seqno).add("entryDate", entryDate)
+ .add("title", title).add("message", message)
+ .add("startDate", startDate).add("expiry", expiry).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/IntermediateCACert.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/IntermediateCACert.java
new file mode 100644
index 0000000000..7acc3871a0
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/IntermediateCACert.java
@@ -0,0 +1,120 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.Objects;
+
+/**
+ * Describes an intermediate CA certificate for use with a load balancer (SLB).
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "ccacert")
+public class IntermediateCACert implements Comparable {
+ private int ccacertNum;
+
+ private String description;
+
+ private String subject;
+
+ private String issuer;
+
+ private String validity;
+
+ private String detail;
+
+ /**
+ * @return the ccacertNum
+ */
+ public int getCcacertNum() {
+ return ccacertNum;
+ }
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @return the subject
+ */
+ public String getSubject() {
+ return subject;
+ }
+
+ /**
+ * @return the issuer
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * @return the validity
+ */
+ public String getValidity() {
+ return validity;
+ }
+
+ /**
+ * @return the detail
+ */
+ public String getDetail() {
+ return detail;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(ccacertNum, issuer, subject, validity);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ IntermediateCACert that = IntermediateCACert.class.cast(obj);
+ return Objects.equal(this.ccacertNum, that.ccacertNum)
+ && Objects.equal(this.issuer, that.issuer)
+ && Objects.equal(this.subject, that.subject)
+ && Objects.equal(this.validity, that.validity);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues()
+ .add("ccacertNum", ccacertNum).add("issuer", issuer)
+ .add("subject", subject).add("validity", validity)
+ .add("description", description).add("detail", detail)
+ .toString();
+ }
+
+ @Override
+ public int compareTo(IntermediateCACert o) {
+ return ccacertNum - o.ccacertNum;
+ }
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/LoadStatistics.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/LoadStatistics.java
new file mode 100644
index 0000000000..654e4fca5c
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/LoadStatistics.java
@@ -0,0 +1,68 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.LinkedHashSet;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Holds statistics of the load on a load balancer (SLB).
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "loadstatistics")
+public class LoadStatistics {
+ private Set groups = new LinkedHashSet();
+
+ /**
+ * @return the groups
+ */
+ public Set getGroups() {
+ return groups == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(groups);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(groups);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ LoadStatistics that = LoadStatistics.class.cast(obj);
+ return Objects.equal(this.groups, that.groups);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues()
+ .add("groups", groups).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Memory.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Memory.java
new file mode 100644
index 0000000000..af3b0767b6
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Memory.java
@@ -0,0 +1,66 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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 com.google.common.base.Objects;
+
+/**
+ * Represents the memory of a virtual server.
+ *
+ * @author Dies Koper
+ */
+public class Memory implements Comparable {
+ @XmlElement(name = "memorySize")
+ private double size;
+
+ public double getSize() {
+ return size;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(size);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Memory that = Memory.class.cast(obj);
+ return Objects.equal(this.size, that.size);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues().add("size", size)
+ .toString();
+ }
+
+ @Override
+ public int compareTo(Memory o) {
+ return Double.compare(size, o.size);
+ }
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/NAT.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/NAT.java
new file mode 100644
index 0000000000..a753ed8395
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/NAT.java
@@ -0,0 +1,65 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.LinkedHashSet;
+import java.util.Set;
+
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Holds the network address translation rules of a firewall.
+ *
+ * @author Dies Koper
+ */
+public class NAT {
+ private Set rules = new LinkedHashSet();
+
+ /**
+ * @return the rules
+ */
+ public Set getRules() {
+ return rules == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(rules);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(rules);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ NAT that = NAT.class.cast(obj);
+ return Objects.equal(this.rules, that.rules);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues()
+ .add("rules", rules).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/PerformanceInfo.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/PerformanceInfo.java
new file mode 100644
index 0000000000..e9d9856182
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/PerformanceInfo.java
@@ -0,0 +1,149 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.Objects;
+
+/**
+ * Holds the statistics of a virtual server.
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "performanceinfo")
+public class PerformanceInfo implements Comparable {
+ private long recordTime;
+ private double cpuUtilization;
+ private long diskReadRequestCount;
+ private long diskWriteRequestCount;
+ private long diskReadSector;
+ private long diskWriteSector;
+ private long nicInputByte;
+ private long nicOutputByte;
+ private long nicInputPacket;
+ private long nicOutputPacket;
+
+ /**
+ * @return the recordTime
+ */
+ public long getRecordTime() {
+ return recordTime;
+ }
+
+ /**
+ * @return the cpuUtilization
+ */
+ public double getCpuUtilization() {
+ return cpuUtilization;
+ }
+
+ /**
+ * @return the diskReadRequestCount
+ */
+ public long getDiskReadRequestCount() {
+ return diskReadRequestCount;
+ }
+
+ /**
+ * @return the diskWriteRequestCount
+ */
+ public long getDiskWriteRequestCount() {
+ return diskWriteRequestCount;
+ }
+
+ /**
+ * @return the diskReadSector
+ */
+ public long getDiskReadSector() {
+ return diskReadSector;
+ }
+
+ /**
+ * @return the diskWriteSector
+ */
+ public long getDiskWriteSector() {
+ return diskWriteSector;
+ }
+
+ /**
+ * @return the nicInputByte
+ */
+ public long getNicInputByte() {
+ return nicInputByte;
+ }
+
+ /**
+ * @return the nicOutputByte
+ */
+ public long getNicOutputByte() {
+ return nicOutputByte;
+ }
+
+ /**
+ * @return the nicInputPacket
+ */
+ public long getNicInputPacket() {
+ return nicInputPacket;
+ }
+
+ /**
+ * @return the nicOutputPacket
+ */
+ public long getNicOutputPacket() {
+ return nicOutputPacket;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(recordTime);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ PerformanceInfo that = PerformanceInfo.class.cast(obj);
+ return Objects.equal(this.recordTime, that.recordTime);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues()
+ .add("recordTime", recordTime)
+ .add("cpuUtilization", cpuUtilization)
+ .add("diskReadRequestCount", diskReadRequestCount)
+ .add("diskWriteRequestCount", diskWriteRequestCount)
+ .add("diskReadSector", diskReadSector)
+ .add("diskWriteSector", diskWriteSector)
+ .add("nicInputByte", nicInputByte)
+ .add("nicOutputByte", nicOutputByte)
+ .add("nicInputPacket", nicInputPacket)
+ .add("nicOutputPacket", nicOutputPacket).toString();
+ }
+
+ @Override
+ public int compareTo(PerformanceInfo o) {
+ return (int) (recordTime - o.recordTime);
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Period.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Period.java
new file mode 100644
index 0000000000..b75173fe6c
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Period.java
@@ -0,0 +1,61 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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;
+
+/**
+ * Describes the period over which error statistics of a load balancer (SLB) are
+ * kept.
+ *
+ * @author Dies Koper
+ */
+public class Period {
+ private String current;
+ private String before;
+ private String today;
+ private String yesterday;
+
+ /**
+ * @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;
+ }
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Policy.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Policy.java
new file mode 100644
index 0000000000..e030c12793
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Policy.java
@@ -0,0 +1,195 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.XmlEnumValue;
+
+import com.google.common.base.Objects;
+
+/**
+ * Describes a firewall rule in detail.
+ *
+ * @author Dies Koper
+ */
+public class Policy implements Comparable {
+ private int id;
+
+ private String src;
+
+ private PolicyType srcType;
+
+ private String srcPort;
+
+ private Service dstService;
+
+ private String dst;
+
+ private PolicyType dstType;
+
+ private String dstPort;
+
+ private Protocol protocol;
+
+ private Action action;
+
+ private Log log;
+
+ enum Service {
+ NONE, WSUS, DNS, NTP, @XmlEnumValue("yum")
+ YUM, KMS, @XmlEnumValue("Symantec")
+ SYMANTEC, RHUI
+ }
+
+ enum PolicyType {IP, FQDN, FQDNF}
+
+ enum Protocol {
+ @XmlEnumValue("tcp")
+ TCP, @XmlEnumValue("udp")
+ UDP, @XmlEnumValue("tcp-udp")
+ TCP_UDP, @XmlEnumValue("icmp")
+ ICMP
+ }
+
+ enum Action {
+ @XmlEnumValue("Accept")
+ ACCEPT, @XmlEnumValue("Deny")
+ DENY
+ }
+
+ enum Log {
+ @XmlEnumValue("On")
+ ON, @XmlEnumValue("Off")
+ OFF
+ }
+
+ /**
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+
+ /**
+ * @return the src
+ */
+ public String getSrc() {
+ return src;
+ }
+
+ /**
+ * @return the srcType
+ */
+ public PolicyType getSrcType() {
+ return srcType;
+ }
+
+ /**
+ * @return the srcPort
+ */
+ public String getSrcPort() {
+ return srcPort;
+ }
+
+ /**
+ * @return the dstService
+ */
+ public Service getDstService() {
+ return dstService;
+ }
+
+ /**
+ * @return the dst
+ */
+ public String getDst() {
+ return dst;
+ }
+
+ /**
+ * @return the dstType
+ */
+ public PolicyType getDstType() {
+ return dstType;
+ }
+
+ /**
+ * @return the dstPort
+ */
+ public String getDstPort() {
+ return dstPort;
+ }
+
+ /**
+ * @return the protocol
+ */
+ public Protocol getProtocol() {
+ return protocol;
+ }
+
+ /**
+ * @return the action
+ */
+ public Action getAction() {
+ return action;
+ }
+
+ /**
+ * @return the log
+ */
+ public Log getLog() {
+ return log;
+ }
+
+ @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;
+ Policy that = Policy.class.cast(obj);
+ return Objects.equal(this.id, that.id);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues()
+ .add("id", id)
+ .add("src", src)
+ .add("srcType", srcType)
+ .add("srcPort", srcPort)
+ .add("dstService", dstService)
+ .add("dst", dst)
+ .add("dstType", dstType)
+ .add("dstPort", dstPort)
+ .add("protocol", protocol)
+ .add("action", action)
+ .add("log", log).toString();
+ }
+
+ @Override
+ public int compareTo(Policy o) {
+ return id - o.id;
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Product.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Product.java
new file mode 100644
index 0000000000..447f81ea04
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Product.java
@@ -0,0 +1,84 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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 com.google.common.base.Objects;
+
+/**
+ * Represents a product for which usage information can be queried.
+ *
+ * @author Dies Koper
+ */
+public class Product {
+ @XmlElement(name = "productName")
+ private String name;
+
+ private String unitName;
+
+ private String usedPoints;
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the unitName
+ */
+ public String getUnitName() {
+ return unitName;
+ }
+
+ /**
+ * @return the usedPoints
+ */
+ public String getUsedPoints() {
+ return usedPoints;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(name, unitName, usedPoints);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Product that = Product.class.cast(obj);
+ return Objects.equal(this.name, that.name)
+ && Objects.equal(this.unitName, that.unitName)
+ && Objects.equal(this.usedPoints, that.usedPoints);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues().add("name", name)
+ .add("unitName", unitName).add("usedPoints", usedPoints)
+ .toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/PublicIP.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/PublicIP.java
new file mode 100644
index 0000000000..698c462cee
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/PublicIP.java
@@ -0,0 +1,94 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.XmlElement;
+
+import com.google.common.base.CaseFormat;
+import com.google.common.base.Objects;
+
+/**
+ * Represents a public IP address.
+ *
+ * A public IP address can be allocated to a virtual system, then needs to be
+ * enabled/attached before it can be mapped to a virtual server by configuring
+ * the NAT settings of virtual system's firewall.
+ *
+ * @author Dies Koper
+ */
+public class PublicIP {
+
+ public static enum Version {
+ IPv4, IPv6, UNRECOGNIZED;
+
+ @Override
+ public String toString() {
+ return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL,
+ name());
+ }
+
+ public static Version fromValue(String version) {
+ try {
+ return valueOf(CaseFormat.UPPER_CAMEL.to(
+ CaseFormat.UPPER_UNDERSCORE,
+ checkNotNull(version, "version")));
+ } catch (IllegalArgumentException e) {
+ return UNRECOGNIZED;
+ }
+ }
+
+ }
+
+ protected String address;
+ @XmlElement(name = "v4v6Flag")
+ protected Version version;
+
+ public String getAddress() {
+ return address;
+ }
+
+ public Version getVersion() {
+ return version;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(address);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ PublicIP that = PublicIP.class.cast(obj);
+ return Objects.equal(this.address, that.address);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues()
+ .add("address", address).add("version", version).toString();
+ }
+}
\ No newline at end of file
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/PublicIPStatus.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/PublicIPStatus.java
new file mode 100644
index 0000000000..3b10c95e35
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/PublicIPStatus.java
@@ -0,0 +1,57 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.CaseFormat;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Possible statuses of a public IP address.
+ *
+ * An attached public IP address is enabled for a particular virtual system and
+ * or may not be mapped to a virtual server.
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "publicipStatus")
+public enum PublicIPStatus {
+ ATTACHED, ATTACHING, DETACHING, DETACHED, UNRECOGNIZED;
+
+ public String value() {
+ return (CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name()));
+ }
+
+ @Override
+ public String toString() {
+ return value();
+ }
+
+ public static PublicIPStatus fromValue(String status) {
+ try {
+ return valueOf(CaseFormat.UPPER_CAMEL
+ .to(CaseFormat.UPPER_UNDERSCORE,
+ checkNotNull(status, "status")));
+ } catch (IllegalArgumentException e) {
+ return UNRECOGNIZED;
+ }
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Rule.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Rule.java
new file mode 100644
index 0000000000..6cd979822f
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Rule.java
@@ -0,0 +1,84 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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 com.google.common.base.Objects;
+
+/**
+ * Represents a network address translation or network address port translation
+ * rule.
+ *
+ * A rule either maps a public IP address to the NIC of a virtual server for
+ * incoming network traffic, or specifies the public IP address used as source
+ * address for traffic from all servers in the virtual system.
+ *
+ * @author Dies Koper
+ */
+public class Rule {
+ private String publicIp;
+ private String privateIp;
+ private boolean snapt;
+
+ /**
+ * @return the publicIp
+ */
+ public String getPublicIp() {
+ return publicIp;
+ }
+
+ /**
+ * @return the privateIp
+ */
+ public String getPrivateIp() {
+ return privateIp;
+ }
+
+ /**
+ * @return the snapt
+ */
+ public boolean isSnapt() {
+ return snapt;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(privateIp, publicIp, snapt);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Rule that = Rule.class.cast(obj);
+ return Objects.equal(this.privateIp, that.privateIp)
+ && Objects.equal(this.publicIp, that.publicIp)
+ && Objects.equal(this.snapt, that.snapt);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues()
+ .add("privateIp", privateIp).add("publicIp", publicIp)
+ .add("snapt", snapt).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/SLB.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/SLB.java
new file mode 100644
index 0000000000..274c3b8caa
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/SLB.java
@@ -0,0 +1,200 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.LinkedHashSet;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlRootElement;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Represents a software load balancer.
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "slb")
+public class SLB extends BuiltinServer {
+ private String ipAddress;
+
+ private Set ccacerts = new LinkedHashSet();
+
+ private Set servercerts = new LinkedHashSet();
+
+ private Set groups;
+
+ private String srcType;
+
+ private String srcPort;
+
+ private String status;
+
+ private ErrorStatistics errorStatistics;
+
+ private LoadStatistics loadStatistics;
+
+ private String category;
+
+ private String latestVersion;
+
+ private String comment;
+
+ private boolean firmUpdateExist;
+
+ private boolean configUpdateExist;
+
+ private boolean backout;
+
+ private String updateDate;
+
+ private String currentVersion;
+
+ private String webAccelerator;
+
+ /**
+ * @return the ipAddress
+ */
+ public String getIpAddress() {
+ return ipAddress;
+ }
+
+ /**
+ * @return the ccacerts
+ */
+ public Set getCcacerts() {
+ return ccacerts == null ? ImmutableSet. of()
+ : ImmutableSet.copyOf(ccacerts);
+ }
+
+ /**
+ * @return the servercerts
+ */
+ public Set getServercerts() {
+ return servercerts == null ? ImmutableSet. of()
+ : ImmutableSet.copyOf(servercerts);
+ }
+
+ /**
+ * @return the groups
+ */
+ public Set getGroups() {
+ return groups == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(groups);
+ }
+
+ /**
+ * @return the srcType
+ */
+ public String getSrcType() {
+ return srcType;
+ }
+
+ /**
+ * @return the srcPort
+ */
+ public String getSrcPort() {
+ return srcPort;
+ }
+
+ /**
+ * @return the status
+ */
+ public String getStatus() {
+ return status;
+ }
+
+ /**
+ * @return the errorStatistics
+ */
+ public ErrorStatistics getErrorStatistics() {
+ return errorStatistics;
+ }
+
+ /**
+ * @return the loadStatistics
+ */
+ public LoadStatistics getLoadStatistics() {
+ return loadStatistics;
+ }
+
+ /**
+ * @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 boolean getBackout() {
+ return backout;
+ }
+
+ /**
+ * @return the updateDate
+ */
+ public String getUpdateDate() {
+ return updateDate;
+ }
+
+ /**
+ * @return the currentVersion
+ */
+ public String getCurrentVersion() {
+ return currentVersion;
+ }
+
+ /**
+ * @return the webAccelerator
+ */
+ public String getWebAccelerator() {
+ return webAccelerator;
+ }
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/ServerCert.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/ServerCert.java
new file mode 100644
index 0000000000..d1dfc0698f
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/ServerCert.java
@@ -0,0 +1,121 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.Objects;
+
+/**
+ * Describes a server certificate for use with a load balancer (SLB).
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "servercert")
+public class ServerCert implements Comparable {
+ private int certNum;
+
+ private String subject;
+
+ private String issuer;
+
+ private String validity;
+
+ private int groupId;
+
+ private String detail;
+
+ /**
+ * @return the certNum
+ */
+ public int getCertNum() {
+ return certNum;
+ }
+
+ /**
+ * @return the subject
+ */
+ public String getSubject() {
+ return subject;
+ }
+
+ /**
+ * @return the issuer
+ */
+ public String getIssuer() {
+ return issuer;
+ }
+
+ /**
+ * @return the validity
+ */
+ public String getValidity() {
+ return validity;
+ }
+
+ /**
+ * @return the groupId
+ */
+ public int getGroupId() {
+ return groupId;
+ }
+
+ /**
+ * @return the detail
+ */
+ public String getDetail() {
+ return detail;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(certNum, groupId, issuer, subject, validity);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ServerCert that = ServerCert.class.cast(obj);
+ return Objects.equal(this.certNum, that.certNum)
+ && Objects.equal(this.groupId, that.groupId)
+ && Objects.equal(this.issuer, that.issuer)
+ && Objects.equal(this.subject, that.subject)
+ && Objects.equal(this.validity, that.validity);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues()
+ .add("certNum", certNum).add("issuer", issuer)
+ .add("subject", subject).add("validity", validity)
+ .add("groupId", groupId).add("detail", detail).toString();
+ }
+
+ @Override
+ public int compareTo(ServerCert o) {
+ return (certNum - o.certNum) == 0 ? (groupId - o.groupId)
+ : (certNum - o.certNum);
+ }
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/ServerType.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/ServerType.java
new file mode 100644
index 0000000000..b4a724809b
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/ServerType.java
@@ -0,0 +1,145 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.Objects;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+
+/**
+ * Describes the hardware of a virtual server.
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "servertype")
+public class ServerType implements Comparable {
+ private String id;
+
+ private String name;
+
+ private String label;
+
+ private String comment;
+
+ private String productId;
+
+ private String productName;
+
+ private String price;
+
+ private String chargeType;
+
+ private String expectedUsage;
+
+ private CPU cpu;
+
+ private Memory memory;
+
+ @XmlElementWrapper(name = "disks")
+ @XmlElement(name = "disk")
+ private Set disks = Sets.newLinkedHashSet();
+
+ public String getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public String getComment() {
+ return comment;
+ }
+
+ public String getProductId() {
+ return productId;
+ }
+
+ public String getProductName() {
+ return productName;
+ }
+
+ public String getPrice() {
+ return price;
+ }
+
+ public String getChargeType() {
+ return chargeType;
+ }
+
+ public String getExpectedUsage() {
+ return expectedUsage;
+ }
+
+ public CPU getCpu() {
+ return cpu;
+ }
+
+ public Memory getMemory() {
+ return memory;
+ }
+
+ public Set getDisks() {
+ return disks == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(disks);
+ }
+
+ @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;
+ ServerType that = ServerType.class.cast(obj);
+ return Objects.equal(this.id, that.id);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues().add("id", id)
+ .add("name", name).add("label", label).add("comment", comment)
+ .add("productId", productId).add("productName", productName)
+ .add("price", price).add("chargeType", chargeType)
+ .add("expectedUsage", expectedUsage).add("cpu", cpu)
+ .add("memory", memory).add("disks", disks).toString();
+ }
+
+ @Override
+ public int compareTo(ServerType o) {
+ return memory == null ? -1 : memory.compareTo(o.memory);
+ }
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Software.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Software.java
new file mode 100644
index 0000000000..cfff2a682e
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Software.java
@@ -0,0 +1,103 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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 com.google.common.base.Objects;
+
+/**
+ * Represents the software installed on a disk.
+ *
+ * @author Dies Koper
+ */
+public class Software {
+ private String name;
+
+ private String id;
+
+ private String category;
+
+ private String version;
+
+ private String officialVersion;
+
+ private String patch;
+
+ private String license;
+
+ private String support;
+
+ public String getName() {
+ return name;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public String getCategory() {
+ return category;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public String getOfficialVersion() {
+ return officialVersion;
+ }
+
+ public String getPatch() {
+ return patch;
+ }
+
+ public String getLicense() {
+ return license;
+ }
+
+ public String getSupport() {
+ return support;
+ }
+
+ @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;
+ Software that = Software.class.cast(obj);
+ return Objects.equal(this.id, that.id);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues().add("id", id)
+ .add("name", name).add("category", category)
+ .add("version", version)
+ .add("officialVersion", officialVersion)
+ .add("support", support).add("patch", patch)
+ .add("license", license).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Target.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Target.java
new file mode 100644
index 0000000000..44cd0fe727
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/Target.java
@@ -0,0 +1,126 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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 com.google.common.base.Objects;
+
+/**
+ * Describes the target server of a load balancer.
+ *
+ * @author Dies Koper
+ */
+public class Target {
+ private String serverId;
+
+ private String serverName;
+
+ private String ipAddress;
+
+ private String port1;
+
+ private String port2;
+
+ private String status;
+
+ private String now;
+
+ private String peak;
+
+ /**
+ * @return the serverId
+ */
+ public String getServerId() {
+ return serverId;
+ }
+
+ /**
+ * @return the serverName
+ */
+ public String getServerName() {
+ return serverName;
+ }
+
+ /**
+ * @return the ipAddress
+ */
+ public String getIpAddress() {
+ return ipAddress;
+ }
+
+ /**
+ * @return the port1
+ */
+ public String getPort1() {
+ return port1;
+ }
+
+ /**
+ * @return the port2
+ */
+ public String getPort2() {
+ return port2;
+ }
+
+ /**
+ * @return the status
+ */
+ public String getStatus() {
+ return status;
+ }
+
+ /**
+ * @return the now
+ */
+ public String getNow() {
+ return now;
+ }
+
+ /**
+ * @return the peak
+ */
+ public String getPeak() {
+ return peak;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(serverId);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ Target that = Target.class.cast(obj);
+ return Objects.equal(this.serverId, that.serverId);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues()
+ .add("serverId", serverId).add("serverName", serverName)
+ .add("ipAddress", ipAddress).add("port1", port1)
+ .add("port2", port2).add("status", status).add("now", now)
+ .add("peak", peak).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/UsageInfo.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/UsageInfo.java
new file mode 100644
index 0000000000..48cffa4b05
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/UsageInfo.java
@@ -0,0 +1,94 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.LinkedHashSet;
+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.Objects;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Describes the usage by a virtual system.
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "usageinfo")
+public class UsageInfo {
+ @XmlElement(name = "vsysId")
+ private String systemId;
+ @XmlElement(name = "vsysName")
+ private String systemName;
+
+ @XmlElementWrapper(name = "products")
+ @XmlElement(name = "product")
+ private Set products = new LinkedHashSet();
+
+ /**
+ * @return the systemId
+ */
+ public String getSystemId() {
+ return systemId;
+ }
+
+ /**
+ * @return the systemName
+ */
+ public String getSystemName() {
+ return systemName;
+ }
+
+ /**
+ * @return the products
+ */
+ public Set getProducts() {
+ return products == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(products);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(systemId, systemName, products);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ UsageInfo that = UsageInfo.class.cast(obj);
+ return Objects.equal(this.systemId, that.systemId)
+ && Objects.equal(this.systemName, that.systemName)
+ && Objects.equal(this.products, that.products);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues()
+ .add("systemId", systemId).add("systemName", systemName)
+ .add("products", products).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VDisk.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VDisk.java
new file mode 100644
index 0000000000..e8784c4a98
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VDisk.java
@@ -0,0 +1,86 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.Objects;
+
+/**
+ * Represents attachable storage in the form of a virtual disk.
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "vdisk")
+public class VDisk {
+ @XmlElement(name = "diskId")
+ private String id;
+ @XmlElement(name = "diskName")
+ private String name;
+ @XmlElement(name = "attachedTo")
+ private String attachedServer;
+ private String creator;
+ private double size;
+
+ public String getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getAttachedServer() {
+ return attachedServer;
+ }
+
+ public String getCreator() {
+ return creator;
+ }
+
+ public double getSize() {
+ return size;
+ }
+
+ @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;
+ VDisk that = VDisk.class.cast(obj);
+ return Objects.equal(this.id, that.id);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues().add("id", id)
+ .add("name", name).add("attachedServer", attachedServer)
+ .add("creator", creator).add("size", size).toString();
+ }
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VDiskStatus.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VDiskStatus.java
new file mode 100644
index 0000000000..cc4459426c
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VDiskStatus.java
@@ -0,0 +1,55 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.CaseFormat;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Possible statuses of an attachable virtual disk.
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "vdiskStatus")
+public enum VDiskStatus {
+
+ NORMAL, BACKUP_ING, DEPLOYING, DETACHING, ATTACHING, RESTORING, ERROR, UNRECOGNIZED;
+
+ public String value() {
+ return (CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name()));
+ }
+
+ @Override
+ public String toString() {
+ return value();
+ }
+
+ public static VDiskStatus fromValue(String status) {
+ try {
+ return valueOf(CaseFormat.UPPER_CAMEL
+ .to(CaseFormat.UPPER_UNDERSCORE,
+ checkNotNull(status, "status")));
+ } catch (IllegalArgumentException e) {
+ return UNRECOGNIZED;
+ }
+ }
+}
\ No newline at end of file
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VNIC.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VNIC.java
new file mode 100644
index 0000000000..6fbf0770c2
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VNIC.java
@@ -0,0 +1,73 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.Objects;
+
+/**
+ * Represents a virtual network interface card (NIC).
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "vnic")
+public class VNIC {
+ private String networkId;
+
+ private String privateIp;
+
+ private int nicNo;
+
+ public String getNetworkId() {
+ return networkId;
+ }
+
+ public String getPrivateIp() {
+ return privateIp;
+ }
+
+ public int getNicNo() {
+ return nicNo;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(networkId);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ VNIC that = VNIC.class.cast(obj);
+ return Objects.equal(this.networkId, that.networkId);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues()
+ .add("networkId", networkId).add("privateIp", privateIp)
+ .add("nicNo", nicNo).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VNet.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VNet.java
new file mode 100644
index 0000000000..77210c146e
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VNet.java
@@ -0,0 +1,61 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.Objects;
+
+/**
+ * Represents a virtual network.
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "vnet")
+public class VNet {
+
+ private String networkId;
+
+ public String getNetworkId() {
+ return networkId;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(networkId);
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ VNet that = VNet.class.cast(obj);
+ return Objects.equal(this.networkId, that.networkId);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).add("networkId", networkId)
+ .toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VServer.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VServer.java
new file mode 100644
index 0000000000..b3db2991cc
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VServer.java
@@ -0,0 +1,84 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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 com.google.common.base.Objects;
+
+/**
+ * Represents a virtual server.
+ *
+ * @author Dies Koper
+ */
+public class VServer {
+ @XmlElement(name = "vserverId")
+ protected String id;
+ @XmlElement(name = "vserverName")
+ protected String name;
+ @XmlElement(name = "vserverType")
+ protected String type;
+ protected String diskimageId;
+ protected String creator;
+
+ public String getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public String getDiskimageId() {
+ return diskimageId;
+ }
+
+ public String getCreator() {
+ return creator;
+ }
+
+ @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;
+ VServer that = VServer.class.cast(obj);
+ return Objects.equal(this.id, that.id);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues().add("id", id)
+ .add("name", name).add("type", type).add("creator", creator)
+ .add("diskimageId", diskimageId).toString();
+ }
+
+}
\ No newline at end of file
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VServerStatus.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VServerStatus.java
new file mode 100644
index 0000000000..8576538965
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VServerStatus.java
@@ -0,0 +1,54 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.CaseFormat;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Possible statuses of a virtual server.
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "vserverStatus")
+public enum VServerStatus {
+ DEPLOYING, RUNNING, STOPPING, STOPPED, STARTING, FAILOVER, UNEXPECTED_STOP, RESTORING, BACKUP_ING, ERROR, START_ERROR, STOP_ERROR, CHANGE_TYPE, REGISTERING, UNRECOGNIZED;
+
+ public String value() {
+ return (CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name()));
+ }
+
+ @Override
+ public String toString() {
+ return value();
+ }
+
+ public static VServerStatus fromValue(String status) {
+ try {
+ return valueOf(CaseFormat.UPPER_CAMEL
+ .to(CaseFormat.UPPER_UNDERSCORE,
+ checkNotNull(status, "status")));
+ } catch (IllegalArgumentException e) {
+ return UNRECOGNIZED;
+ }
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VServerWithDetails.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VServerWithDetails.java
new file mode 100644
index 0000000000..d9613a41c2
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VServerWithDetails.java
@@ -0,0 +1,59 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.LinkedHashSet;
+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.Objects;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Represents a virtual server with virtual storage and NICs.
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "vserver")
+public class VServerWithDetails extends VServerWithVNICs {
+ @XmlElementWrapper(name = "vdisks")
+ @XmlElement(name = "vdisk")
+ protected Set vdisks = new LinkedHashSet();
+ protected Image image;
+
+ public Set getVdisks() {
+ return vdisks == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(vdisks);
+ }
+
+ public Image getImage() {
+ return image;
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues().add("id", id)
+ .add("name", name).add("type", type).add("creator", creator)
+ .add("diskimageId", diskimageId).add("vdisks", vdisks)
+ .add("vnics", vnics).add("image", image).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VServerWithVNICs.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VServerWithVNICs.java
new file mode 100644
index 0000000000..3117241320
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VServerWithVNICs.java
@@ -0,0 +1,29 @@
+package org.jclouds.fujitsu.fgcp.domain;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+
+import com.google.common.base.Objects;
+import com.google.common.collect.ImmutableSet;
+
+public class VServerWithVNICs extends VServer {
+
+ @XmlElementWrapper(name = "vnics")
+ @XmlElement(name = "vnic")
+ protected Set vnics = new LinkedHashSet();
+
+ public Set getVnics() {
+ return vnics == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(vnics);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues().add("id", id)
+ .add("name", name).add("type", type).add("creator", creator)
+ .add("diskimageId", diskimageId).add("vnics", vnics).toString();
+ }
+}
\ No newline at end of file
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VSystem.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VSystem.java
new file mode 100644
index 0000000000..ae86034ce3
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VSystem.java
@@ -0,0 +1,84 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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 com.google.common.base.Objects;
+
+/**
+ * Represents a virtual system.
+ *
+ * @author Dies Koper
+ */
+public class VSystem {
+ @XmlElement(name = "vsysId")
+ protected String id;
+ @XmlElement(name = "vsysName")
+ protected String name;
+ protected String creator;
+ @XmlElement(name = "baseDescriptor")
+ protected String template;
+ protected String description;
+
+ public String getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getCreator() {
+ return creator;
+ }
+
+ public String getTemplate() {
+ return template;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ @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;
+ VSystem that = VSystem.class.cast(obj);
+ return Objects.equal(this.id, that.id);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues().add("id", id)
+ .add("name", name).add("creator", creator)
+ .add("template", template).add("description", description)
+ .toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VSystemDescriptor.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VSystemDescriptor.java
new file mode 100644
index 0000000000..46f448ab9d
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VSystemDescriptor.java
@@ -0,0 +1,104 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.LinkedHashSet;
+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.collect.ImmutableSet;
+
+/**
+ * Describes a virtual system template.
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "vsysdescriptor")
+public class VSystemDescriptor {
+ @XmlElement(name = "vsysdescriptorId")
+ private String id;
+
+ @XmlElement(name = "vsysdescriptorName")
+ private String name;
+
+ private String creatorName;
+
+ private String registrant;
+
+ private String description;
+
+ private String keyword;
+
+ @XmlElementWrapper(name = "vservers")
+ @XmlElement(name = "vserver")
+ private Set servers = new LinkedHashSet();
+
+ /**
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the creatorName
+ */
+ public String getCreatorName() {
+ return creatorName;
+ }
+
+ /**
+ * @return the registrant
+ */
+ public String getRegistrant() {
+ return registrant;
+ }
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * @return the keyword
+ */
+ public String getKeyword() {
+ return keyword;
+ }
+
+ /**
+ * @return the servers
+ */
+ public Set getServers() {
+ return servers == null ? ImmutableSet. of()
+ : ImmutableSet.copyOf(servers);
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VSystemStatus.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VSystemStatus.java
new file mode 100644
index 0000000000..58e6e7a048
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VSystemStatus.java
@@ -0,0 +1,54 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.CaseFormat;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+/**
+ * Possible statuses of a virtual system.
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "vsysStatus")
+public enum VSystemStatus {
+ NORMAL, RECONFIG_ING, DEPLOYING, ERROR, UNRECOGNIZED;
+
+ public String value() {
+ return (CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name()));
+ }
+
+ @Override
+ public String toString() {
+ return value();
+ }
+
+ public static VSystemStatus fromValue(String status) {
+ try {
+ return valueOf(CaseFormat.UPPER_CAMEL
+ .to(CaseFormat.UPPER_UNDERSCORE,
+ checkNotNull(status, "status")));
+ } catch (IllegalArgumentException e) {
+ return UNRECOGNIZED;
+ }
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VSystemWithDetails.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VSystemWithDetails.java
new file mode 100644
index 0000000000..16839889a7
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/VSystemWithDetails.java
@@ -0,0 +1,80 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.LinkedHashSet;
+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.Objects;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Represents a virtual system with servers, additional storage, public IP
+ * addresses and networks.
+ *
+ * @author Dies Koper
+ */
+@XmlRootElement(name = "vsys")
+public class VSystemWithDetails extends VSystem {
+ @XmlElementWrapper(name = "vservers")
+ @XmlElement(name = "vserver")
+ private Set servers = new LinkedHashSet();
+ @XmlElementWrapper(name = "vdisks")
+ @XmlElement(name = "vdisk")
+ private Set disks = new LinkedHashSet();
+ @XmlElementWrapper(name = "publicips")
+ @XmlElement(name = "publicip")
+ private Set publicips = new LinkedHashSet();
+ @XmlElementWrapper(name = "vnets")
+ @XmlElement(name = "vnet")
+ private Set networks = new LinkedHashSet();
+
+ public Set getServers() {
+ return servers == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(servers);
+ }
+
+ public Set getDisks() {
+ return disks == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(disks);
+ }
+
+ public Set getPublicips() {
+ return publicips == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(publicips);
+ }
+
+ public Set getNetworks() {
+ return networks == null ? ImmutableSet. of() : ImmutableSet
+ .copyOf(networks);
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).omitNullValues().add("id", id)
+ .add("name", name).add("creator", creator)
+ .add("template", template).add("description", description)
+ .add("disks", disks).add("networks", networks)
+ .add("publicips", publicips).add("servers", servers).toString();
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/package-info.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/package-info.java
new file mode 100644
index 0000000000..4f79fc1182
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/domain/package-info.java
@@ -0,0 +1,26 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.
+ */
+@XmlSchema(namespace = "http://apioviss.jp.fujitsu.com", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+@XmlAccessorType(XmlAccessType.FIELD)
+package org.jclouds.fujitsu.fgcp.domain;
+
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlSchema;
+
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/filters/RequestAuthenticator.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/filters/RequestAuthenticator.java
new file mode 100644
index 0000000000..9fecf69ca3
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/filters/RequestAuthenticator.java
@@ -0,0 +1,242 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.filters;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.io.UnsupportedEncodingException;
+import java.security.InvalidKeyException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.PrivateKey;
+import java.security.Signature;
+import java.security.UnrecoverableKeyException;
+import java.util.Calendar;
+import java.util.Locale;
+
+import javax.annotation.Resource;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+import javax.ws.rs.HttpMethod;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.UriBuilder;
+
+import org.jclouds.Constants;
+import org.jclouds.crypto.CryptoStreams;
+import org.jclouds.date.TimeStamp;
+import org.jclouds.encryption.internal.Base64;
+import org.jclouds.fujitsu.fgcp.reference.RequestParameters;
+import org.jclouds.http.HttpException;
+import org.jclouds.http.HttpRequest;
+import org.jclouds.http.HttpRequestFilter;
+import org.jclouds.http.HttpUtils;
+import org.jclouds.http.internal.SignatureWire;
+import org.jclouds.http.utils.Queries;
+import org.jclouds.logging.Logger;
+import org.jclouds.rest.RequestSigner;
+import org.jclouds.rest.annotations.ApiVersion;
+import org.jclouds.rest.annotations.Credential;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.collect.Multimap;
+
+/**
+ * Generates and signs the access key id and adds the mandatory http header and
+ * request parameters to the request.
+ *
+ * @author Dies Koper
+ */
+@Singleton
+public class RequestAuthenticator implements HttpRequestFilter, RequestSigner {
+
+ @Resource
+ @Named(Constants.LOGGER_SIGNATURE)
+ private Logger signatureLog = Logger.NULL;
+
+ final Provider calendarProvider;
+ final Signature signer;
+ final Provider builder;
+ final String apiVersion;
+
+ public String signatureVersion = "1.0";
+ public String signatureMethod = "SHA1withRSA";
+
+ private HttpUtils utils;
+
+ @Inject
+ public RequestAuthenticator(@TimeStamp Provider calendarProvider,
+ Provider keyStoreProvider,
+ @Credential String keyPassword, Provider builder,
+ HttpUtils utils, SignatureWire signatureWire,
+ @ApiVersion String apiVersion) throws NoSuchAlgorithmException,
+ InvalidKeyException, KeyStoreException, UnrecoverableKeyException {
+ this.calendarProvider = checkNotNull(calendarProvider);
+ this.builder = checkNotNull(builder);
+ this.utils = checkNotNull(utils, "utils");
+ this.apiVersion = checkNotNull(apiVersion, "apiVersion");
+
+ signer = Signature.getInstance(signatureMethod);
+
+ KeyStore keyStore = checkNotNull(keyStoreProvider).get();
+ String alias = keyStore.aliases().nextElement(); // there should be only
+ // one private key
+ PrivateKey privateKey = (PrivateKey) keyStore.getKey(alias,
+ keyPassword.toCharArray());
+
+ signer.initSign(privateKey);
+ }
+
+ public HttpRequest filter(HttpRequest request) throws HttpException {
+ checkNotNull(request, "request must be present");
+
+ utils.logRequest(signatureLog, request, ">>");
+
+ // create accesskeyid
+ String accessKeyId = createStringToSign(request);
+ String signature = sign(accessKeyId);
+
+ // leaving this in for now for reference in case I need it for multipart
+ // POSTs
+ // add parameters. Note that in case of a GET, url escaping is required
+ /*
+ * Multimap decodedParams = null; if
+ * (HttpMethod.GET.equals(request.getMethod())) { decodedParams =
+ * ModifyRequest.parseQueryToMap(request.getEndpoint().getRawQuery());
+ *
+ * } else if (HttpMethod.POST.equals(request.getMethod())) {
+ * decodedParams =
+ * ModifyRequest.parseQueryToMap(request.getPayload().getRawContent()
+ * .toString()); }
+ *
+ * checkNotNull(decodedParams, "no query params found");
+ * System.out.println("filter: request params before: " +
+ * decodedParams.toString()); addAuthenticationParams(decodedParams,
+ * accessKeyId, signature); addLocaleParam(decodedParams);
+ * System.out.println("filter: request params after : " +
+ * decodedParams.toString()); if (signatureWire.enabled())
+ * signatureWire.output(decodedParams);
+ *
+ *
+ * request = setPayload(request, decodedParams);
+ */
+ // only "en" and "ja" are allowed
+ String lang = Locale.JAPANESE.getLanguage().equals(
+ Locale.getDefault().getLanguage()) ? Locale.JAPANESE
+ .getLanguage() : Locale.ENGLISH.getLanguage();
+
+ if (HttpMethod.GET.equals(request.getMethod())) {
+ Multimap decodedParams = Queries
+ .parseQueryToMap(request.getEndpoint().getRawQuery());
+
+ if (!decodedParams.containsKey(RequestParameters.VERSION)) {
+ decodedParams.put(RequestParameters.VERSION, apiVersion);
+ }
+ decodedParams.put(RequestParameters.LOCALE, lang);
+ decodedParams.put(RequestParameters.ACCESS_KEY_ID, accessKeyId);
+ decodedParams.put(RequestParameters.SIGNATURE, signature);
+ request = request.toBuilder().replaceQueryParams(decodedParams)
+ .build();
+ } else {
+
+ String payload = request.getPayload().getRawContent().toString();
+ payload = createXmlElementWithValue(payload,
+ RequestParameters.VERSION, apiVersion);
+ payload = createXmlElementWithValue(payload,
+ RequestParameters.LOCALE, lang);
+ payload = createXmlElementWithValue(payload,
+ RequestParameters.ACCESS_KEY_ID, accessKeyId);
+ payload = createXmlElementWithValue(payload,
+ RequestParameters.SIGNATURE, signature);
+
+ // ensure there are no other query params left
+ request.setPayload(payload);
+ request.getPayload().getContentMetadata()
+ .setContentType(MediaType.TEXT_XML);
+ }
+
+ // may need to do this elsewhere (see ConvertToGaeRequest)
+ HttpRequest filteredRequest = request.toBuilder()
+ .replaceHeader(HttpHeaders.USER_AGENT, "OViSS-API-CLIENT")
+ .build();
+
+ utils.logRequest(signatureLog, filteredRequest, ">>->");
+
+ return filteredRequest;
+ }
+
+ String createXmlElementWithValue(String payload, String tag, String value) {
+ String startTag = String.format("<%s>", tag);
+ String endTag = String.format("%s>", tag);
+
+ return payload.replace(startTag + endTag, startTag + value + endTag);
+ }
+
+ /*
+ * HttpRequest setPayload(HttpRequest request, Multimap
+ * decodedParams) {
+ * request.setPayload(ModifyRequest.makeQueryLine(decodedParams, null)); //
+ * request.getPayload().getContentMetadata().setContentType(
+ * "application/x-www-form-urlencoded"); return request; }
+ */
+
+ @VisibleForTesting
+ public String sign(String stringToSign) {
+ String signed;
+
+ try {
+ signer.update(stringToSign.getBytes("UTF-8"));
+ signed = Base64.encodeBytes(signer.sign()).replace("\n", "\r\n");
+// signed = CryptoStreams.base64(signer.sign());
+ } catch (Exception e) {
+ throw new HttpException("error signing request", e);
+ }
+ // if (signatureWire.enabled())
+ // signatureWire.input(Strings2.toInputStream(signed));
+
+ return signed;
+ }
+
+ @VisibleForTesting
+ public String generateAccessKeyId() {
+ Calendar cal = calendarProvider.get();
+ String timezone = cal.getTimeZone().getDisplayName(Locale.ENGLISH);
+ String expires = String.valueOf(cal.getTime().getTime());
+
+ String signatureData = String.format("%s&%s&%s&%s", timezone, expires,
+ signatureVersion, signatureMethod);
+ try {
+ String accessKeyId = Base64.encodeBytes(signatureData.getBytes("UTF-8"));
+ return accessKeyId.replace("\n", "\r\n");
+// return CryptoStreams.base64(signatureData.getBytes("UTF-8")).;
+ } catch (UnsupportedEncodingException e) {
+ throw new RuntimeException(e); // should never happen as
+ // signatureData contains only ASCII
+ }
+ }
+
+ @Override
+ public String createStringToSign(HttpRequest input) {
+ return generateAccessKeyId();
+ }
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/handlers/FGCPRetryIfNotProxyAuthenticationFailureHandler.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/handlers/FGCPRetryIfNotProxyAuthenticationFailureHandler.java
new file mode 100644
index 0000000000..0104aaf61c
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/handlers/FGCPRetryIfNotProxyAuthenticationFailureHandler.java
@@ -0,0 +1,47 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.handlers;
+
+import com.google.inject.Singleton;
+import org.jclouds.http.HttpCommand;
+import org.jclouds.http.HttpResponse;
+import org.jclouds.http.HttpRetryHandler;
+import org.jclouds.logging.Logger;
+
+import javax.annotation.Resource;
+
+/**
+ * Created by IntelliJ IDEA.
+ *
+ * @author Dies Koper
+ */
+@Singleton
+public class FGCPRetryIfNotProxyAuthenticationFailureHandler implements
+ HttpRetryHandler {
+ @Resource
+ protected Logger logger = Logger.NULL;
+
+ @Override
+ public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) {
+ int statusCode = response.getStatusCode();
+ System.out.println("Response status code: " + statusCode);
+ logger.error("StatusCode", statusCode);
+ return true;
+ }
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/http/SSLContextWithKeysSupplier.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/http/SSLContextWithKeysSupplier.java
new file mode 100644
index 0000000000..c0e20196a5
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/http/SSLContextWithKeysSupplier.java
@@ -0,0 +1,71 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.http;
+
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.UnrecoverableKeyException;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.TrustManager;
+
+import org.jclouds.http.HttpUtils;
+import org.jclouds.http.config.SSLModule.TrustAllCerts;
+import org.jclouds.rest.annotations.Credential;
+
+import com.google.common.base.Supplier;
+
+/**
+ * SSLContext supplier with a configured key manager to enable client
+ * authentication with certificates.
+ *
+ * @author Dies Koper
+ */
+@Singleton
+public class SSLContextWithKeysSupplier implements Supplier {
+ private SSLContext sc;
+
+ @Inject
+ SSLContextWithKeysSupplier(KeyStore keyStore,
+ @Credential String keyStorePassword, HttpUtils utils,
+ TrustAllCerts trustAllCerts) throws NoSuchAlgorithmException,
+ KeyStoreException, UnrecoverableKeyException,
+ KeyManagementException {
+
+ TrustManager[] trustManager = null;
+ if (utils.trustAllCerts()) {
+ trustManager = new TrustManager[] { trustAllCerts };
+ }
+ KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
+ kmf.init(keyStore, keyStorePassword.toCharArray());
+ sc = SSLContext.getInstance("TLS");
+ sc.init(kmf.getKeyManagers(), trustManager, new SecureRandom());
+ }
+
+ @Override
+ public SSLContext get() {
+ return sc;
+ }
+}
\ No newline at end of file
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/location/SystemAndNetworkSegmentToLocationSupplier.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/location/SystemAndNetworkSegmentToLocationSupplier.java
new file mode 100644
index 0000000000..569d3aedb8
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/location/SystemAndNetworkSegmentToLocationSupplier.java
@@ -0,0 +1,120 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.location;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.ExecutionException;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+import org.jclouds.domain.Location;
+import org.jclouds.domain.LocationBuilder;
+import org.jclouds.domain.LocationScope;
+import org.jclouds.fujitsu.fgcp.FGCPAsyncApi;
+import org.jclouds.fujitsu.fgcp.domain.VNet;
+import org.jclouds.fujitsu.fgcp.domain.VSystem;
+import org.jclouds.fujitsu.fgcp.domain.VSystemWithDetails;
+import org.jclouds.location.suppliers.LocationsSupplier;
+import org.jclouds.location.suppliers.all.RegionToProviderOrJustProvider;
+
+import com.google.common.base.Throwables;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.ImmutableSet.Builder;
+import com.google.common.collect.Iterables;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * Builds location hierarchy by querying the back-end for the networks of all
+ * virtual systems.
+ *
+ * Example:
+ *
+ *
+ *
+ * >location provider fgcp(-au)
+ * -> location region au/nsw
+ * --> location system vsys
+ * ---> location network DMZ/SECURE1/SECURE2
+ *
+ *
+ * Todo: caching - provider/region won't change. if vsys still exists, network
+ * won't change
+ *
+ * @author Dies Koper
+ */
+@Singleton
+public class SystemAndNetworkSegmentToLocationSupplier implements
+ LocationsSupplier {
+
+ private final RegionToProviderOrJustProvider regionProvider;
+ private FGCPAsyncApi api;
+
+ @Inject
+ SystemAndNetworkSegmentToLocationSupplier(
+ RegionToProviderOrJustProvider regionProvider, FGCPAsyncApi api) {
+ this.regionProvider = checkNotNull(regionProvider,
+ "regionToProviderOrJustProvider");
+ this.api = checkNotNull(api, "api");
+ }
+
+ @Override
+ public Set get() {
+ Builder locations = ImmutableSet.builder();
+ try {
+ List> futures = new ArrayList>();
+ for (VSystem system : api.getVirtualDCApi().listVirtualSystems()
+ .get()) {
+
+ futures.add(api.getVirtualSystemApi()
+ .getDetails(system.getId()));
+ }
+ for (VSystemWithDetails system : Futures.successfulAsList(futures)
+ .get()) {
+
+ Location systemLocation = new LocationBuilder()
+ .scope(LocationScope.SYSTEM)
+ .parent(Iterables.getOnlyElement(regionProvider.get()))
+ .description(system.getName()).id(system.getId())
+ .build();
+
+ for (VNet net : system.getNetworks()) {
+
+ locations.add(new LocationBuilder()
+ .scope(LocationScope.NETWORK)
+ .parent(systemLocation)
+ .description(
+ net.getNetworkId().replaceFirst(
+ ".+(DMZ|SECURE.)", "\\1"))
+ .id(net.getNetworkId()).build());
+ }
+ }
+ } catch (InterruptedException e) {
+ throw Throwables.propagate(e);
+ } catch (ExecutionException e) {
+ throw Throwables.propagate(e);
+ }
+ return locations.build();
+ }
+}
\ No newline at end of file
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/reference/RequestParameters.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/reference/RequestParameters.java
new file mode 100644
index 0000000000..d4870c540d
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/reference/RequestParameters.java
@@ -0,0 +1,81 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.reference;
+
+/**
+ * Configuration parameters and constants used in HTTP requests.
+ *
+ * @author Dies Koper
+ */
+public interface RequestParameters {
+
+ /**
+ * Indicates the action to perform. Example: ListVSYS
+ */
+ public static final String ACTION = "Action";
+
+ /**
+ * The API version to use. Example: 2011-01-31
+ */
+ public static final String VERSION = "Version";
+
+ /**
+ * The locale to use. Example: en
+ */
+ public static final String LOCALE = "Locale";
+
+ /**
+ * The Access Key ID for the request sender. This identifies the account
+ * which will be charged for usage of the service. The account with which
+ * the Access Key ID is associated must be signed up for FGCP, or requests
+ * will not be accepted. AKIADQKE4SARGYLE
+ */
+ public static final String ACCESS_KEY_ID = "AccessKeyId";
+
+ /**
+ * The date and time at which the request is signed, in the format
+ * YYYY-MM-DDThh:mm:ssZ. For more information, go to ISO 8601. Example:
+ * 2006-07-07T15:04:56Z
+ */
+ public static final String TIMESTAMP = "Timestamp";
+
+ /**
+ * The date and time at which the signer included in the request expires, in
+ * the format YYYY-MM-DDThh:mm:ssZ. Example: 2006-07-07T15:04:56Z
+ */
+ public static final String EXPIRES = "Expires";
+
+ /**
+ * The request signer. For more information, go to the Amazon Elastic
+ * Compute Cloud Developer Guide. Example: Qnpl4Qk/7tINHzfXCiT7VbBatDA=
+ */
+ public static final String SIGNATURE = "Signature";
+
+ /**
+ * The hash algorithm you use to create the request signer. Valid value:
+ * SHA1withRSA.
+ */
+ public static final String SIGNATURE_METHOD = "SignatureMethod";
+
+ /**
+ * The signer version you use to sign the request. Set this value to 1.0.
+ *
+ */
+ public static final String SIGNATURE_VERSION = "SignatureVersion";
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/AdditionalDiskApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/AdditionalDiskApi.java
new file mode 100644
index 0000000000..2b4cbb658a
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/AdditionalDiskApi.java
@@ -0,0 +1,53 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.domain.VDisk;
+import org.jclouds.fujitsu.fgcp.domain.VDiskStatus;
+
+/**
+ * API relating to additional storage.
+ *
+ * @author Dies Koper
+ */
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface AdditionalDiskApi {
+
+ VDiskStatus getStatus(String id);
+
+ VDisk get(String id);
+
+ void update(String id, String name, String value);
+
+ void backup(String id);
+
+ void restore(String systemId, String backupId);
+
+ void destroy(String id);
+
+ void detach(String diskId, String serverId);
+
+ void destroyBackup(String sysId, String backupId);
+
+ // Set<> listBackups(String sysId);
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/AdditionalDiskAsyncApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/AdditionalDiskAsyncApi.java
new file mode 100644
index 0000000000..440be5baf9
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/AdditionalDiskAsyncApi.java
@@ -0,0 +1,112 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.FGCPAsyncApi;
+import org.jclouds.fujitsu.fgcp.binders.BindAlsoToSystemId;
+import org.jclouds.fujitsu.fgcp.compute.functions.SingleElementResponseToElement;
+import org.jclouds.fujitsu.fgcp.domain.VDisk;
+import org.jclouds.fujitsu.fgcp.domain.VDiskStatus;
+import org.jclouds.fujitsu.fgcp.filters.RequestAuthenticator;
+import org.jclouds.fujitsu.fgcp.reference.RequestParameters;
+import org.jclouds.rest.annotations.BinderParam;
+import org.jclouds.rest.annotations.JAXBResponseParser;
+import org.jclouds.rest.annotations.PayloadParams;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.Transform;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * Non-blocking API relating to additional storage.
+ *
+ * @author Dies Koper
+ */
+@RequestFilters(RequestAuthenticator.class)
+@QueryParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@PayloadParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@Consumes(MediaType.TEXT_XML)
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface AdditionalDiskAsyncApi {
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "GetVDiskStatus")
+ @Transform(SingleElementResponseToElement.class)
+ ListenableFuture getStatus(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("vdiskId") String id);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "GetVDiskAttributes")
+ @Transform(SingleElementResponseToElement.class)
+ ListenableFuture get(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("vdiskId") String id);
+
+ @GET
+ @QueryParams(keys = "Action", values = "UpdateVDiskAttribute")
+ ListenableFuture update(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("vdiskId") String id,
+ @QueryParam("attributeName") String name,
+ @QueryParam("attributeValue") String value);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "BackupVDisk")
+ ListenableFuture backup(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("vdiskId") String id);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "RestoreVDisk")
+ ListenableFuture restore(@QueryParam("vsysId") String systemId,
+ @QueryParam("backupId") String backupId);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "DestroyVDisk")
+ ListenableFuture destroy(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("vdiskId") String id);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "DetachVDisk")
+ ListenableFuture detach(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("vdiskId") String diskId,
+ @QueryParam("vserverId") String serverId);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "DestroyVDiskBackup")
+ ListenableFuture destroyBackup(@QueryParam("vsysId") String sysId,
+ @QueryParam("backupId") String backupId);
+
+ // Set<> listBackups(String sysId);
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/BuiltinServerApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/BuiltinServerApi.java
new file mode 100644
index 0000000000..274b1fbce3
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/BuiltinServerApi.java
@@ -0,0 +1,73 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServer;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServerBackup;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServerConfiguration;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServerStatus;
+
+/**
+ * API relating to built-in servers, also called extended function module (EFM),
+ * such as a firewall or load balancer (SLB).
+ *
+ * @author Dies Koper
+ */
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface BuiltinServerApi {
+
+ void start(String id);
+
+ void stop(String id);
+
+ void destroy(String id);
+
+ void backup(String id);
+
+ void restore(String id, String backupId);
+
+ Set listBackups(String id);
+
+ void destroyBackup(String id, String backupId);
+
+ BuiltinServer get(String id);
+
+ void update(String id, String name, String value);
+
+ BuiltinServerStatus getStatus(String id);
+
+ BuiltinServer getConfiguration(String id, BuiltinServerConfiguration configuration);
+
+ // BuiltinServer getConfiguration(String id, BuiltinServerConfiguration configuration, ConfigurationRequest request);
+ // void updateConfiguration(String id, xml?);
+ /*
+getDNSConfiguration(String id)
+getNATConfiguration(String id)
+getPolicyConfiguration(String id)
+getLBConfiguration(String id)
+
+ * UpdateEFMConfiguration
+ BuiltinServer getConfiguration(String id, BuiltinServerConfiguration configuration);
+
+ */
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/BuiltinServerAsyncApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/BuiltinServerAsyncApi.java
new file mode 100644
index 0000000000..569577fc4d
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/BuiltinServerAsyncApi.java
@@ -0,0 +1,145 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.FGCPAsyncApi;
+import org.jclouds.fujitsu.fgcp.binders.BindAlsoToSystemId;
+import org.jclouds.fujitsu.fgcp.compute.functions.SingleElementResponseToElement;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServer;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServerBackup;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServerConfiguration;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServerStatus;
+import org.jclouds.fujitsu.fgcp.filters.RequestAuthenticator;
+import org.jclouds.fujitsu.fgcp.reference.RequestParameters;
+import org.jclouds.rest.annotations.BinderParam;
+import org.jclouds.rest.annotations.JAXBResponseParser;
+import org.jclouds.rest.annotations.PayloadParams;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.Transform;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * Non-blocking API relating to built-in servers, also called extended function
+ * module (EFM), such as a firewall or load balancer (SLB).
+ *
+ * @author Dies Koper
+ */
+@RequestFilters(RequestAuthenticator.class)
+@QueryParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@PayloadParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@Consumes(MediaType.TEXT_XML)
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface BuiltinServerAsyncApi {
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "StartEFM")
+ ListenableFuture start(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("efmId") String id);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "StopEFM")
+ ListenableFuture stop(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("efmId") String id);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "DestroyEFM")
+ ListenableFuture destroy(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("efmId") String id);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "BackupEFM")
+ ListenableFuture backup(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("efmId") String id);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "RestoreEFM")
+ ListenableFuture restore(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("efmId") String id,
+ @QueryParam("backupId") String backupId);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "ListEFMBackup")
+ ListenableFuture> listBackups(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("efmId") String id);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "DestroyEFMBackup")
+ ListenableFuture destroyBackup(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("efmId") String id,
+ @QueryParam("backupId") String backupId);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "GetEFMAttributes")
+ @Transform(SingleElementResponseToElement.class)
+ ListenableFuture get(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("efmId") String id);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "UpdateEFMAttribute")
+ ListenableFuture update(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("efmId") String id,
+ @QueryParam("attributeName") String name,
+ @QueryParam("attributeValue") String value);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "GetEFMStatus")
+ @Transform(SingleElementResponseToElement.class)
+ ListenableFuture getStatus(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("efmId") String id);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "GetEFMConfiguration")
+ @Transform(SingleElementResponseToElement.class)
+ ListenableFuture getConfiguration(
+ @BinderParam(BindAlsoToSystemId.class) @QueryParam("efmId") String id,
+ @QueryParam("configurationName") BuiltinServerConfiguration configuration);
+
+// @POST
+// @JAXBResponseParser
+// @QueryParams(keys = "Action", values = "GetEFMConfiguration")
+// @Transform(SingleElementResponseToElement.class)
+// ListenableFuture> getUpdateDetails(String id);
+
+ // ListenableFuture
+ // updateConfiguration(@BinderParam(BindAlsoToSystemId.class)
+ // @QueryParam("efmId") String id, xml?);
+// EFM_UPDATE, getUpdateStatus(String id);
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/DiskImageApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/DiskImageApi.java
new file mode 100644
index 0000000000..610e61dbeb
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/DiskImageApi.java
@@ -0,0 +1,39 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.concurrent.TimeUnit;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.domain.DiskImage;
+
+/**
+ * API relating to disk images.
+ *
+ * @author Dies Koper
+ */
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface DiskImageApi {
+
+ DiskImage get(String id);
+
+ void update(String diskImageId, String localeId, String name, String value);
+
+ void deregister(String id);
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/DiskImageAsyncApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/DiskImageAsyncApi.java
new file mode 100644
index 0000000000..9b4d613f2f
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/DiskImageAsyncApi.java
@@ -0,0 +1,73 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.concurrent.TimeUnit;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.FGCPAsyncApi;
+import org.jclouds.fujitsu.fgcp.compute.functions.SingleElementResponseToElement;
+import org.jclouds.fujitsu.fgcp.domain.DiskImage;
+import org.jclouds.fujitsu.fgcp.filters.RequestAuthenticator;
+import org.jclouds.fujitsu.fgcp.reference.RequestParameters;
+import org.jclouds.rest.annotations.JAXBResponseParser;
+import org.jclouds.rest.annotations.PayloadParams;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.Transform;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * Non-blocking API relating to disk images.
+ *
+ * @author Dies Koper
+ */
+@RequestFilters(RequestAuthenticator.class)
+@QueryParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@PayloadParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@Consumes(MediaType.TEXT_XML)
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface DiskImageAsyncApi {
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "GetDiskImageAttributes")
+ @Transform(SingleElementResponseToElement.class)
+ ListenableFuture get(@QueryParam("diskImageId") String id);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "UpdateDiskImageAttribute")
+ ListenableFuture update(
+ @QueryParam("diskImageId") String diskImageId,
+ @QueryParam("updateLcId") String localeId,
+ @QueryParam("attributeName") String name,
+ @QueryParam("attributeValue") String value);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "UnregisterDiskImage")
+ ListenableFuture deregister(@QueryParam("diskImageId") String id);
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/FirewallApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/FirewallApi.java
new file mode 100644
index 0000000000..bfe54e95f7
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/FirewallApi.java
@@ -0,0 +1,37 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.domain.Rule;
+
+/**
+ * API relating to a system's built-in server of type firewall.
+ *
+ * @author Dies Koper
+ */
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface FirewallApi extends BuiltinServerApi {
+
+ Set getNATConfiguration(String id);
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/FirewallAsyncApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/FirewallAsyncApi.java
new file mode 100644
index 0000000000..df06dc9d5f
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/FirewallAsyncApi.java
@@ -0,0 +1,79 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.FGCPAsyncApi;
+import org.jclouds.fujitsu.fgcp.binders.BindAlsoToSystemId;
+import org.jclouds.fujitsu.fgcp.compute.functions.SingleElementResponseToElement;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServer;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServerBackup;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServerConfiguration;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServerStatus;
+import org.jclouds.fujitsu.fgcp.domain.Rule;
+import org.jclouds.fujitsu.fgcp.filters.RequestAuthenticator;
+import org.jclouds.fujitsu.fgcp.reference.RequestParameters;
+import org.jclouds.rest.annotations.BinderParam;
+import org.jclouds.rest.annotations.JAXBResponseParser;
+import org.jclouds.rest.annotations.PayloadParams;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.Transform;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * Non-blocking API relating to a built-in server, also called extended function
+ * module (EFM), of type firewall.
+ *
+ * @author Dies Koper
+ */
+@RequestFilters(RequestAuthenticator.class)
+@QueryParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@PayloadParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@Consumes(MediaType.TEXT_XML)
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface FirewallAsyncApi extends BuiltinServerAsyncApi {
+
+ @POST
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "GetEFMConfiguration")
+ @Transform(SingleElementResponseToElement.class)
+ ListenableFuture> getNATConfiguration(String id);
+
+ /*
+ FW_NAT_RULE, getNATConfiguration(String id)
+
+ FW_DNS, getDNSConfiguration(String id)
+ FW_POLICY, getPolicyConfiguration(String id)
+
+ FW_LOG, getFirewallLogs(String id);
+ FW_LIMIT_POLICY,
+
+ */
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/LoadBalancerApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/LoadBalancerApi.java
new file mode 100644
index 0000000000..d1c6309a53
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/LoadBalancerApi.java
@@ -0,0 +1,33 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.concurrent.TimeUnit;
+
+import org.jclouds.concurrent.Timeout;
+
+/**
+ * API relating to a built-in server of type software load balancer (SLB).
+ *
+ * @author Dies Koper
+ */
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface LoadBalancerApi extends BuiltinServerApi {
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/LoadBalancerAsyncApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/LoadBalancerAsyncApi.java
new file mode 100644
index 0000000000..a7a645201b
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/LoadBalancerAsyncApi.java
@@ -0,0 +1,69 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.FGCPAsyncApi;
+import org.jclouds.fujitsu.fgcp.binders.BindAlsoToSystemId;
+import org.jclouds.fujitsu.fgcp.compute.functions.SingleElementResponseToElement;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServer;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServerBackup;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServerConfiguration;
+import org.jclouds.fujitsu.fgcp.domain.BuiltinServerStatus;
+import org.jclouds.fujitsu.fgcp.filters.RequestAuthenticator;
+import org.jclouds.fujitsu.fgcp.reference.RequestParameters;
+import org.jclouds.rest.annotations.BinderParam;
+import org.jclouds.rest.annotations.JAXBResponseParser;
+import org.jclouds.rest.annotations.PayloadParams;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.Transform;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * Non-blocking API relating to a built-in server, also called extended function
+ * module (EFM), of type load balancer (SLB).
+ *
+ * @author Dies Koper
+ */
+@RequestFilters(RequestAuthenticator.class)
+@QueryParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@PayloadParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@Consumes(MediaType.TEXT_XML)
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface LoadBalancerAsyncApi extends BuiltinServerAsyncApi {
+
+ /*
+ SLB_RULE, getLBConfiguration(String id)
+ SLB_LOAD_STATISTICS, getLoadBalancerStats(String id)
+ SLB_ERROR_STATISTICS, getLoadBalancerErrorStats(String id)
+ SLB_CERTIFICATE_LIST, getLoadBalancerCerts(String id)
+ SLB_CONNECTION, getLoadBalancerConnection(String id)
+
+ */
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/PublicIPAddressApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/PublicIPAddressApi.java
new file mode 100644
index 0000000000..9bb40355ac
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/PublicIPAddressApi.java
@@ -0,0 +1,44 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.concurrent.TimeUnit;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.domain.PublicIP;
+import org.jclouds.fujitsu.fgcp.domain.PublicIPStatus;
+
+/**
+ * API relating to public IP addresses.
+ *
+ * @author Dies Koper
+ */
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface PublicIPAddressApi {
+
+ void attach(String systemId, String ip);
+
+ void detach(String systemId, String ip);
+
+ void free(String systemId, String ip);
+
+ PublicIPStatus getStatus(String ip);
+
+ PublicIP get(String ip);
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/PublicIPAddressAsyncApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/PublicIPAddressAsyncApi.java
new file mode 100644
index 0000000000..0b50dc7fa5
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/PublicIPAddressAsyncApi.java
@@ -0,0 +1,87 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.FGCPAsyncApi;
+import org.jclouds.fujitsu.fgcp.compute.functions.SingleElementResponseToElement;
+import org.jclouds.fujitsu.fgcp.domain.PublicIP;
+import org.jclouds.fujitsu.fgcp.domain.PublicIPStatus;
+import org.jclouds.fujitsu.fgcp.filters.RequestAuthenticator;
+import org.jclouds.fujitsu.fgcp.reference.RequestParameters;
+import org.jclouds.rest.annotations.JAXBResponseParser;
+import org.jclouds.rest.annotations.PayloadParams;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.Transform;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * Non-blocking API relating to public IP addresses.
+ *
+ * @author Dies Koper
+ */
+@RequestFilters(RequestAuthenticator.class)
+@QueryParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@PayloadParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@Consumes(MediaType.TEXT_XML)
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface PublicIPAddressAsyncApi {
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "AttachPublicIP")
+ ListenableFuture attach(@QueryParam("vsysId") String systemId,
+ @QueryParam("publicIp") String ip);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "DetachPublicIP")
+ ListenableFuture detach(@QueryParam("vsysId") String systemId,
+ @QueryParam("publicIp") String ip);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "GetPublicIPStatus")
+ @Transform(SingleElementResponseToElement.class)
+ ListenableFuture getStatus(
+ @QueryParam("publicIp") String ip);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "GetPublicIPAttributes")
+ @Transform(SingleElementResponseToElement.class)
+ ListenableFuture get(@QueryParam("publicIp") String ip);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "FreePublicIP")
+ ListenableFuture free(@QueryParam("vsysId") String systemId,
+ @QueryParam("publicIp") String ip);
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/SystemTemplateApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/SystemTemplateApi.java
new file mode 100644
index 0000000000..e995a72de4
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/SystemTemplateApi.java
@@ -0,0 +1,43 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.concurrent.TimeUnit;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.domain.VSystemDescriptor;
+
+/**
+ * API relating to system templates, also referred to as virtual system
+ * descriptors.
+ *
+ * @author Dies Koper
+ */
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface SystemTemplateApi {
+
+ VSystemDescriptor get(String id);
+
+ void update(String id, String localeId, String name, String value);
+
+ void deregister(String id);
+
+ void deregisterPrivateTemplate(String id);
+
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/SystemTemplateAsyncApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/SystemTemplateAsyncApi.java
new file mode 100644
index 0000000000..74a93b2b3d
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/SystemTemplateAsyncApi.java
@@ -0,0 +1,81 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.concurrent.TimeUnit;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.FGCPAsyncApi;
+import org.jclouds.fujitsu.fgcp.compute.functions.SingleElementResponseToElement;
+import org.jclouds.fujitsu.fgcp.domain.VSystemDescriptor;
+import org.jclouds.fujitsu.fgcp.filters.RequestAuthenticator;
+import org.jclouds.fujitsu.fgcp.reference.RequestParameters;
+import org.jclouds.rest.annotations.JAXBResponseParser;
+import org.jclouds.rest.annotations.PayloadParams;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.Transform;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * Non-blocking API relating to system templates, also referred to as virtual
+ * system descriptors.
+ *
+ * @author Dies Koper
+ */
+@RequestFilters(RequestAuthenticator.class)
+@QueryParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@PayloadParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@Consumes(MediaType.TEXT_XML)
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface SystemTemplateAsyncApi {
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "GetVSYSDescriptorConfiguration")
+ @Transform(SingleElementResponseToElement.class)
+ ListenableFuture get(
+ @QueryParam("vsysDescriptorId") String id);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "UpdateVSYSDescriptorAttribute")
+ ListenableFuture update(@QueryParam("vsysDescriptorId") String id,
+ @QueryParam("updateLcId") String localeId,
+ @QueryParam("attributeName") String name,
+ @QueryParam("attributeValue") String value);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "UnregisterVSYSDescriptor")
+ ListenableFuture deregister(
+ @QueryParam("vsysDescriptorId") String id);
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "UnregisterPrivateVSYSDescriptor")
+ ListenableFuture deregisterPrivateTemplate(
+ @QueryParam("vsysDescriptorId") String id);
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/VirtualDCApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/VirtualDCApi.java
new file mode 100644
index 0000000000..bb3ec3597a
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/VirtualDCApi.java
@@ -0,0 +1,75 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.domain.*;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * API relating to the virtual data center.
+ *
+ * @author Dies Koper
+ */
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface VirtualDCApi {
+
+ String createVirtualSystem(String descriptorId, String name);
+
+ Set listVirtualSystems();
+
+ // according to the manual it takes a 'String diskImageId' but value seems
+ // to be ignored
+ Set listServerTypes();
+
+ Set listDiskImages();
+
+ Set listDiskImages(String serverCategory,
+ String vsysDescriptorId);
+
+ Map listPublicIPs();
+
+ void addAddressRange(String pipFrom, String pipTo);
+
+ void createAddressPool(String pipFrom, String pipTo);
+
+ void deleteAddressRange(String pipFrom, String pipTo);
+
+ Set getAddressRange();
+
+ Set listVSYSDescriptor();
+
+ Set listVSYSDescriptor(String keyword, int estimateFrom,
+ int estimateTo);
+
+ Set getEventLogs(boolean all);
+
+ Set getEventLogs();
+
+ Set getInformation(boolean all);
+
+ Set getInformation();
+
+ Set getSystemUsage();
+
+ Set getSystemUsage(String systemIds);
+}
diff --git a/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/VirtualDCAsyncApi.java b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/VirtualDCAsyncApi.java
new file mode 100644
index 0000000000..ec4bad9629
--- /dev/null
+++ b/labs/fgcp/src/main/java/org/jclouds/fujitsu/fgcp/services/VirtualDCAsyncApi.java
@@ -0,0 +1,189 @@
+/**
+ * Licensed to jclouds, Inc. (jclouds) under one or more
+ * contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. jclouds 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.services;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jclouds.concurrent.Timeout;
+import org.jclouds.fujitsu.fgcp.FGCPAsyncApi;
+import org.jclouds.fujitsu.fgcp.compute.functions.SingleElementResponseToElement;
+import org.jclouds.fujitsu.fgcp.domain.AddressRange;
+import org.jclouds.fujitsu.fgcp.domain.DiskImage;
+import org.jclouds.fujitsu.fgcp.domain.EventLog;
+import org.jclouds.fujitsu.fgcp.domain.Information;
+import org.jclouds.fujitsu.fgcp.domain.PublicIP;
+import org.jclouds.fujitsu.fgcp.domain.ServerType;
+import org.jclouds.fujitsu.fgcp.domain.UsageInfo;
+import org.jclouds.fujitsu.fgcp.domain.VSystem;
+import org.jclouds.fujitsu.fgcp.domain.VSystemDescriptor;
+import org.jclouds.fujitsu.fgcp.filters.RequestAuthenticator;
+import org.jclouds.fujitsu.fgcp.reference.RequestParameters;
+import org.jclouds.rest.annotations.JAXBResponseParser;
+import org.jclouds.rest.annotations.PayloadParams;
+import org.jclouds.rest.annotations.QueryParams;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.Transform;
+
+import com.google.common.util.concurrent.ListenableFuture;
+
+/**
+ * Non-blocking API relating to the virtual data center.
+ *
+ * @author Dies Koper
+ */
+@RequestFilters(RequestAuthenticator.class)
+@QueryParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@PayloadParams(keys = RequestParameters.VERSION, values = FGCPAsyncApi.VERSION)
+@Consumes(MediaType.TEXT_XML)
+@Timeout(duration = 60, timeUnit = TimeUnit.SECONDS)
+public interface VirtualDCAsyncApi {
+
+ // @POST
+ @GET
+ @JAXBResponseParser
+ // @XMLResponseParser(VSYSCreateHandler.class)
+ @QueryParams(keys = "Action", values = "CreateVSYS")
+ @Transform(SingleElementResponseToElement.class)
+ // @PayloadParams(keys = "Action", values = "CreateVSYS")
+ // @Produces(MediaType.TEXT_XML)
+ // @MapBinder(BindParamsToXmlPayload.class)
+ // ListenableFuture
+ // createVirtualSystem(@PayloadParam("vsysDescriptorId") String
+ // vsysDescriptorId, @PayloadParam("vsysName") String vsysName);
+ ListenableFuture createVirtualSystem(
+ @QueryParam("vsysDescriptorId") String descriptorId,
+ @QueryParam("vsysName") String name);
+
+ @GET
+ @JAXBResponseParser
+ // @XMLResponseParser(VSYSListHandler.class)
+ @QueryParams(keys = "Action", values = "ListVSYS")
+ ListenableFuture> listVirtualSystems();
+
+ @GET
+ @JAXBResponseParser
+ // according to the manual it takes a 'String diskImageId' but value seems
+ // to be ignored
+ @QueryParams(keys = { "Action", "diskImageId" }, values = {
+ "ListServerType", "dummy" })
+ // @XmlJavaTypeAdapter(SetOfServerTypesXMLAdapter.class)
+ // @XmlElement(type = ServerType.class)
+ ListenableFuture> listServerTypes();
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "ListDiskImage")
+ ListenableFuture> listDiskImages();
+
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "ListDiskImage")
+ ListenableFuture> listDiskImages(
+ @QueryParam("serverCategory") String serverCategory,
+ @QueryParam("vsysDescriptorId") String vsysDescriptorId);
+
+ /**
+ *
+ * @return
+ * @see VirtualSystemAsyncApi#listPublicIPs(String)
+ */
+ @GET
+ @JAXBResponseParser
+ @QueryParams(keys = "Action", values = "ListPublicIP")
+ ListenableFuture