From b7588374a30a41bab66b3568c2719302acb1024b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 13 Sep 2016 14:55:58 +0200 Subject: [PATCH] F #4714: update java oca --- .../src/org/opennebula/client/user/User.java | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/oca/java/src/org/opennebula/client/user/User.java b/src/oca/java/src/org/opennebula/client/user/User.java index d91b0e5ac5..eb38dfa575 100644 --- a/src/oca/java/src/org/opennebula/client/user/User.java +++ b/src/oca/java/src/org/opennebula/client/user/User.java @@ -237,7 +237,28 @@ public class User extends PoolElement{ String token, int expire) { - return client.call(LOGIN, username, token, expire); + return login(client, username, token, expire, -1); + } + + /** + * Sets the LOGIN_TOKEN for the user + * + * @param username of the user + * @param token the login token, if empty OpenNebula will + * generate one + * @param expire valid period of the token in secs. If <= 0 + * the token will be reset + * @param egid effective GID to use with this token. To use the + * current GID and user groups set it to -1 + * @return token in case of success, Error otherwise + */ + public static OneResponse login(Client client, + String username, + String token, + int expire, + int egid) + { + return client.call(LOGIN, username, token, expire, egid); } // ================================= @@ -385,6 +406,22 @@ public class User extends PoolElement{ return client.call(LOGIN, getName(), token, expire); } + /** + * Sets the LOGIN_TOKEN for the user. The method info() must be called before. + * + * @param token the login token, if empty OpenNebula will + * generate one + * @param expire valid period of the token in secs. If <= 0 + * the token will be reset + * @param egid effective GID to use with this token. To use the + * current GID and user groups set it to -1 + * @return token in case of success, Error otherwise + */ + public OneResponse login(String token, int expire, int egid) + { + return client.call(LOGIN, getName(), token, expire, egid); + } + // ================================= // Helpers // =================================