agave-monitors/monitors-core/src/main/java/org/iplantc/service/monitor/util/ServiceUtils.java
/**
	 * Used to wrap all output from the service in a JSON object with two
	 * attributes "status" and "message." the former is success or failure. The
	 * latter is the output from a service invocation or the error message.
	 * 
	 * @param status
	 * @param json
	 * @return
	 */
Used to wrap all output from the service in a JSON object with two
attributes "status" and "message." the former is success or failure. The
latter is the output from a service invocation or the error message.

@param status
@param json
@return
Used to wrap all output from the service in a JSON object with two attributes " status " and " message . " the former is success or failure . The latter is the output from a service invocation or the error message . @param status @param json @return
private static String wrapOutput(String status, String message, String json)
	{
		JSONWriter writer = new JSONStringer();
		try
		{
			writer.object().key("status").value(status).key("message").value(
					message).key("result").value(json).endObject();
		}
		catch (Exception e)
		{
			try
			{
				writer.object().key("status").value("error").key("message")
						.value(e.getMessage()).endObject();
			}
			catch (Exception e1)
			{
			}
		}
		return writer.toString();
	}
private static String wrapOutput ( String status , String message , String json ) { JSONWriter writer = new JSONStringer ( ) ; try { writer . object ( ) . key ( "status" ) . value ( status ) . key ( "message" ) . value ( message ) . key ( "result" ) . value ( json ) . endObject ( ) ; } catch ( Exception e ) { try { writer . object ( ) . key ( "status" ) . value ( "error" ) . key ( "message" ) . value ( e . getMessage ( ) ) . endObject ( ) ; } catch ( Exception e1 ) { } } return writer . toString ( ) ; }
Used to wrap all output from the service in a JSON object with two
 attributes "status" and "message."
Used to wrap all output from the service in a JSON object with two attributes " status " and " message . "