private < T extends IEntity > IntuitMessage prepareQuery ( String query ) throws FMSException { IntuitMessage intuitMessage = new IntuitMessage ( ) ; RequestElements requestElements = intuitMessage . getRequestElements ( ) ; //set the request params Map < String , String > requestParameters = requestElements . getRequestParameters ( ) ; if ( query . length ( ) > LENGTH_200 ) { requestParameters . put ( RequestElements . REQ_PARAM_METHOD_TYPE , MethodType . POST . toString ( ) ) ; requestElements . setPostString ( query ) ; } else { requestParameters . put ( RequestElements . REQ_PARAM_METHOD_TYPE , MethodType . GET . toString ( ) ) ; requestParameters . put ( RequestElements . REQ_PARAM_QUERY , query ) ; } requestElements . setAction ( OperationType . QUERY . toString ( ) ) ; requestElements . setContext ( context ) ; return intuitMessage ; }
Common method to prepare the request params for query operation for both sync and async calls