Package org.codehaus.jettison.json

Examples of org.codehaus.jettison.json.JSONObject


                                        feed.destroy();
                                        logger.info("Twitter Search API unavaileble\n{}", s);
                                        return null;
                                    }

                                    JSONObject json = new JSONObject(s);
                                    refreshUrl.set(json.getString("refresh_url"));
                                    if (json.getJSONArray("results").length() > 1) {
                                        feed.broadcast(s).get();
                                    }
                                    return null;
                                }
View Full Code Here


        Broadcaster broadcaster = BroadcasterFactory.getDefault().lookup(DefaultBroadcaster.class, topic, true);
        logger.info("thread: {} LISTENING to '{}'", Thread.currentThread().getName(), broadcaster.getID());
        if (service == null) {
            throw new AssertionError();
        }
        return new Broadcastable(new JSONObject().put("from", "system").put("msg", "Connected !"), broadcaster);
    }
View Full Code Here

        logger.info("thread: {} PUBLISH to '{}' from {}: {}",
                new Object[]{Thread.currentThread().getName(), broadcaster.getID(), from, message});
        if (service == null) {
            throw new AssertionError();
        }
        return new Broadcastable(new JSONObject().put("from", from).put("msg", message), "", broadcaster);
    }
View Full Code Here

        BasicWatchers watchers = null;
        Iterable<String> expandos = null;
        Collection<Subtask> subtasks = null;
        Collection<ChangelogGroup> changelog = null;
        Set<String> labels = null;
        JSONObject rawObject = null;

        BasicIssue basicIssue = mockSearchRestClient.getBasicIssue(issueKey);
        Collection<Comment> comments = mockSearchRestClient.getCommentsForIssue(basicIssue.getId());
        Issue issue = new Issue(summary, self, basicIssue.getKey(), basicIssue.getId(), project, issueType, status,
                description, priority, resolution, attachments, reporter, assignee, creationDate, updateDate,
View Full Code Here

    PlatformLayerCliContext context = PlatformLayerCliContext.get();
    PlatformLayerClient client = context.getPlatformLayerClient();
    String json = properties.toString();
    String wrapper = "{ \"data\": \"" + json + "\" }";
    String retvalJsonString = client.activateService(serviceType, wrapper, Format.JSON);
    JSONObject retvalJsonObject = new JSONObject(retvalJsonString);
    return toPython(retvalJsonObject);
  }
View Full Code Here

  public static Object getActivation(String serviceType) throws PlatformLayerClientException, JSONException {
    PlatformLayerCliContext context = PlatformLayerCliContext.get();
    PlatformLayerClient client = context.getPlatformLayerClient();
    String retvalJsonString = client.getActivation(serviceType, Format.JSON);
    JSONObject retvalJsonObject = new JSONObject(retvalJsonString);
    return toPython(retvalJsonObject);
  }
View Full Code Here

   protected static XMLStreamReader getMappedXMLStreamReader(InputStream entityStream)
   {
      try
      {
         String jsonString = ProviderHelper.readString(entityStream);
         XMLStreamReader streamReader = new MappedXMLStreamReader(new JSONObject(jsonString));
         return streamReader;
      }
      catch (IOException e)
      {
         throw new ExceptionAdapter(e);
View Full Code Here

   protected static XMLStreamReader getBadgerFishXMLStreamReader(InputStream entityStream)
   {
      try
      {
         String jsonString = ProviderHelper.readString(entityStream);
         XMLStreamReader streamReader = new BadgerFishXMLStreamReader(new JSONObject(jsonString));
         return streamReader;
      }
      catch (IOException e)
      {
         throw new ExceptionAdapter(e);
View Full Code Here

       
        mf = (ModelFacade)getServletContext().getAttribute(WebConstants.MF_KEY);
        Person personEntity = mf.findPerson(userid);       
        if (personEntity==null) throw new Exception ("User Not Found");

        return new JSONObject()
                .put("username", personEntity.getUserName())
                .put("password", personEntity.getPassword())
                .put("firstName",personEntity.getFirstName())
                .put("lastName", personEntity.getLastName())
                .put("summary", personEntity.getSummary())
View Full Code Here

    WebResource r = resource();
    ClientResponse response = r.path("ws").path("v1").path("cluster")
        .accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);

    assertEquals(MediaType.APPLICATION_JSON_TYPE, response.getType());
    JSONObject json = response.getEntity(JSONObject.class);
    verifyClusterInfo(json);
  }
View Full Code Here

TOP

Related Classes of org.codehaus.jettison.json.JSONObject

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.