improve javadoc of AuthenticationResource for the webservice documentation

This commit is contained in:
Sebastian Sdorra
2011-10-03 14:01:31 +02:00
parent c0a83d9fcf
commit 569cf5c70a

View File

@@ -39,6 +39,7 @@ import com.google.inject.Inject;
import com.google.inject.Provider; import com.google.inject.Provider;
import com.google.inject.Singleton; import com.google.inject.Singleton;
import org.codehaus.enunciate.jaxrs.TypeHint;
import org.codehaus.enunciate.modules.jersey.SpringManagedLifecycle; import org.codehaus.enunciate.modules.jersey.SpringManagedLifecycle;
import org.slf4j.Logger; import org.slf4j.Logger;
@@ -109,18 +110,24 @@ public class AuthenticationResource
//~--- methods -------------------------------------------------------------- //~--- methods --------------------------------------------------------------
/** /**
* Method description * Authenticate a user and return the state of the application.<br />
* <br />
* <ul>
* <li>200 success</li>
* <li>401 unauthorized, the specified username or password is wrong</li>
* <li>500 internal server error</li>
* </ul>
* *
* * @param request the current http request
* @param request * @param response the current http response
* @param response * @param username the username for the authentication
* @param username * @param password the password for the authentication
* @param password
* *
* @return * @return
*/ */
@POST @POST
@Path("login") @Path("login")
@TypeHint(ScmState.class)
public ScmState authenticate(@Context HttpServletRequest request, public ScmState authenticate(@Context HttpServletRequest request,
@Context HttpServletResponse response, @Context HttpServletResponse response,
@FormParam("username") String username, @FormParam("username") String username,
@@ -144,16 +151,22 @@ public class AuthenticationResource
} }
/** /**
* Method description * Logout the current user. Returns the current state of the application,
* if public access is enabled.<br />
* <br />
* <ul>
* <li>200 success</li>
* <li>500 internal server error</li>
* </ul>
* *
* * @param request the current http request
* @param request * @param response the current http response
* @param response
* *
* @return * @return
*/ */
@GET @GET
@Path("logout") @Path("logout")
@TypeHint(ScmState.class)
public Response logout(@Context HttpServletRequest request, public Response logout(@Context HttpServletRequest request,
@Context HttpServletResponse response) @Context HttpServletResponse response)
{ {
@@ -181,14 +194,20 @@ public class AuthenticationResource
//~--- get methods ---------------------------------------------------------- //~--- get methods ----------------------------------------------------------
/** /**
* Method description * Returns the current state of the application.<br />
* <br />
* <ul>
* <li>200 success</li>
* <li>401 unauthorized, user is not authenticated and public access is disabled.</li>
* <li>500 internal server error</li>
* </ul>
* *
* * @param request the current http request
* @param request
* *
* @return * @return
*/ */
@GET @GET
@TypeHint(ScmState.class)
public Response getState(@Context HttpServletRequest request) public Response getState(@Context HttpServletRequest request)
{ {
Response response = null; Response response = null;