mirror of https://github.com/apache/jclouds.git
removed unused base classes
git-svn-id: http://jclouds.googlecode.com/svn/trunk@2456 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
74a551f4f0
commit
f2e7e259d3
|
@ -1,42 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Copyright (C) 2009 Cloud Conscious, LLC. <info@cloudconscious.com>
|
|
||||||
*
|
|
||||||
* ====================================================================
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
* ====================================================================
|
|
||||||
*/
|
|
||||||
package org.jclouds.command;
|
|
||||||
|
|
||||||
import static java.lang.annotation.ElementType.TYPE;
|
|
||||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
|
||||||
|
|
||||||
import java.lang.annotation.Retention;
|
|
||||||
import java.lang.annotation.Target;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* designates the module configures a Client to a cloud.
|
|
||||||
*
|
|
||||||
* @author Adrian Cole
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@Retention(RUNTIME)
|
|
||||||
@Target(TYPE)
|
|
||||||
public @interface ConfiguresResponseTransformer {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,58 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Copyright (C) 2009 Cloud Conscious, LLC. <info@cloudconscious.com>
|
|
||||||
*
|
|
||||||
* ====================================================================
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
* ====================================================================
|
|
||||||
*/
|
|
||||||
package org.jclouds.command;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* {@code <E>} type of endpoint that this client will interact with. {@code <Q>} type of request
|
|
||||||
* that this endpoint expects. {@code <R>} type of response that this endpoint produces.
|
|
||||||
*
|
|
||||||
* @author Adrian Cole
|
|
||||||
*/
|
|
||||||
public interface EndpointCommand<E, Q extends Request<E>, R> {
|
|
||||||
|
|
||||||
int incrementFailureCount();
|
|
||||||
|
|
||||||
int getFailureCount();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* generates a request object used to invoke this command.
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
Q getRequest();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Used to prevent a command from being re-executed.
|
|
||||||
*
|
|
||||||
* Any calls to {@link execute} following this will return the below exception.
|
|
||||||
*
|
|
||||||
* @param exception
|
|
||||||
*/
|
|
||||||
void setException(Exception exception);
|
|
||||||
|
|
||||||
Exception getException();
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,49 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Copyright (C) 2009 Cloud Conscious, LLC. <info@cloudconscious.com>
|
|
||||||
*
|
|
||||||
* ====================================================================
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
* ====================================================================
|
|
||||||
*/
|
|
||||||
package org.jclouds.command;
|
|
||||||
|
|
||||||
import java.util.concurrent.Future;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* {@code <E>} type of endpoint that this client will interact with. {@code <Q>} type of request
|
|
||||||
* that this endpoint expects. {@code <R>} type of response that this endpoint produces.
|
|
||||||
*
|
|
||||||
* @author Adrian Cole
|
|
||||||
*/
|
|
||||||
public interface EndpointCommandExecutorService<C extends EndpointCommand<?, ?, R>, R> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Asks the command to build a request relevant for an endpoint that produces responses of
|
|
||||||
* generic type {@code R}. and invokes it on the endpoint, returning a future
|
|
||||||
*
|
|
||||||
* @param <T>
|
|
||||||
* type of result the command extracts from the return value
|
|
||||||
* @param command
|
|
||||||
* that generates requests
|
|
||||||
* @return {@link Future} containing the response from the {@code endpoint}
|
|
||||||
*/
|
|
||||||
Future<R> submit(C command);
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Copyright (C) 2009 Cloud Conscious, LLC. <info@cloudconscious.com>
|
|
||||||
*
|
|
||||||
* ====================================================================
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
||||||
* or more contributor license agreements. See the NOTICE file
|
|
||||||
* distributed with this work for additional information
|
|
||||||
* regarding copyright ownership. The ASF licenses this file
|
|
||||||
* to you under the Apache License, Version 2.0 (the
|
|
||||||
* "License"); you may not use this file except in compliance
|
|
||||||
* with the License. You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing,
|
|
||||||
* software distributed under the License is distributed on an
|
|
||||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
||||||
* KIND, either express or implied. See the License for the
|
|
||||||
* specific language governing permissions and limitations
|
|
||||||
* under the License.
|
|
||||||
* ====================================================================
|
|
||||||
*/
|
|
||||||
package org.jclouds.command;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A service request must have an endPoint associated with it.
|
|
||||||
*
|
|
||||||
* @author Adrian Cole
|
|
||||||
*/
|
|
||||||
public interface Request<E> {
|
|
||||||
E getEndpoint();
|
|
||||||
}
|
|
|
@ -23,16 +23,14 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.http;
|
package org.jclouds.http;
|
||||||
|
|
||||||
import java.net.URI;
|
|
||||||
|
|
||||||
import org.jclouds.command.EndpointCommand;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Command whose endpoint is an http service.
|
* Command whose endpoint is an http service.
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
public interface HttpCommand extends EndpointCommand<URI, HttpRequest, HttpResponse> {
|
public interface HttpCommand {
|
||||||
|
|
||||||
int incrementRedirectCount();
|
int incrementRedirectCount();
|
||||||
|
|
||||||
|
@ -54,4 +52,23 @@ public interface HttpCommand extends EndpointCommand<URI, HttpRequest, HttpRespo
|
||||||
* change the path of the service
|
* change the path of the service
|
||||||
*/
|
*/
|
||||||
void redirectPath(String newPath);
|
void redirectPath(String newPath);
|
||||||
|
|
||||||
|
int incrementFailureCount();
|
||||||
|
|
||||||
|
int getFailureCount();
|
||||||
|
|
||||||
|
HttpRequest getRequest();
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Used to prevent a command from being re-executed.
|
||||||
|
*
|
||||||
|
* Any calls to {@link execute} following this will return the below exception.
|
||||||
|
*
|
||||||
|
* @param exception
|
||||||
|
*/
|
||||||
|
void setException(Exception exception);
|
||||||
|
|
||||||
|
Exception getException();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,12 +23,24 @@
|
||||||
*/
|
*/
|
||||||
package org.jclouds.http;
|
package org.jclouds.http;
|
||||||
|
|
||||||
import org.jclouds.command.EndpointCommandExecutorService;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Capable of invoking http commands.
|
* Capable of invoking http commands.
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
public interface HttpCommandExecutorService extends EndpointCommandExecutorService<HttpCommand, HttpResponse> {
|
public interface HttpCommandExecutorService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asks the command to build a request relevant for an endpoint that produces responses of
|
||||||
|
* generic type {@code HttpResponse}. and invokes it on the endpoint, returning a future
|
||||||
|
*
|
||||||
|
* @param <T>
|
||||||
|
* type of result the command extracts from the return value
|
||||||
|
* @param command
|
||||||
|
* that generates requests
|
||||||
|
* @return {@link Future} containing the response from the {@code endpoint}
|
||||||
|
*/
|
||||||
|
Future<HttpResponse> submit(HttpCommand command);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,6 @@ import java.util.List;
|
||||||
|
|
||||||
import javax.ws.rs.core.HttpHeaders;
|
import javax.ws.rs.core.HttpHeaders;
|
||||||
|
|
||||||
import org.jclouds.command.Request;
|
|
||||||
|
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
import com.google.inject.internal.Lists;
|
import com.google.inject.internal.Lists;
|
||||||
import com.google.inject.internal.Nullable;
|
import com.google.inject.internal.Nullable;
|
||||||
|
@ -44,7 +42,7 @@ import com.google.inject.internal.Nullable;
|
||||||
*
|
*
|
||||||
* @author Adrian Cole
|
* @author Adrian Cole
|
||||||
*/
|
*/
|
||||||
public class HttpRequest extends HttpMessage implements Request<URI> {
|
public class HttpRequest extends HttpMessage {
|
||||||
|
|
||||||
private List<HttpRequestFilter> requestFilters = Lists.newArrayList();
|
private List<HttpRequestFilter> requestFilters = Lists.newArrayList();
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ public interface MapBinder extends Binder {
|
||||||
/**
|
/**
|
||||||
* creates and binds the POST payload to the request using parameters specified.
|
* creates and binds the POST payload to the request using parameters specified.
|
||||||
*
|
*
|
||||||
* @see MapPayloadParam
|
* @see org.jclouds.rest.annotations.MapPayloadParam
|
||||||
*/
|
*/
|
||||||
public void bindToRequest(HttpRequest request, Map<String, String> postParams);
|
public void bindToRequest(HttpRequest request, Map<String, String> postParams);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue