Package com.restfb.types

Examples of com.restfb.types.FacebookType$Metadata


    String connection = "me/notes";
    Parameter[] arrayParams = new Parameter[2];
    arrayParams[0] = Parameter.with("subject", subject);
    arrayParams[1] = Parameter.with("message", message);
    FacebookType mockFbType = EasyMock.createMock(FacebookType.class);
    expect(
        mockFbClient.publishObject(connection, FacebookType.class,
            arrayParams)).andReturn(mockFbType);
    expect(mockFbType.getId()).andReturn(fbid);

    Note expectedNote = loadObjectFromJSON("/examples/note.json",
        Note.class);
    expect(mockFbClient.getFacebookObjectByID(fbid, Note.class)).andReturn(
        expectedNote);
View Full Code Here


    assertTrue(repo.getContentByProvider(providerID, true).size() == 0);

    String connection = "me/feed";
    Parameter[] arrayParams = new Parameter[1];
    arrayParams[0] = Parameter.with("message", "test status message");
    FacebookType mockFbType = EasyMock.createMock(FacebookType.class);
    expect(
        mockFbClient.publishObject(connection, FacebookType.class,
            arrayParams)).andReturn(mockFbType);
    expect(mockFbType.getId()).andReturn(STATUS_FBID);

    List<StatusMessage> statuses = loadListFromJSON(
        "/examples/exampleStatus.json", StatusMessage.class);

    StatusMessage expectedStatus = statuses.get(2);
View Full Code Here

    String connection = "me/events";
    Parameter[] arrayParams = new Parameter[3];
    arrayParams[0] = Parameter.with("name", "TestEvent");
    arrayParams[1] = Parameter.with("start_time", tomorrow);
    arrayParams[2] = Parameter.with("end_time", tomorrowX2);
    FacebookType mockFbType = EasyMock.createMock(FacebookType.class);

    expect(
        mockFbClient.publishObject(connection, FacebookType.class,
            arrayParams)).andReturn(mockFbType);
    expect(mockFbType.getId()).andReturn(STATUS_FBID);

    List<Event> events = loadListFromJSON("/examples/events.json",
        Event.class);

    List<FacebookType> eventUsers = loadListFromJSON(
View Full Code Here

    String connection = "friendId/feed";
    Parameter[] arrayParams = new Parameter[2];
    arrayParams[0] = Parameter.with("name", "post name");
    arrayParams[1] = Parameter.with("message", "post message");
    FacebookType mockFbType = EasyMock.createMock(FacebookType.class);
    expect(
        mockFbClient.publishObject(connection, FacebookType.class,
            arrayParams)).andReturn(mockFbType);
    expect(mockFbType.getId()).andReturn(POST_FBID);

    Post expectedPost = loadObjectFromJSON("/examples/post.json",
        Post.class);
    expect(mockFbClient.getFacebookObjectByID(POST_FBID, Post.class))
        .andReturn(expectedPost);
View Full Code Here

  }

  @Override
  public String publish(String to, String message) {
    LOG.info("Start publish");
    FacebookType publishMessageResponse = null;
//    try {
    if (to != null) {
      User user = facebookClient.fetchObject(to, User.class);
      publishMessageResponse = facebookClient.publish(user.getId()
          + "/feed", FacebookType.class,
          Parameter.with("message", message));
    } else {
      publishMessageResponse = facebookClient.publish("me/feed",
          FacebookType.class, Parameter.with("message", message));
    }
    LOG.error("Published post [" + publishMessageResponse.getId() + "]");
//    } catch (FacebookException e) {
//      LOG.error("An error occurred while publishing", e);
//    }
    LOG.info("End publish");
    return publishMessageResponse.getId();
  }
View Full Code Here

        HttpURLConnection con = (HttpURLConnection) new URL(request).openConnection();
        con.setRequestProperty("User-Agent", "JMP3renamer MusicBrainz Plug-in " + MusicBrainz.VERSION);
        InputStream in = con.getInputStream();

        Object o = unm.unmarshal(in);
        Metadata md = (Metadata) o;
        ReleaseList rl = md.getReleaseList();
        if (rl != null) {
            List<Release> list = rl.getRelease();
            for (Release release : list) {
                MusicBrainzAlbum mba = new MusicBrainzAlbum();
                mba.setTitle(release.getTitle());
View Full Code Here

        logger.debug("Request: {}", request);
        HttpURLConnection con = (HttpURLConnection) new URL(request).openConnection();
        con.setRequestProperty("User-Agent", "JMP3renamer MusicBrainz Plug-in " + MusicBrainz.VERSION);
        InputStream in = con.getInputStream();

        Metadata md = (Metadata) unm.unmarshal(in);
        MediumList ml = md.getRelease().getMediumList();
        List<Medium> mediums = ml.getMedium();
        for (Medium medium : mediums) {
            TrackList tracks = medium.getTrackList();
            for (Track track : tracks.getDefTrack()) {
                logger.debug("Found track: {}", track.getTitle());
View Full Code Here

            try {
                JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
                proxyFac.setBindingId(soapVersion);
                proxyFac.setAddress(mexLoc);
                MetadataExchange exc = proxyFac.create(MetadataExchange.class);
                Metadata metadata = exc.get2004();
                for (MetadataSection s : metadata.getMetadataSection()) {
                    if ("http://schemas.xmlsoap.org/wsdl/".equals(s.getDialect())) {
                        //got the wsdl...
                        Definition definition = bus.getExtension(WSDLManager.class)
                            .getDefinition((Element)s.getAny());
                        WSDLServiceFactory factory = new WSDLServiceFactory(bus, definition);
View Full Code Here

        if (mexLoc != null) {
            try {
                JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
                proxyFac.setAddress(mexLoc);
                MetadataExchange exc = proxyFac.create(MetadataExchange.class);
                Metadata metadata = exc.get2004();
                for (MetadataSection s : metadata.getMetadataSection()) {
                    if ("http://schemas.xmlsoap.org/wsdl/".equals(s.getDialect())) {
                        //got the wsdl...
                        Definition definition = bus.getExtension(WSDLManager.class)
                            .getDefinition((Element)s.getAny());
                        WSDLServiceFactory factory = new WSDLServiceFactory(bus, definition);
View Full Code Here

        if (mexLoc != null) {
            try {
                JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
                proxyFac.setAddress(mexLoc);
                MetadataExchange exc = proxyFac.create(MetadataExchange.class);
                Metadata metadata = exc.get2004();
                for (MetadataSection s : metadata.getMetadataSection()) {
                    if ("http://schemas.xmlsoap.org/wsdl/".equals(s.getDialect())) {
                        //got the wsdl...
                        Definition definition = bus.getExtension(WSDLManager.class)
                            .getDefinition((Element)s.getAny());
                        WSDLServiceFactory factory = new WSDLServiceFactory(bus, definition);
View Full Code Here

TOP

Related Classes of com.restfb.types.FacebookType$Metadata

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.