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);
}
Aggregations