Package org.opensocial

Examples of org.opensocial.Request


      mediaItem.setUrl("http://www.google.com/intl/en_ALL/images/logo.gif");
      mediaItem.setAlbumId("myspace.com.album.81886");
      mediaItem.setType("IMAGE");
      mediaItem.setMimeType("image/gif");

      Request request = MediaItemsService.createMediaItem(mediaItem);
      Response response = client.send(request);

      assertTrue(response.getStatusLink() != null);
    } catch (Exception e) {
      fail("Exception occurred while processing request");
View Full Code Here


    MediaItem mediaItem = new MediaItem();
    mediaItem.setUrl("http://www.google.com/intl/en_ALL/images/logo.gif");
    mediaItem.setType("IMAGE");
    mediaItem.setMimeType("image/gif");

    Request request = MediaItemsService.createMediaItem(mediaItem);
  }
View Full Code Here

      mediaItem.setAlbumId("myspace.com.album.81886");
      mediaItem.setUrl("http://www.google.com/intl/en_ALL/images/logo.gif");
      mediaItem.setType("IMAGE");
      mediaItem.setMimeType("image/gif");

      Request request = MediaItemsService.updateMediaItem(mediaItem);
      Response response = client.send(request);

      assertTrue(response.getStatusLink() != null);
    } catch (Exception e) {
      fail("Exception occurred while processing request");
View Full Code Here

    mediaItem.setAlbumId("myspace.com.album.81886");
    mediaItem.setUrl("http://www.google.com/intl/en_ALL/images/logo.gif");
    mediaItem.setType("IMAGE");
    mediaItem.setMimeType("image/gif");

    Request request = MediaItemsService.updateMediaItem(mediaItem);
  }
View Full Code Here

    mediaItem.setId("myspace.com.mediaItem.image.646364");
    mediaItem.setUrl("http://www.google.com/intl/en_ALL/images/logo.gif");
    mediaItem.setType("IMAGE");
    mediaItem.setMimeType("image/gif");

    Request request = MediaItemsService.updateMediaItem(mediaItem);
  }
View Full Code Here

  public static Request getFriendStatuses(String guid) {
    return getStatus(guid, FRIENDS);
  }

  private static Request getStatus(String guid, String groupId) {
    Request request = new Request(restTemplate, null, "GET");
    request.setModelClass(StatusMood.class);
    request.setGroupId(groupId);
    request.setGuid(guid);

    return request;
  }
View Full Code Here

    return getStatusHistory(FRIENDS, friendId);
  }

  private static Request getStatusHistory(String groupId,
      String friendId) {
    Request request = new Request(restTemplate, null, "GET");
    request.setModelClass(StatusMood.class);
    request.addComponent(Request.FRIEND_ID, friendId);
    request.addComponent(Request.HISTORY, Request.HISTORY);
    request.setGroupId(groupId);
    request.setGuid(ME);

    return request;
  }
View Full Code Here

   *
   * @return new Request object to fetch all available MySpace moods
   * @see    StatusMood
   */
  public static Request getSupportedMoods() {
    Request request = new Request(restTemplate, null, "GET");
    request.setModelClass(StatusMood.class);
    request.setGroupId("@supportedMood");
    request.setGuid(ME);

    return request;
  }
View Full Code Here

   * @param  moodId ID of mood to fetch
   * @return        new Request object to fetch the specified mood
   * @see           StatusMood
   */
  public static Request getSupportedMood(long moodId) {
    Request request = getSupportedMoods();
    request.addComponent(Request.MOOD_ID, "" + moodId);

    return request;
  }
View Full Code Here

   *                    and moodId are set
   * @return            new Request object to update the current viewer's
   *                    status and/or mood
   */
  public static Request updateStatus(StatusMood statusMood) {
    Request request = new Request(restTemplate, null, "PUT");
    request.setGroupId(SELF);
    request.setGuid(ME);

    // Add REST payload parameters
    try {
      long moodId = Long.parseLong(statusMood.getMoodId());
      request.addRestPayloadParameter("moodId", moodId);
    } catch (NumberFormatException e) {
      request.addRestPayloadParameter("moodId", statusMood.getMoodId());
    }
    request.addRestPayloadParameter("status", statusMood.getStatus());

    return request;
  }
View Full Code Here

TOP

Related Classes of org.opensocial.Request

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.