Package com.ibm.sbt.services.client.ClientService

Examples of com.ibm.sbt.services.client.ClientService.HandlerJson


        return TYPE;
    }

    public List<FileEntry> readFileEntries(ClientService svc, RestDataBlockAccessor accessor, Map<String, String> params,String serviceUrl) throws ClientServicesException {
       
      HandlerJson json= new HandlerJson();   
      Object jsonObject = (Object) svc.get(serviceUrl,params, json).getData();
        ArrayList<FileEntry> entries = new ArrayList<FileEntry>();
        String epName = accessor.findEndpointName();
        JsonNavigator navigator = new JsonNavigator(jsonObject);
        DataNavigator contentsNav = navigator.get("contents");
View Full Code Here


          // Find the SmartCloud id
          GenericService service = new GenericService(ep);
//                    service.get("/manage/oauth/getUserIdentity",null, "json");
//                   
          //TODO - Padraic
         HandlerJson json= new HandlerJson();
         Object result = service.get("/manage/oauth/getUserIdentity", json).getData();
          if(result instanceof JsonJavaObject){
              JsonNavigator jsonUtil = new JsonNavigator(result);
              PeopleData data = new PeopleData();
              data.smartCloudSubscriberId = jsonUtil.stringValue("subscriberid");
View Full Code Here

                ClientService svc = createService(findEndpointBean(),getServiceUrl());
                Map<String,String> parameters = getParameters(index, blockSize);
                //String text = (String)svc.get(parameters, ClientService.FORMAT_TEXT);
                //IValue collection = (IValue)JsonParser.fromJson(JSJson.factory,text);
                Object[] data = null;
                HandlerJson json= new HandlerJson();
                JsonJavaObject result = (JsonJavaObject)svc.get(getServiceUrl(),parameters,json).getData();
                if(result!=null) {
                    if(StringUtil.isNotEmpty(splitPath)) {
                        JsonNavigator nav = new JsonNavigator(result);
                        List<Object> nodes = nav.nodes(splitPath);
View Full Code Here

                List<TwitterEntry> entries = new ArrayList<TwitterEntry>();
                String svcUrl= getServiceUrl();
                if(StringUtil.isEmpty(hashTag)){
                    ClientService svc = createClientService(provider, svcUrl);
                  
                    HandlerJson json  = new HandlerJson();
                    ArrayList collection = (ArrayList)svc.get(statusUrl, json).getData();
                   
                    if(collection != null){
                        int vc = collection.size();
                        for(int i = 0; i < vc; i++) {
                            Object o = collection.get(i);
                            if(o != null){
                                JsonNavigator nav = new JsonNavigator(o);
                                TwitterEntry entry = new TwitterEntry();
                                //entry.setTweetContent(nav.stringValue("text"));
                                entry.setTitle(nav.stringValue("text"));
                                entry.setAuthor(nav.get("user").stringValue("name"));
                                entries.add(entry);
                            }
                        }
                    }
                }
                else{
                    //TODO change this to JSON to be consistent
                    //http://search.twitter.com/search.json?q=%40twitterapi
                    ClientService svc = createClientService(provider, "search.json");
                    if(hashTag.indexOf('#') != 0){
                        hashTag = "#" + hashTag;
                    }
                    params.put("q", hashTag);
                   
                    //TODO - Padraic
                    HandlerJson json= new HandlerJson();
                    ArrayList collection = (ArrayList)svc.get(null,params, json).getData();
       
                    if(collection != null){
                        int vc = collection.size();
                        for(int i = 0; i < vc; i++) {
View Full Code Here

   * Method to retrieve the response as JSON.
   * @return A JSON representation of the Response
   * @throws ClientServicesException
   */
  public Response<JsonJavaObject> asJson() throws ClientServicesException {
    return response(new HandlerJson(), JsonJavaObject.class);
  }
View Full Code Here

   * Method to retrieve the response as a JSON Array.
   * @return A JSON Array representation of the response
   * @throws ClientServicesException
   */
  public Response<JsonJavaArray> asJsonArray() throws ClientServicesException {
    return response(new HandlerJson(), JsonJavaArray.class);
  }
View Full Code Here

     * @see com.ibm.sbt.services.client.base.BaseService#getDataFormat()
     */
    @Override
    public Handler getDataFormat() {
      if (this.dataFormat == null) {
        this.dataFormat = new HandlerJson();
      }
      return super.getDataFormat();
    }
View Full Code Here

TOP

Related Classes of com.ibm.sbt.services.client.ClientService.HandlerJson

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.