Search in sources :

Example 1 with Session

use of jetbrains.buildServer.server.rest.model.debug.Session in project teamcity-rest by JetBrains.

the class DebugRequest method getCurrentSession.

@GET
@Path("/currentRequest/session")
@Produces({ "application/xml", "application/json" })
public Session getCurrentSession(@Context HttpServletRequest request, @QueryParam("fields") final String fields, @Context @NotNull final BeanContext beanContext) {
    User currentUser = myServiceLocator.getSingletonService(PermissionChecker.class).getCurrent().getAssociatedUser();
    HttpSession session = request.getSession();
    return new Session(session.getId(), currentUser != null ? currentUser.getId() : null, new Date(session.getCreationTime()), new Date(session.getLastAccessedTime()), new Fields(fields), beanContext);
}
Also used : SessionUser(jetbrains.buildServer.web.util.SessionUser) User(jetbrains.buildServer.users.User) HttpSession(javax.servlet.http.HttpSession) Session(jetbrains.buildServer.server.rest.model.debug.Session) HttpSession(javax.servlet.http.HttpSession)

Aggregations

HttpSession (javax.servlet.http.HttpSession)1 Session (jetbrains.buildServer.server.rest.model.debug.Session)1 User (jetbrains.buildServer.users.User)1 SessionUser (jetbrains.buildServer.web.util.SessionUser)1