Initial Server Interface commit

git-svn-id: http://jclouds.googlecode.com/svn/trunk@2341 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
ivan@ivan.net.nz 2009-11-28 23:30:57 +00:00
parent c66eb4c389
commit 44ec84c8aa
5 changed files with 82 additions and 0 deletions

View File

@ -114,6 +114,11 @@
<artifactId>gson</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.google.common</groupId>
<artifactId>google-guava</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>

View File

@ -0,0 +1,12 @@
package org.jclouds.servers;
import com.google.common.base.Service;
/**
* @author Ivan Meredith
*/
public interface Instance extends Service {
String getId();
String getTag();
}

View File

@ -0,0 +1,19 @@
package org.jclouds.servers;
import java.util.SortedSet;
import java.util.concurrent.Future;
/**
* @author Ivan Meredith
*/
public interface Platform {
public String getId();
public Future<Instance> createInstance();
public Instance createInstanceAndWait();
public Instance getInstance(String id);
public SortedSet<Instance> listInstances();
}

View File

@ -0,0 +1,27 @@
package org.jclouds.servers;
import com.google.common.base.Service;
import java.util.SortedSet;
import java.util.concurrent.Future;
/**
* @author Ivan Meredith
*/
public interface Server extends Service {
public String getId();
public State rebootAndWait();
public Future<State> reboot();
public Boolean supportsPlatforms();
public Platform createPlatform(String id/*, Archive archive , mount? */);
public Platform getPlatform(String id);
public SortedSet<Platform> listPlatforms();
public SortedSet<Instance> listInstances(/* platform("mybilling-1.0.1").tags("production" */);
}

View File

@ -0,0 +1,19 @@
package org.jclouds.servers;
import java.util.SortedSet;
import java.util.concurrent.Future;
/**
* TODO: better name?
*
* @author Ivan Meredith
*/
public interface ServerService {
public Server createServerAndWait(String name, String profile, String image);
public Future<Server> createServer(String name, String profile, String image);
public SortedSet<Server> listServers();
public Server getServer(String id);
}