Merge branch 'stable-2.11'
* stable-2.11: Set version to 2.11.2 in dev-plugins.txt Release notes for Gerrit 2.11.2 Bind OnlineReindexer.Factory in LuceneIndexModule Add ssh command to activate the latest index Add ssh command to restart online indexer PluginAPI: Don't convert to String in RestApi.get() method Change-Id: I907e665b20568fce8563bf9e22a7a0ffc96fc847
This commit is contained in:
@@ -166,6 +166,14 @@ public class ActionContext extends JavaScriptObject {
|
||||
api.get(wrap(cb));
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as {@link #get(RestApi, JavaScriptObject)} but without converting
|
||||
* a {@link NativeString} result to String.
|
||||
*/
|
||||
static final void getRaw(RestApi api, final JavaScriptObject cb) {
|
||||
api.get(wrapRaw(cb));
|
||||
}
|
||||
|
||||
static final void post(RestApi api, JavaScriptObject in, JavaScriptObject cb) {
|
||||
if (NativeString.is(in)) {
|
||||
post(api, ((NativeString) in).asString(), cb);
|
||||
@@ -174,14 +182,42 @@ public class ActionContext extends JavaScriptObject {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as {@link #post(RestApi, JavaScriptObject, JavaScriptObject)} but
|
||||
* without converting a {@link NativeString} result to String.
|
||||
*/
|
||||
static final void postRaw(RestApi api, JavaScriptObject in, JavaScriptObject cb) {
|
||||
if (NativeString.is(in)) {
|
||||
postRaw(api, ((NativeString) in).asString(), cb);
|
||||
} else {
|
||||
api.post(in, wrapRaw(cb));
|
||||
}
|
||||
}
|
||||
|
||||
static final void post(RestApi api, String in, JavaScriptObject cb) {
|
||||
api.post(in, wrap(cb));
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as {@link #post(RestApi, String, JavaScriptObject)} but without
|
||||
* converting a {@link NativeString} result to String.
|
||||
*/
|
||||
static final void postRaw(RestApi api, String in, JavaScriptObject cb) {
|
||||
api.post(in, wrapRaw(cb));
|
||||
}
|
||||
|
||||
static final void put(RestApi api, JavaScriptObject cb) {
|
||||
api.put(wrap(cb));
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as {@link #put(RestApi, JavaScriptObject)} but without converting
|
||||
* a {@link NativeString} result to String.
|
||||
*/
|
||||
static final void putRaw(RestApi api, JavaScriptObject cb) {
|
||||
api.put(wrapRaw(cb));
|
||||
}
|
||||
|
||||
static final void put(RestApi api, JavaScriptObject in, JavaScriptObject cb) {
|
||||
if (NativeString.is(in)) {
|
||||
put(api, ((NativeString) in).asString(), cb);
|
||||
@@ -190,14 +226,42 @@ public class ActionContext extends JavaScriptObject {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as {@link #put(RestApi, JavaScriptObject, JavaScriptObject)} but
|
||||
* without converting a {@link NativeString} result to String.
|
||||
*/
|
||||
static final void putRaw(RestApi api, JavaScriptObject in, JavaScriptObject cb) {
|
||||
if (NativeString.is(in)) {
|
||||
putRaw(api, ((NativeString) in).asString(), cb);
|
||||
} else {
|
||||
api.put(in, wrapRaw(cb));
|
||||
}
|
||||
}
|
||||
|
||||
static final void put(RestApi api, String in, JavaScriptObject cb) {
|
||||
api.put(in, wrap(cb));
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as {@link #put(RestApi, String, JavaScriptObject)} but without
|
||||
* converting a {@link NativeString} result to String.
|
||||
*/
|
||||
static final void putRaw(RestApi api, String in, JavaScriptObject cb) {
|
||||
api.put(in, wrapRaw(cb));
|
||||
}
|
||||
|
||||
static final void delete(RestApi api, JavaScriptObject cb) {
|
||||
api.delete(wrap(cb));
|
||||
}
|
||||
|
||||
/**
|
||||
* The same as {@link #delete(RestApi, JavaScriptObject)} but without
|
||||
* converting a {@link NativeString} result to String.
|
||||
*/
|
||||
static final void deleteRaw(RestApi api, JavaScriptObject cb) {
|
||||
api.delete(wrapRaw(cb));
|
||||
}
|
||||
|
||||
private static GerritCallback<JavaScriptObject> wrap(final JavaScriptObject cb) {
|
||||
return new GerritCallback<JavaScriptObject>() {
|
||||
@Override
|
||||
@@ -211,4 +275,13 @@ public class ActionContext extends JavaScriptObject {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static GerritCallback<JavaScriptObject> wrapRaw(final JavaScriptObject cb) {
|
||||
return new GerritCallback<JavaScriptObject>() {
|
||||
@Override
|
||||
public void onSuccess(JavaScriptObject result) {
|
||||
ApiGlue.invoke(cb, result);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -102,6 +102,12 @@ public class ApiGlue {
|
||||
Lcom/google/gwt/core/client/JavaScriptObject;)
|
||||
(this._api(u), b);
|
||||
},
|
||||
get_raw: function(u,b) {
|
||||
@com.google.gerrit.client.api.ActionContext::getRaw(
|
||||
Lcom/google/gerrit/client/rpc/RestApi;
|
||||
Lcom/google/gwt/core/client/JavaScriptObject;)
|
||||
(this._api(u), b);
|
||||
},
|
||||
post: function(u,i,b) {
|
||||
if (typeof i == 'string') {
|
||||
@com.google.gerrit.client.api.ActionContext::post(
|
||||
@@ -117,6 +123,21 @@ public class ApiGlue {
|
||||
(this._api(u), i, b);
|
||||
}
|
||||
},
|
||||
post_raw: function(u,i,b) {
|
||||
if (typeof i == 'string') {
|
||||
@com.google.gerrit.client.api.ActionContext::postRaw(
|
||||
Lcom/google/gerrit/client/rpc/RestApi;
|
||||
Ljava/lang/String;
|
||||
Lcom/google/gwt/core/client/JavaScriptObject;)
|
||||
(this._api(u), i, b);
|
||||
} else {
|
||||
@com.google.gerrit.client.api.ActionContext::postRaw(
|
||||
Lcom/google/gerrit/client/rpc/RestApi;
|
||||
Lcom/google/gwt/core/client/JavaScriptObject;
|
||||
Lcom/google/gwt/core/client/JavaScriptObject;)
|
||||
(this._api(u), i, b);
|
||||
}
|
||||
},
|
||||
put: function(u,i,b) {
|
||||
if (b) {
|
||||
if (typeof i == 'string') {
|
||||
@@ -139,6 +160,28 @@ public class ApiGlue {
|
||||
(this._api(u), i);
|
||||
}
|
||||
},
|
||||
put_raw: function(u,i,b) {
|
||||
if (b) {
|
||||
if (typeof i == 'string') {
|
||||
@com.google.gerrit.client.api.ActionContext::putRaw(
|
||||
Lcom/google/gerrit/client/rpc/RestApi;
|
||||
Ljava/lang/String;
|
||||
Lcom/google/gwt/core/client/JavaScriptObject;)
|
||||
(this._api(u), i, b);
|
||||
} else {
|
||||
@com.google.gerrit.client.api.ActionContext::putRaw(
|
||||
Lcom/google/gerrit/client/rpc/RestApi;
|
||||
Lcom/google/gwt/core/client/JavaScriptObject;
|
||||
Lcom/google/gwt/core/client/JavaScriptObject;)
|
||||
(this._api(u), i, b);
|
||||
}
|
||||
} else {
|
||||
@com.google.gerrit.client.api.ActionContext::putRaw(
|
||||
Lcom/google/gerrit/client/rpc/RestApi;
|
||||
Lcom/google/gwt/core/client/JavaScriptObject;)
|
||||
(this._api(u), i);
|
||||
}
|
||||
},
|
||||
'delete': function(u,b) {
|
||||
@com.google.gerrit.client.api.ActionContext::delete(
|
||||
Lcom/google/gerrit/client/rpc/RestApi;
|
||||
@@ -151,6 +194,12 @@ public class ApiGlue {
|
||||
Lcom/google/gwt/core/client/JavaScriptObject;)
|
||||
(this._api(u), b);
|
||||
},
|
||||
del_raw: function(u,b) {
|
||||
@com.google.gerrit.client.api.ActionContext::deleteRaw(
|
||||
Lcom/google/gerrit/client/rpc/RestApi;
|
||||
Lcom/google/gwt/core/client/JavaScriptObject;)
|
||||
(this._api(u), b);
|
||||
},
|
||||
};
|
||||
}-*/;
|
||||
|
||||
|
Reference in New Issue
Block a user