Package org.jboss.as.quickstarts.tasksrs.model

Examples of org.jboss.as.quickstarts.tasksrs.model.User


    @POST
    @Path("tasks/{title}")
    public Response createTask(@Context UriInfo info, @Context SecurityContext context,
                               @PathParam("title"@DefaultValue("task") String taskTitle) {

        User user = getUser(context);
        Task task = new Task(taskTitle);

        taskDao.createTask(user, task);

        // Construct the URI for the newly created resource and put in into the Location header of the response
View Full Code Here


    @Path("tasks/{id}")
    // JSON: include "application/json" in the @Produces annotation to include json support
    //@Produces({ "application/xml", "application/json" })
    @Produces({ "application/xml" })
    public Task getTaskById(@Context SecurityContext context, @PathParam("id") Long id) {
        User user = getUser(context);

        return getTask(user, id);
    }
View Full Code Here

    }

    private User getUser(String username) {

        try {
            User user = userDao.getForUsername(username);

            if (user == null) {
                user = new User(username);

                userDao.createUser(user);
            }

            return user;
View Full Code Here

TOP

Related Classes of org.jboss.as.quickstarts.tasksrs.model.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.