Package org.atmosphere.samples.twitter.UsersState

Examples of org.atmosphere.samples.twitter.UsersState.UserStateData


    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    @Produces("text/plain;charset=ISO-8859-1")
    public Broadcastable onLogin(@Context TwitterBroadcaster bc,
                                 @FormParam("name") String name) {

        UserStateData usd = us.create(name,(TwitterBroadcaster)bc);
        // User already exists, client error
        if (usd == null)
            throw new WebApplicationException(400);

        if (name == null) {
View Full Code Here


        if (name == null) {
            logger.error("Name cannot be null");
            throw new WebApplicationException(400);
        }

        UserStateData followeeData = us.get(followee);
        TwitterBroadcaster outsiderBroadcaster = followeeData.bc;
        if (outsiderBroadcaster == null) {
            String m = (BEGIN_SCRIPT_TAG + toJsonp("Invalid Twitter user ", followee) + END_SCRIPT_TAG);
            Broadcastable b = new Broadcastable(m, userBc);
            return b;
View Full Code Here

    @Path("follows")
    @POST
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    public void follow(@FormParam("follower") String follower) {
        UserStateData followerState = us.get(follower);
        // User does not exist
        if (followerState == null) {
            throw new WebApplicationException(404);
        }
View Full Code Here

TOP

Related Classes of org.atmosphere.samples.twitter.UsersState.UserStateData

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.