diff options
author | Simon Rettberg | 2014-04-19 16:28:36 +0200 |
---|---|---|
committer | Simon Rettberg | 2014-04-19 16:28:36 +0200 |
commit | d71919b47ba94ee3192d221c18a53f8d0dbec415 (patch) | |
tree | b76500f2d87d0ec5304b451648f4143a97f41c20 /src/main/java/org/openslx/imagemaster/server/ApiServer.java | |
parent | Speed up sha512_crypt by caching sha512 digesters (thread local) (diff) | |
download | masterserver-d71919b47ba94ee3192d221c18a53f8d0dbec415.tar.gz masterserver-d71919b47ba94ee3192d221c18a53f8d0dbec415.tar.xz masterserver-d71919b47ba94ee3192d221c18a53f8d0dbec415.zip |
Add doc-comments to ApiServer and Hash, some TODO comments
Diffstat (limited to 'src/main/java/org/openslx/imagemaster/server/ApiServer.java')
-rw-r--r-- | src/main/java/org/openslx/imagemaster/server/ApiServer.java | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/main/java/org/openslx/imagemaster/server/ApiServer.java b/src/main/java/org/openslx/imagemaster/server/ApiServer.java index 57df2b9..eda48eb 100644 --- a/src/main/java/org/openslx/imagemaster/server/ApiServer.java +++ b/src/main/java/org/openslx/imagemaster/server/ApiServer.java @@ -43,12 +43,10 @@ public class ApiServer { /** * Request for authentication * - * @param login - * (username@organization) - * @param password + * @param login The user's login in the form "user@organization.com" + * @param password user's password * @return SessionData struct with session id/token iff login successful - * @throws AuthenticationException - * if login not successful + * @throws AuthenticationException if login not successful */ public static SessionData authenticate(String login, String password) throws AuthenticationException { @@ -66,11 +64,9 @@ public class ApiServer { /** * Request information about user for given token * - * @param token - * - a user's token + * @param token a user's token * @return UserInfo struct for given token's user - * @throws InvalidTokenException - * if no user matches the given token + * @throws InvalidTokenException if no user matches the given token */ public static UserInfo getUserFromToken(String token) throws InvalidTokenException { @@ -83,7 +79,7 @@ public class ApiServer { /** * Request ftp credentials to upload a new image to the masterserver. - * @param imageDescription MetdaData of the new image + * @param imageDescription MetaData of the new image * @param serverSessionData the session data of the authenticated uni/hs server * @return the genereated ftp credentials * @throws AuthorizationException if the uni/hs server has no valid session @@ -115,13 +111,15 @@ public class ApiServer { } /** - * Start the server authentication of a uni/hs server. + * Start the server authentication of a uni/hs satellite server. * @param organization the organization that the server belongs to - * @return a random string that needs to be encrypted with the private key + * @return a random string that needs to be encrypted with the private + * key of the requesting satellite server * @throws TException */ public static String startServerAuthentication(String organization) throws TException { + // TODO: Proper exceptions if (organization == null || organization == "") { throw new TException("Empty organization"); } @@ -132,16 +130,17 @@ public class ApiServer { } /** - * Authenticate the uni/hs server with the encrypted string. + * Authenticate the uni/hs satellite server with the encrypted string. * @param organization the organization that the server belongs to * @param challengeResponse the encrypted string - * @return session data iff the authentication was successfull + * @return session data iff the authentication was successful * @throws AuthenticationException * @throws TException */ public static ServerSessionData serverAuthenticate(String organization, String challengeResponse) throws AuthenticationException, TException { + // TODO: Proper exceptions if (organization == null || challengeResponse == null) { throw new TException("Empty organization org challengeResponse"); } |