Package org.tsugi.json
Class IMSJSONRequest
- java.lang.Object
-
- org.tsugi.json.IMSJSONRequest
-
public class IMSJSONRequest extends Object
-
-
Field Summary
Fields Modifier and Type Field Description Stringbase_stringstatic StringCODE_MAJOR_FAILUREstatic StringCODE_MAJOR_SUCCESSstatic StringCODE_MAJOR_UNSUPPORTEDStringerrorMessageStringpostBodystatic StringSTATUSstatic StringSTATUS_CODEstatic StringSTATUS_DESCRIPTIONbooleanvalid
-
Constructor Summary
Constructors Constructor Description IMSJSONRequest(String bodyString)IMSJSONRequest(String oauth_consumer_key, String oauth_secret, HttpServletRequest request)IMSJSONRequest(HttpServletRequest request)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringdoErrorJSON(HttpServletRequest request, HttpServletResponse response, IMSJSONRequest json, String message, Exception e)StringgetOAuthConsumerKey()StringgetPostBody()static Map<String,String>getStatus(String description, String major)static Map<String,String>getStatusFailure(String desc)static Map<String,String>getStatusSuccess(String desc)static Map<String,String>getStatusUnsupported(String desc)booleaninArray(String[] theArray, String theString)voidloadFromRequest(HttpServletRequest request)static voidrunTest()voidvalidateRequest(String oauth_consumer_key, String oauth_secret, HttpServletRequest request)voidvalidateRequest(String oauth_consumer_key, String oauth_secret, HttpServletRequest request, String URL)
-
-
-
Field Detail
-
STATUS
public static final String STATUS
- See Also:
- Constant Field Values
-
STATUS_CODE
public static final String STATUS_CODE
- See Also:
- Constant Field Values
-
STATUS_DESCRIPTION
public static final String STATUS_DESCRIPTION
- See Also:
- Constant Field Values
-
CODE_MAJOR_SUCCESS
public static final String CODE_MAJOR_SUCCESS
- See Also:
- Constant Field Values
-
CODE_MAJOR_FAILURE
public static final String CODE_MAJOR_FAILURE
- See Also:
- Constant Field Values
-
CODE_MAJOR_UNSUPPORTED
public static final String CODE_MAJOR_UNSUPPORTED
- See Also:
- Constant Field Values
-
postBody
public String postBody
-
valid
public boolean valid
-
errorMessage
public String errorMessage
-
base_string
public String base_string
-
-
Constructor Detail
-
IMSJSONRequest
public IMSJSONRequest(String oauth_consumer_key, String oauth_secret, HttpServletRequest request)
-
IMSJSONRequest
public IMSJSONRequest(HttpServletRequest request)
-
IMSJSONRequest
public IMSJSONRequest(String bodyString)
-
-
Method Detail
-
getOAuthConsumerKey
public String getOAuthConsumerKey()
-
getPostBody
public String getPostBody()
-
loadFromRequest
public void loadFromRequest(HttpServletRequest request)
-
validateRequest
public void validateRequest(String oauth_consumer_key, String oauth_secret, HttpServletRequest request)
-
validateRequest
public void validateRequest(String oauth_consumer_key, String oauth_secret, HttpServletRequest request, String URL)
-
doErrorJSON
public static String doErrorJSON(HttpServletRequest request, HttpServletResponse response, IMSJSONRequest json, String message, Exception e) throws IOException
- Throws:
IOException
-
runTest
public static void runTest()
-
-