mirror of https://github.com/apache/jclouds.git
Issue 99: organize binders
git-svn-id: http://jclouds.googlecode.com/svn/trunk@1924 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
b541be176a
commit
bb50a7364f
|
@ -67,7 +67,6 @@ import org.jclouds.rest.EntityParam;
|
|||
import org.jclouds.rest.ExceptionParser;
|
||||
import org.jclouds.rest.Headers;
|
||||
import org.jclouds.rest.HostPrefixParam;
|
||||
import org.jclouds.rest.HttpRequestOptionsBinder;
|
||||
import org.jclouds.rest.ParamParser;
|
||||
import org.jclouds.rest.QueryParams;
|
||||
import org.jclouds.rest.RequestFilters;
|
||||
|
@ -75,6 +74,7 @@ import org.jclouds.rest.ResponseParser;
|
|||
import org.jclouds.rest.SkipEncoding;
|
||||
import org.jclouds.rest.VirtualHost;
|
||||
import org.jclouds.rest.XMLResponseParser;
|
||||
import org.jclouds.rest.binders.HttpRequestOptionsBinder;
|
||||
|
||||
import com.google.inject.internal.Nullable;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.jclouds.aws.s3.domain.AccessControlList.Grant;
|
|||
import org.jclouds.aws.s3.domain.AccessControlList.GroupGrantee;
|
||||
import org.jclouds.aws.s3.reference.S3Constants;
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.rest.EntityBinder;
|
||||
import org.jclouds.rest.binders.EntityBinder;
|
||||
import org.jclouds.util.Utils;
|
||||
|
||||
import com.jamesmurty.utils.XMLBuilder;
|
||||
|
|
|
@ -29,6 +29,8 @@ import java.util.List;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
import javax.servlet.RequestDispatcher;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
|
@ -41,9 +43,6 @@ import org.jclouds.aws.s3.domain.ListBucketResponse;
|
|||
import org.jclouds.blobstore.ContainerNotFoundException;
|
||||
import org.jclouds.logging.Logger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
/**
|
||||
* Shows an example of how to use @{link S3Connection} injected with Guice.
|
||||
*
|
||||
|
|
|
@ -26,15 +26,14 @@ package org.jclouds.blobstore.binders;
|
|||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static org.jclouds.blobstore.reference.BlobStoreConstants.PROPERTY_USER_METADATA_PREFIX;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.ws.rs.core.HttpHeaders;
|
||||
|
||||
import org.jclouds.blobstore.domain.Blob;
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.HttpUtils;
|
||||
import org.jclouds.rest.EntityBinder;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import org.jclouds.rest.binders.EntityBinder;
|
||||
|
||||
public class BlobBinder implements EntityBinder {
|
||||
private final String metadataPrefix;
|
||||
|
|
|
@ -27,13 +27,14 @@ import static org.jclouds.blobstore.reference.BlobStoreConstants.PROPERTY_USER_M
|
|||
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.rest.EntityBinder;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.rest.binders.EntityBinder;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
public class UserMetadataBinder implements EntityBinder {
|
||||
private final String metadataPrefix;
|
||||
|
||||
|
|
|
@ -29,6 +29,9 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
|||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.jclouds.rest.binders.EntityBinder;
|
||||
import org.jclouds.rest.binders.ToStringEntityBinder;
|
||||
|
||||
/**
|
||||
* Designates that this parameter will hold the entity for a PUT or POST command.
|
||||
*
|
||||
|
|
|
@ -58,6 +58,9 @@ import org.jclouds.http.functions.ReturnTrueIf2xx;
|
|||
import org.jclouds.http.functions.ParseSax.HandlerWithResult;
|
||||
import org.jclouds.http.options.HttpRequestOptions;
|
||||
import org.jclouds.logging.Logger;
|
||||
import org.jclouds.rest.binders.EntityBinder;
|
||||
import org.jclouds.rest.binders.HttpRequestOptionsBinder;
|
||||
import org.jclouds.rest.binders.MapEntityBinder;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Function;
|
||||
|
|
|
@ -29,6 +29,8 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
|||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.jclouds.rest.binders.MapEntityBinder;
|
||||
|
||||
/**
|
||||
* Designates that this parameter will hold the entity for a PUT or POST command.
|
||||
*
|
||||
|
|
2
core/src/main/java/org/jclouds/rest/EntityBinder.java → core/src/main/java/org/jclouds/rest/binders/EntityBinder.java
Normal file → Executable file
2
core/src/main/java/org/jclouds/rest/EntityBinder.java → core/src/main/java/org/jclouds/rest/binders/EntityBinder.java
Normal file → Executable file
|
@ -21,7 +21,7 @@
|
|||
* under the License.
|
||||
* ====================================================================
|
||||
*/
|
||||
package org.jclouds.rest;
|
||||
package org.jclouds.rest.binders;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
* under the License.
|
||||
* ====================================================================
|
||||
*/
|
||||
package org.jclouds.rest;
|
||||
package org.jclouds.rest.binders;
|
||||
|
||||
import javax.ws.rs.core.HttpHeaders;
|
||||
|
|
@ -21,21 +21,20 @@
|
|||
* under the License.
|
||||
* ====================================================================
|
||||
*/
|
||||
package org.jclouds.http.binders;
|
||||
package org.jclouds.rest.binders;
|
||||
|
||||
import java.util.Collections;
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.ws.rs.core.HttpHeaders;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.rest.MapEntityBinder;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import javax.inject.Inject;
|
||||
|
||||
/**
|
||||
* Binds the object to the request as a json object.
|
|
@ -21,7 +21,7 @@
|
|||
* under the License.
|
||||
* ====================================================================
|
||||
*/
|
||||
package org.jclouds.rest;
|
||||
package org.jclouds.rest.binders;
|
||||
|
||||
import java.util.Map;
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
* under the License.
|
||||
* ====================================================================
|
||||
*/
|
||||
package org.jclouds.rest;
|
||||
package org.jclouds.rest.binders;
|
||||
|
||||
import javax.ws.rs.core.HttpHeaders;
|
||||
|
|
@ -33,7 +33,7 @@ import javax.ws.rs.PUT;
|
|||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
|
||||
import org.jclouds.http.binders.JsonBinder;
|
||||
import org.jclouds.rest.binders.JsonBinder;
|
||||
import org.jclouds.http.functions.ParseSax;
|
||||
import org.jclouds.http.options.HttpRequestOptions;
|
||||
import org.jclouds.rest.Endpoint;
|
||||
|
|
|
@ -55,13 +55,14 @@ import org.jclouds.http.HttpException;
|
|||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.HttpRequestFilter;
|
||||
import org.jclouds.http.HttpResponse;
|
||||
import org.jclouds.http.binders.JsonBinder;
|
||||
import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule;
|
||||
import org.jclouds.http.functions.ReturnStringIf200;
|
||||
import org.jclouds.http.functions.ReturnTrueIf2xx;
|
||||
import org.jclouds.http.options.BaseHttpRequestOptions;
|
||||
import org.jclouds.http.options.GetOptions;
|
||||
import org.jclouds.http.options.HttpRequestOptions;
|
||||
import org.jclouds.rest.binders.JsonBinder;
|
||||
import org.jclouds.rest.binders.MapEntityBinder;
|
||||
import org.jclouds.rest.config.JaxrsModule;
|
||||
import org.jclouds.util.DateService;
|
||||
import org.jclouds.util.Jsr330;
|
||||
|
|
|
@ -28,7 +28,7 @@ import static com.google.common.base.Preconditions.checkArgument;
|
|||
import java.util.Map;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.binders.JsonBinder;
|
||||
import org.jclouds.rest.binders.JsonBinder;
|
||||
import org.jclouds.rackspace.cloudservers.domain.BackupSchedule;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
|
|
@ -29,7 +29,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||
import java.util.Map;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.binders.JsonBinder;
|
||||
import org.jclouds.rest.binders.JsonBinder;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||
import java.util.Map;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.binders.JsonBinder;
|
||||
import org.jclouds.rest.binders.JsonBinder;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import javax.ws.rs.core.HttpHeaders;
|
|||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.rest.EntityBinder;
|
||||
import org.jclouds.rest.binders.EntityBinder;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -28,7 +28,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||
import java.util.Map;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.binders.JsonBinder;
|
||||
import org.jclouds.rest.binders.JsonBinder;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||
import java.util.Map;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.binders.JsonBinder;
|
||||
import org.jclouds.rest.binders.JsonBinder;
|
||||
import org.jclouds.rackspace.cloudservers.domain.RebootType;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
|
|
@ -29,7 +29,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||
import java.util.Map;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.binders.JsonBinder;
|
||||
import org.jclouds.rest.binders.JsonBinder;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import javax.ws.rs.core.HttpHeaders;
|
|||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.rest.EntityBinder;
|
||||
import org.jclouds.rest.binders.EntityBinder;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -28,7 +28,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||
import java.util.Map;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.binders.JsonBinder;
|
||||
import org.jclouds.rest.binders.JsonBinder;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.util.Map.Entry;
|
|||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.HttpUtils;
|
||||
import org.jclouds.http.binders.JsonBinder;
|
||||
import org.jclouds.rest.binders.JsonBinder;
|
||||
import org.jclouds.rackspace.cloudservers.domain.Addresses;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
|
|
@ -29,7 +29,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
|||
import java.util.Map;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.binders.JsonBinder;
|
||||
import org.jclouds.rest.binders.JsonBinder;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.inject.internal.Nullable;
|
||||
|
|
|
@ -28,7 +28,7 @@ import static com.google.common.base.Preconditions.checkArgument;
|
|||
import java.util.Map;
|
||||
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.binders.JsonBinder;
|
||||
import org.jclouds.rest.binders.JsonBinder;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.inject.internal.Maps;
|
||||
|
|
Loading…
Reference in New Issue