mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
Refactor AppEngineConnection
AppEngineConnection can now connect to all services and not just the tools. The default is still the tools. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=218734983
This commit is contained in:
parent
97aa98eb35
commit
b48061b792
31 changed files with 269 additions and 329 deletions
|
@ -14,30 +14,7 @@
|
|||
|
||||
package google.registry.tools;
|
||||
|
||||
import com.google.common.net.MediaType;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/** A command that can send HTTP requests to a backend module. */
|
||||
interface CommandWithConnection extends Command {
|
||||
|
||||
/** An http connection to AppEngine. */
|
||||
interface Connection {
|
||||
|
||||
void prefetchXsrfToken();
|
||||
|
||||
/** Send a POST request. TODO(mmuller): change to sendPostRequest() */
|
||||
String send(
|
||||
String endpoint, Map<String, ?> params, MediaType contentType, @Nullable byte[] payload)
|
||||
throws IOException;
|
||||
|
||||
String sendGetRequest(String endpoint, Map<String, ?> params) throws IOException;
|
||||
|
||||
Map<String, Object> sendJson(String endpoint, Map<String, ?> object) throws IOException;
|
||||
|
||||
String getServerUrl();
|
||||
}
|
||||
|
||||
void setConnection(Connection connection);
|
||||
void setConnection(AppEngineConnection connection);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue