mirror of https://github.com/apache/jclouds.git
Convert fake interfaces to utility classes
This commit is contained in:
parent
dc3011469b
commit
200481300d
|
@ -21,49 +21,53 @@ package org.jclouds.openstack.v2_0;
|
||||||
* A service provides one or more endpoints through which users can access resources and perform
|
* A service provides one or more endpoints through which users can access resources and perform
|
||||||
* (presumably useful) operations.
|
* (presumably useful) operations.
|
||||||
*/
|
*/
|
||||||
public interface ServiceType {
|
public final class ServiceType {
|
||||||
/**
|
/**
|
||||||
* Object Storage (Swift)
|
* Object Storage (Swift)
|
||||||
*/
|
*/
|
||||||
String OBJECT_STORE = "object-store";
|
public static final String OBJECT_STORE = "object-store";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compute (Nova)
|
* Compute (Nova)
|
||||||
*/
|
*/
|
||||||
String COMPUTE = "compute";
|
public static final String COMPUTE = "compute";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Image Service (Glance)
|
* Image Service (Glance)
|
||||||
*/
|
*/
|
||||||
String IMAGE = "image";
|
public static final String IMAGE = "image";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identity Service (Keystone)
|
* Identity Service (Keystone)
|
||||||
*/
|
*/
|
||||||
String IDENTITY = "identity";
|
public static final String IDENTITY = "identity";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Network Service (Neutron)
|
* Network Service (Neutron)
|
||||||
*/
|
*/
|
||||||
String NETWORK = "network";
|
public static final String NETWORK = "network";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Block Storage (Cinder)
|
* Block Storage (Cinder)
|
||||||
*/
|
*/
|
||||||
String BLOCK_STORAGE = "volume";
|
public static final String BLOCK_STORAGE = "volume";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database Service (Trove)
|
* Database Service (Trove)
|
||||||
*/
|
*/
|
||||||
String DATABASE = "database";
|
public static final String DATABASE = "database";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Queues Service (Marconi)
|
* Queues Service (Marconi)
|
||||||
*/
|
*/
|
||||||
String QUEUES = "queuing";
|
public static final String QUEUES = "queuing";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Orchestration Service (Heat)
|
* Orchestration Service (Heat)
|
||||||
*/
|
*/
|
||||||
String ORCHESTRATION = "orchestration";
|
public static final String ORCHESTRATION = "orchestration";
|
||||||
|
|
||||||
|
private ServiceType() {
|
||||||
|
throw new AssertionError("intentionally unimplemented");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,49 +20,53 @@ package org.jclouds.rackspace.cloudidentity.v2_0;
|
||||||
* An Rackspace service, such as Cloud Load Balancers, DNS, etc.
|
* An Rackspace service, such as Cloud Load Balancers, DNS, etc.
|
||||||
* A service provides one or more endpoints through which users can access resources and perform operations.
|
* A service provides one or more endpoints through which users can access resources and perform operations.
|
||||||
*/
|
*/
|
||||||
public interface ServiceType {
|
public final class ServiceType {
|
||||||
/**
|
/**
|
||||||
* Cloud Load Balancers
|
* Cloud Load Balancers
|
||||||
*/
|
*/
|
||||||
String LOAD_BALANCERS = "rax:load-balancer";
|
public static final String LOAD_BALANCERS = "rax:load-balancer";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cloud DNS
|
* Cloud DNS
|
||||||
*/
|
*/
|
||||||
String DNS = "rax:dns";
|
public static final String DNS = "rax:dns";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cloud Queues
|
* Cloud Queues
|
||||||
*/
|
*/
|
||||||
String QUEUES = "rax:queues";
|
public static final String QUEUES = "rax:queues";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cloud Files CDN
|
* Cloud Files CDN
|
||||||
*/
|
*/
|
||||||
String OBJECT_CDN = "rax:object-cdn";
|
public static final String OBJECT_CDN = "rax:object-cdn";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Auto Scale
|
* Auto Scale
|
||||||
*/
|
*/
|
||||||
String AUTO_SCALE = "rax:autoscale";
|
public static final String AUTO_SCALE = "rax:autoscale";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cloud Backup
|
* Cloud Backup
|
||||||
*/
|
*/
|
||||||
String BACKUP = "rax:backup";
|
public static final String BACKUP = "rax:backup";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cloud Databases
|
* Cloud Databases
|
||||||
*/
|
*/
|
||||||
String DATABASES = "rax:database";
|
public static final String DATABASES = "rax:database";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cloud Monitoring
|
* Cloud Monitoring
|
||||||
*/
|
*/
|
||||||
String MONITORING = "rax:monitor";
|
public static final String MONITORING = "rax:monitor";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cloud Big Data
|
* Cloud Big Data
|
||||||
*/
|
*/
|
||||||
String BIG_DATA = "rax:bigdata";
|
public static final String BIG_DATA = "rax:bigdata";
|
||||||
|
|
||||||
|
private ServiceType() {
|
||||||
|
throw new AssertionError("intentionally unimplemented");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,18 +16,22 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.openstack.swift.blobstore.strategy;
|
package org.jclouds.openstack.swift.blobstore.strategy;
|
||||||
|
|
||||||
public interface MultipartUpload {
|
public final class MultipartUpload {
|
||||||
|
|
||||||
/* Maximum number of parts per upload */
|
/* Maximum number of parts per upload */
|
||||||
int MAX_NUMBER_OF_PARTS = 10000;
|
public static final int MAX_NUMBER_OF_PARTS = 10000;
|
||||||
/* Maximum number of parts returned for a list parts request */
|
/* Maximum number of parts returned for a list parts request */
|
||||||
int MAX_LIST_PARTS_RETURNED = 1000;
|
public static final int MAX_LIST_PARTS_RETURNED = 1000;
|
||||||
/* Maximum number of multipart uploads returned in a list multipart uploads request */
|
/* Maximum number of multipart uploads returned in a list multipart uploads request */
|
||||||
int MAX_LIST_MPU_RETURNED = 1000;
|
public static final int MAX_LIST_MPU_RETURNED = 1000;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* part size 5 MB to 5 GB, last part can be < 5 MB
|
* part size 5 MB to 5 GB, last part can be < 5 MB
|
||||||
*/
|
*/
|
||||||
long MIN_PART_SIZE = 5242880L;
|
public static final long MIN_PART_SIZE = 5242880L;
|
||||||
long MAX_PART_SIZE = 5368709120L;
|
public static final long MAX_PART_SIZE = 5368709120L;
|
||||||
|
|
||||||
|
private MultipartUpload() {
|
||||||
|
throw new AssertionError("intentionally unimplemented");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,11 @@
|
||||||
package org.jclouds.openstack.swift.blobstore.strategy.internal;
|
package org.jclouds.openstack.swift.blobstore.strategy.internal;
|
||||||
|
|
||||||
import org.jclouds.blobstore.domain.Blob;
|
import org.jclouds.blobstore.domain.Blob;
|
||||||
import org.jclouds.openstack.swift.blobstore.strategy.MultipartUpload;
|
|
||||||
|
|
||||||
import com.google.inject.ImplementedBy;
|
import com.google.inject.ImplementedBy;
|
||||||
|
|
||||||
@ImplementedBy(SequentialMultipartUploadStrategy.class)
|
@ImplementedBy(SequentialMultipartUploadStrategy.class)
|
||||||
public interface MultipartUploadStrategy extends MultipartUpload {
|
public interface MultipartUploadStrategy {
|
||||||
|
|
||||||
String execute(String container, Blob blob);
|
String execute(String container, Blob blob);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ import com.google.inject.ImplementedBy;
|
||||||
* @see <a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?qfacts.html">AWS Documentation</a>
|
* @see <a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?qfacts.html">AWS Documentation</a>
|
||||||
*/
|
*/
|
||||||
@ImplementedBy(ParallelMultipartUploadStrategy.class)
|
@ImplementedBy(ParallelMultipartUploadStrategy.class)
|
||||||
public interface AsyncMultipartUploadStrategy extends MultipartUpload {
|
public interface AsyncMultipartUploadStrategy {
|
||||||
|
|
||||||
ListenableFuture<String> execute(String container, Blob blob, PutOptions options);
|
ListenableFuture<String> execute(String container, Blob blob, PutOptions options);
|
||||||
|
|
||||||
|
|
|
@ -19,18 +19,22 @@ package org.jclouds.aws.s3.blobstore.strategy;
|
||||||
/**
|
/**
|
||||||
* @see <a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?qfacts.html">AWS Documentation</a>
|
* @see <a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?qfacts.html">AWS Documentation</a>
|
||||||
*/
|
*/
|
||||||
public interface MultipartUpload {
|
public final class MultipartUpload {
|
||||||
|
|
||||||
/* Maximum number of parts per upload */
|
/* Maximum number of parts per upload */
|
||||||
int MAX_NUMBER_OF_PARTS = 10000;
|
public static final int MAX_NUMBER_OF_PARTS = 10000;
|
||||||
/* Maximum number of parts returned for a list parts request */
|
/* Maximum number of parts returned for a list parts request */
|
||||||
int MAX_LIST_PARTS_RETURNED = 1000;
|
public static final int MAX_LIST_PARTS_RETURNED = 1000;
|
||||||
/* Maximum number of multipart uploads returned in a list multipart uploads request */
|
/* Maximum number of multipart uploads returned in a list multipart uploads request */
|
||||||
int MAX_LIST_MPU_RETURNED = 1000;
|
public static final int MAX_LIST_MPU_RETURNED = 1000;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* part size 5 MB to 5 GB, last part can be < 5 MB
|
* part size 5 MB to 5 GB, last part can be < 5 MB
|
||||||
*/
|
*/
|
||||||
long MIN_PART_SIZE = 5242880L;
|
public static final long MIN_PART_SIZE = 5242880L;
|
||||||
long MAX_PART_SIZE = 5368709120L;
|
public static final long MAX_PART_SIZE = 5368709120L;
|
||||||
|
|
||||||
|
private MultipartUpload() {
|
||||||
|
throw new AssertionError("intentionally unimplemented");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ import com.google.inject.ImplementedBy;
|
||||||
* @see <a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?qfacts.html">AWS Documentation</a>
|
* @see <a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?qfacts.html">AWS Documentation</a>
|
||||||
*/
|
*/
|
||||||
@ImplementedBy(SequentialMultipartUploadStrategy.class)
|
@ImplementedBy(SequentialMultipartUploadStrategy.class)
|
||||||
public interface MultipartUploadStrategy extends MultipartUpload {
|
public interface MultipartUploadStrategy {
|
||||||
|
|
||||||
String execute(String container, Blob blob);
|
String execute(String container, Blob blob);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue