Examples of WSResponse


Examples of com.github.hakko.musiccabinet.ws.lastfm.WSResponse

  protected void resendFailedUpdates() throws ApplicationException {
    while (failedUpdates.size() > 0) {
      LOG.debug("Queue of failed updates consists of "
          + failedUpdates.size() + " elements.");
      ArtistUserTag firstFailed = failedUpdates.get(0);
      WSResponse wsResponse = tagUpdateClient.updateTag(firstFailed);
      if (wsResponse.wasCallSuccessful()) {
        LOG.debug("Failed tag update was re-sent.");
        failedUpdates.remove(0);
      } else {
        LOG.debug("Failed tag update could not be re-sent. Wait a minute before trying again.");
        LOG.debug("Response: " + wsResponse);
View Full Code Here

Examples of com.github.hakko.musiccabinet.ws.lastfm.WSResponse

   
    setTotalOperations(artistNames.size());
   
    for (String artistName : artistNames) {
      try {
        WSResponse wsResponse = artistTopTagsClient.getTopTags(new Artist(artistName));
        if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
          StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
          ArtistTopTagsParser attParser =
            new ArtistTopTagsParserImpl(stringUtil.getInputStream());
          removeTagsWithLowTagCount(attParser.getTopTags());
          artistTopTagsDao.createTopTags(attParser.getArtist(),
              attParser.getTopTags());
View Full Code Here

Examples of com.github.hakko.musiccabinet.ws.lastfm.WSResponse

  @Override
  protected void updateSearchIndex() throws ApplicationException {
    short page = 0, totalPages = 0;
    do {
      WSResponse wsResponse = client.getLibraryTracks(page,
          lastFmSettingsService.getLastFmUsername());
      if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
        StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
        ScrobbledTracksParser parser = new ScrobbledTracksParserImpl(
            stringUtil.getInputStream());
        totalPages = parser.getTotalPages();
        trackPlayCountDao.createTrackPlayCounts(parser.getTrackPlayCounts());
        setTotalOperations(totalPages);
View Full Code Here

Examples of com.github.hakko.musiccabinet.ws.lastfm.WSResponse

    Set<String> tags = getTagsForUpdate();
   
    setTotalOperations(tags.size());
   
    for (String tag : tags) {
      WSResponse wsResponse = tagInfoClient.getTagInfo(tag, lastFmSettingsService.getLang());
      if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
        StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
        TagInfoParser tiParser = new TagInfoParserImpl(stringUtil.getInputStream());
        tagInfos.add(tiParser.getTagInfo());
      }
      addFinishedOperation();
    }
View Full Code Here

Examples of com.github.hakko.musiccabinet.ws.lastfm.WSResponse

  private static final Logger LOG = Logger.getLogger(LastFmService.class);

  public LastFmUser identifyLastFmUser(String token) throws ApplicationException {
    LOG.debug("identifyLastFmUser(" + token + ")");
    WSResponse wsResponse = authSessionClient.getAuthSession(token);
    if (wsResponse.wasCallAllowed() && wsResponse.wasCallSuccessful()) {
      StringUtil stringUtil = new StringUtil(wsResponse.getResponseBody());
      AuthSessionParser authSessionParser =
          new AuthSessionParserImpl(stringUtil.getInputStream());
      return authSessionParser.getLastFmUser();
    } else {
      LOG.debug("wsResponse: " + wsResponse.getResponseBody());
      throw new ApplicationException("Could not get session key for user! (code "
          + wsResponse.getErrorCode() + ", " + wsResponse.getErrorMessage() + ")");
    }
  }
View Full Code Here

Examples of org.geotools.data.ws.protocol.ws.WSResponse

        };

        HTTPResponse httpResponse = http.issuePost(url, requestBodyCallback);
        InputStream responseStream = httpResponse.getResponseStream();
               
        return new WSResponse(responseStream);
    }
View Full Code Here

Examples of org.geotools.data.ws.protocol.ws.WSResponse

        Filter postFilter = filters[1];
        LOGGER.fine("Supported filter sent to web service backend:  " + supportedFilter);       
        LOGGER.fine("Unsupported filter to be processed in GeoServer: " + postFilter);
        callQuery.setFilter(supportedFilter);       

        WSResponse response = wsProtocol.issueGetFeature(callQuery);
        Document doc = getXmlResponse(response);
       
        List<Integer> validFeatureIndex = determineValidFeatures(postFilter, doc, query
                .getMaxFeatures());
        return new XmlResponse(doc, validFeatureIndex);
View Full Code Here

Examples of org.geotools.data.ws.protocol.ws.WSResponse

     * @param value    Foreign key value
     * @return
     * @throws IOException
     */   
    public XmlResponse getXmlReader(Query query, String xpath, String value) throws IOException {
        WSResponse response = wsProtocol.issueGetFeature(query);
        Document doc = getXmlResponse(response);
       
        List<Integer> validFeatureIndex = determineValidFeatures(xpath, value, doc, query
                .getMaxFeatures());
        return new XmlResponse(doc, validFeatureIndex);
View Full Code Here

Examples of play.libs.ws.WSResponse

        wrh.setHeader(CONTENT_TYPE, "application/x-www-form-urlencoded");
        for(final Map.Entry<String, String> header : getHeaders().entrySet()) {
            wrh.setHeader(header.getKey(), header.getValue());
        }

    final WSResponse r = wrh.post(params).get(PlayAuthenticate.TIMEOUT);

    return buildInfo(r);
  }
View Full Code Here

Examples of play.libs.ws.WSResponse

  }

  protected JsonNode signedOauthGet(final String url,
      final OAuthCalculator calculator) {
    final F.Promise<WSResponse> promise = WS.url(url).sign(calculator).get();
    final WSResponse response = promise.get(getTimeout());
    return response.asJson();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.