idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
35,700
public Expression < Double > neq ( double value ) { String valueString = "'" + value + "'" ; return new Expression < Double > ( this , Operation . neq , valueString ) ; }
Method to construct the not equals expression for double
43
9
35,701
public Expression < Byte > lt ( byte value ) { String valueString = "'" + value + "'" ; return new Expression < Byte > ( this , Operation . lt , valueString ) ; }
Method to construct the less than expression for byte
43
9
35,702
public Expression < Short > lt ( short value ) { String valueString = "'" + value + "'" ; return new Expression < Short > ( this , Operation . lt , valueString ) ; }
Method to construct the less than expression for short
43
9
35,703
public Expression < Integer > lt ( int value ) { String valueString = "'" + value + "'" ; return new Expression < Integer > ( this , Operation . lt , valueString ) ; }
Method to construct the less than expression for int
43
9
35,704
public Expression < Long > lt ( long value ) { String valueString = "'" + value + "'" ; return new Expression < Long > ( this , Operation . lt , valueString ) ; }
Method to construct the less than expression for long
43
9
35,705
public Expression < Float > lt ( float value ) { String valueString = "'" + value + "'" ; return new Expression < Float > ( this , Operation . lt , valueString ) ; }
Method to construct the less than expression for float
43
9
35,706
public Expression < Double > lt ( double value ) { String valueString = "'" + value + "'" ; return new Expression < Double > ( this , Operation . lt , valueString ) ; }
Method to construct the less than expression for double
43
9
35,707
public Expression < Byte > lte ( byte value ) { String valueString = "'" + value + "'" ; return new Expression < Byte > ( this , Operation . lte , valueString ) ; }
Method to construct the less than or equals expression for byte
43
11
35,708
public Expression < Short > lte ( short value ) { String valueString = "'" + value + "'" ; return new Expression < Short > ( this , Operation . lte , valueString ) ; }
Method to construct the less than or equals expression for short
43
11
35,709
public Expression < Integer > lte ( int value ) { String valueString = "'" + value + "'" ; return new Expression < Integer > ( this , Operation . lte , valueString ) ; }
Method to construct the less than or equals expression for int
43
11
35,710
public Expression < Long > lte ( long value ) { String valueString = "'" + value + "'" ; return new Expression < Long > ( this , Operation . lte , valueString ) ; }
Method to construct the less than or equals expression for long
43
11
35,711
public Expression < Float > lte ( float value ) { String valueString = "'" + value + "'" ; return new Expression < Float > ( this , Operation . lte , valueString ) ; }
Method to construct the less than or equals expression for float
43
11
35,712
public Expression < Double > lte ( double value ) { String valueString = "'" + value + "'" ; return new Expression < Double > ( this , Operation . lte , valueString ) ; }
Method to construct the less than or equals expression for double
43
11
35,713
public Expression < Byte > gt ( byte value ) { String valueString = "'" + value + "'" ; return new Expression < Byte > ( this , Operation . gt , valueString ) ; }
Method to construct the greater than expression for byte
43
9
35,714
public Expression < Short > gt ( short value ) { String valueString = "'" + value + "'" ; return new Expression < Short > ( this , Operation . gt , valueString ) ; }
Method to construct the greater than expression for short
43
9
35,715
public Expression < Integer > gt ( int value ) { String valueString = "'" + value + "'" ; return new Expression < Integer > ( this , Operation . gt , valueString ) ; }
Method to construct the greater than expression for int
43
9
35,716
public Expression < Long > gt ( long value ) { String valueString = "'" + value + "'" ; return new Expression < Long > ( this , Operation . gt , valueString ) ; }
Method to construct the greater than expression for long
43
9
35,717
public Expression < Float > gt ( float value ) { String valueString = "'" + value + "'" ; return new Expression < Float > ( this , Operation . gt , valueString ) ; }
Method to construct the greater than expression for float
43
9
35,718
public Expression < Double > gt ( double value ) { String valueString = "'" + value + "'" ; return new Expression < Double > ( this , Operation . gt , valueString ) ; }
Method to construct the greater than expression for double
43
9
35,719
public Expression < Byte > gte ( byte value ) { String valueString = "'" + value + "'" ; return new Expression < Byte > ( this , Operation . gte , valueString ) ; }
Method to construct the greater than or equals expression for byte
43
11
35,720
public Expression < Short > gte ( short value ) { String valueString = "'" + value + "'" ; return new Expression < Short > ( this , Operation . gte , valueString ) ; }
Method to construct the greater than or equals expression for short
43
11
35,721
public Expression < Integer > gte ( int value ) { String valueString = "'" + value + "'" ; return new Expression < Integer > ( this , Operation . gte , valueString ) ; }
Method to construct the greater than or equals expression for int
43
11
35,722
public Expression < Long > gte ( long value ) { String valueString = "'" + value + "'" ; return new Expression < Long > ( this , Operation . gte , valueString ) ; }
Method to construct the greater than or equals expression for long
43
11
35,723
public Expression < Float > gte ( float value ) { String valueString = "'" + value + "'" ; return new Expression < Float > ( this , Operation . gte , valueString ) ; }
Method to construct the greater than or equals expression for float
43
11
35,724
public Expression < Double > gte ( double value ) { String valueString = "'" + value + "'" ; return new Expression < Double > ( this , Operation . gte , valueString ) ; }
Method to construct the greater than or equals expression for double
43
11
35,725
public Expression < Byte > in ( Byte [ ] value ) { String listNumberString = "" ; Boolean firstNumber = true ; for ( Byte v : value ) { if ( firstNumber ) { listNumberString = listNumberString . concat ( "('" ) . concat ( v . toString ( ) ) . concat ( "'" ) ; firstNumber = false ; } else { listNumberString = listNumber...
Method to construct the in expression for byte
152
8
35,726
public Expression < Byte > between ( Byte startValue , Byte endValue ) { String valueString = "'" + startValue + "' AND '" + endValue + "'" ; return new Expression < Byte > ( this , Operation . between , valueString ) ; }
Method to construct the between expression for byte
55
8
35,727
public Expression < Short > between ( Short startValue , Short endValue ) { String valueString = "'" + startValue + "' AND '" + endValue + "'" ; return new Expression < Short > ( this , Operation . between , valueString ) ; }
Method to construct the between expression for short
55
8
35,728
public Expression < Integer > between ( Integer startValue , Integer endValue ) { String valueString = "'" + startValue + "' AND '" + endValue + "'" ; return new Expression < Integer > ( this , Operation . between , valueString ) ; }
Method to construct the between expression for integer
55
8
35,729
public Expression < Long > between ( Long startValue , Long endValue ) { String valueString = "'" + startValue + "' AND '" + endValue + "'" ; return new Expression < Long > ( this , Operation . between , valueString ) ; }
Method to construct the between expression for long
55
8
35,730
public Expression < Float > between ( Float startValue , Float endValue ) { String valueString = "'" + startValue + "' AND '" + endValue + "'" ; return new Expression < Float > ( this , Operation . between , valueString ) ; }
Method to construct the between expression for float
55
8
35,731
public Expression < Double > between ( Double startValue , Double endValue ) { String valueString = "'" + startValue + "' AND '" + endValue + "'" ; return new Expression < Double > ( this , Operation . between , valueString ) ; }
Method to construct the between expression for double
55
8
35,732
public boolean retryRequest ( IOException exception , int executionCount , HttpContext context ) { LOG . debug ( "In retry request" ) ; if ( exception == null ) { throw new IllegalArgumentException ( "Exception parameter may not be null" ) ; } else if ( context == null ) { throw new IllegalArgumentException ( "HTTP con...
method to validate the retry policies
425
7
35,733
private boolean checkPolicy ( int executionCount ) { if ( mechanism . equalsIgnoreCase ( "fixedretry" ) ) { if ( this . retryCount == 0 ) { return false ; } else if ( executionCount < this . retryCount ) { try { Thread . sleep ( ( long ) this . retryInterval ) ; LOG . debug ( "The retryInterval " + this . retryInterval...
Method to check the retry request policy
392
8
35,734
public BearerTokenResponse refreshToken ( String refreshToken ) throws OAuthException { logger . debug ( "Enter OAuth2PlatformClient::refreshToken" ) ; try { HttpRequestClient client = new HttpRequestClient ( oauth2Config . getProxyConfig ( ) ) ; Request request = new Request . RequestBuilder ( MethodType . POST , oaut...
Method to renew OAuth2 tokens by passing the refreshToken
297
12
35,735
private List < NameValuePair > getUrlParameters ( String action , String token , String redirectUri ) { List < NameValuePair > urlParameters = new ArrayList < NameValuePair > ( ) ; if ( action == "revoke" ) { urlParameters . add ( new BasicNameValuePair ( "token" , token ) ) ; } else if ( action == "refresh" ) { urlPar...
Method to build post parameters
221
5
35,736
public PlatformResponse revokeToken ( String token ) throws ConnectionException { logger . debug ( "Enter OAuth2PlatformClient::revokeToken" ) ; PlatformResponse platformResponse = new PlatformResponse ( ) ; try { HttpRequestClient client = new HttpRequestClient ( oauth2Config . getProxyConfig ( ) ) ; Request request =...
Method to revoke OAuth2 tokens
300
7
35,737
private String getAuthHeader ( ) { String base64ClientIdSec = DatatypeConverter . printBase64Binary ( ( oauth2Config . getClientId ( ) + ":" + oauth2Config . getClientSecret ( ) ) . getBytes ( ) ) ; return "Basic " + base64ClientIdSec ; }
Method to generate auth header based on client ID and Client Secret
73
12
35,738
public UserInfoResponse getUserInfo ( String accessToken ) throws OpenIdException { logger . debug ( "Enter OAuth2PlatformClient::getUserInfo" ) ; try { HttpRequestClient client = new HttpRequestClient ( oauth2Config . getProxyConfig ( ) ) ; Request request = new Request . RequestBuilder ( MethodType . GET , oauth2Conf...
Method to retrieve UserInfo data associated with the accessToken generated The response depends on the Scope supplied during openId
277
22
35,739
public boolean validateIDToken ( String idToken ) throws OpenIdException { logger . debug ( "Enter OAuth2PlatformClient::validateIDToken" ) ; String [ ] idTokenParts = idToken . split ( "\\." ) ; if ( idTokenParts . length < 3 ) { logger . debug ( "invalid idTokenParts length" ) ; return false ; } String idTokenHeader ...
Method to validate IDToken
749
5
35,740
private HashMap < String , JSONObject > getKeyMapFromJWKSUri ( ) throws OpenIdException { logger . debug ( "Enter OAuth2PlatformClient::getKeyMapFromJWKSUri" ) ; try { HttpRequestClient client = new HttpRequestClient ( oauth2Config . getProxyConfig ( ) ) ; Request request = new Request . RequestBuilder ( MethodType . G...
Build JWKS keymap
252
6
35,741
private PublicKey getPublicKey ( String MODULUS , String EXPONENT ) { byte [ ] nb = base64UrlDecodeToBytes ( MODULUS ) ; byte [ ] eb = base64UrlDecodeToBytes ( EXPONENT ) ; BigInteger n = new BigInteger ( 1 , nb ) ; BigInteger e = new BigInteger ( 1 , eb ) ; RSAPublicKeySpec rsaPublicKeySpec = new RSAPublicKeySpec ( n ...
Build public key
178
3
35,742
private HashMap < String , JSONObject > buildKeyMap ( String content ) throws ConnectionException { HashMap < String , JSONObject > retMap = new HashMap < String , JSONObject > ( ) ; JSONObject jwksPayload = new JSONObject ( content ) ; JSONArray keysArray = jwksPayload . getJSONArray ( "keys" ) ; for ( int i = 0 ; i <...
Build Map from response
143
4
35,743
public Expression < String > eq ( String value ) { String valueString = "'" + value + "'" ; return new Expression < String > ( this , Operation . eq , valueString ) ; }
Method to construct the equals expression for string
41
8
35,744
public Expression < String > neq ( String value ) { String valueString = "'" + value + "'" ; return new Expression < String > ( this , Operation . neq , valueString ) ; }
Method to construct the not equals expression for string
43
9
35,745
public Expression < String > lt ( String value ) { String valueString = "'" + value + "'" ; return new Expression < String > ( this , Operation . lt , valueString ) ; }
Method to construct the less than expression for string
43
9
35,746
public Expression < String > lte ( String value ) { String valueString = "'" + value + "'" ; return new Expression < String > ( this , Operation . lte , valueString ) ; }
Method to construct the less than or equals expression for string
43
11
35,747
public Expression < String > gt ( String value ) { String valueString = "'" + value + "'" ; return new Expression < String > ( this , Operation . gt , valueString ) ; }
Method to construct the greater than expression for string
43
9
35,748
public Expression < String > gte ( String value ) { String valueString = "'" + value + "'" ; return new Expression < String > ( this , Operation . gte , valueString ) ; }
Method to construct the greater than or equals expression for string
43
11
35,749
public Expression < String > in ( String [ ] value ) { String listString = "" ; Boolean firstString = true ; for ( String v : value ) { if ( firstString ) { listString = listString . concat ( "('" ) . concat ( v ) . concat ( "'" ) ; firstString = false ; } else { listString = listString . concat ( ", '" ) . concat ( v ...
Method to construct the in expression for string
134
8
35,750
public Expression < String > startsWith ( String value ) { String valueString = "'" + value + "%'" ; return new Expression < String > ( this , Operation . like , valueString ) ; }
Method to construct the like expression for string starts with
42
10
35,751
public Expression < String > endsWith ( String value ) { String valueString = "'%" + value + "'" ; return new Expression < String > ( this , Operation . like , valueString ) ; }
Method to construct the like expression for string ends with
42
10
35,752
public Expression < String > contains ( String value ) { String valueString = "'%" + value + "%'" ; return new Expression < String > ( this , Operation . like , valueString ) ; }
Method to construct the like expression for string contains
41
9
35,753
public Expression < String > between ( String startValue , String endValue ) { String valueString = "'" + startValue + "' AND '" + endValue + "'" ; return new Expression < String > ( this , Operation . between , valueString ) ; }
Method to construct the between expression for string
55
8
35,754
public String getContent ( ) throws ConnectionException { logger . debug ( "Enter Response::getContent" ) ; if ( content != null ) { logger . debug ( "content already available " ) ; return content ; } BufferedReader rd = new BufferedReader ( new InputStreamReader ( stream ) ) ; StringBuffer result = new StringBuffer (...
Returns the json content from http response
169
7
35,755
public static void setProperty ( String key , String value ) { local . get ( ) . cc . setProperty ( key , value ) ; }
Sets the property to the configuration
30
7
35,756
public static Boolean getBooleanProperty ( String key , Boolean defaultValue ) { String value = getProperty ( key ) ; if ( ( null == value ) || value . isEmpty ( ) ) { return ( null == defaultValue ) ? false : defaultValue ; } if ( "null" . equals ( value . toLowerCase ( ) ) && ( null != defaultValue ) ) { return defau...
Returns boolean value for specified property and default value
96
9
35,757
private SimpleDateFormat getDateTimeFormatter ( ) { SimpleDateFormat formatter = new SimpleDateFormat ( ) ; formatter . applyPattern ( "yyyy-MM-dd'T'HH:mm:ss" ) ; formatter . setTimeZone ( TimeZone . getTimeZone ( "GMT" ) ) ; return formatter ; }
Method to get simple date format
74
6
35,758
private String getCalendarAsString ( Calendar cal ) { SimpleDateFormat formatter = getDateTimeFormatter ( ) ; Date date = cal . getTime ( ) ; return formatter . format ( date ) . concat ( "Z" ) ; }
Method to get string value of date from Calendar
54
9
35,759
public Expression < Calendar > eq ( Calendar value ) { String valueString = "'" + getCalendarAsString ( value ) + "'" ; return new Expression < Calendar > ( this , Operation . eq , valueString ) ; }
Method to construct the equals expression for Calendar
48
8
35,760
public Expression < Calendar > neq ( Calendar value ) { String valueString = "'" + getCalendarAsString ( value ) + "'" ; return new Expression < Calendar > ( this , Operation . neq , valueString ) ; }
Method to construct the not equals expression for Calendar
50
9
35,761
public Expression < Calendar > lt ( Calendar value ) { String valueString = "'" + getCalendarAsString ( value ) + "'" ; return new Expression < Calendar > ( this , Operation . lt , valueString ) ; }
Method to construct the less than expression for calendar
50
9
35,762
public Expression < Calendar > lte ( Calendar value ) { String valueString = "'" + getCalendarAsString ( value ) + "'" ; return new Expression < Calendar > ( this , Operation . lte , valueString ) ; }
Method to construct the less than or equals expression for calendar
50
11
35,763
public Expression < java . sql . Date > lte ( java . sql . Date value ) { SimpleDateFormat formatter = getDateFormatter ( ) ; String valueString = "'" + formatter . format ( value ) + "'" ; return new Expression < java . sql . Date > ( this , Operation . lte , valueString ) ; }
Method to construct the less than or equals expression for date
74
11
35,764
public Expression < Calendar > gt ( Calendar value ) { String valueString = "'" + getCalendarAsString ( value ) + "'" ; return new Expression < Calendar > ( this , Operation . gt , valueString ) ; }
Method to construct the greater than expression for calendar
50
9
35,765
public Expression < java . util . Date > gt ( java . util . Date value ) { SimpleDateFormat formatter = getDateTimeFormatter ( ) ; String valueString = "'" + formatter . format ( value ) . concat ( "Z" ) + "'" ; return new Expression < java . util . Date > ( this , Operation . gt , valueString ) ; }
Method to construct the greater than expression for date
83
9
35,766
public Expression < Calendar > gte ( Calendar value ) { String valueString = "'" + getCalendarAsString ( value ) + "'" ; return new Expression < Calendar > ( this , Operation . gte , valueString ) ; }
Method to construct the greater than or equals expression for calendar
50
11
35,767
public Expression < Calendar > in ( Calendar [ ] value ) { String valueString = "" ; Boolean firstCalendar = true ; for ( Calendar v : value ) { if ( firstCalendar ) { valueString = valueString . concat ( "('" ) . concat ( getCalendarAsString ( v ) ) . concat ( "'" ) ; firstCalendar = false ; } else { valueString = val...
Method to construct the in expression for calendar
151
8
35,768
public Expression < java . util . Date > in ( java . util . Date [ ] value ) { SimpleDateFormat formatter = getDateTimeFormatter ( ) ; String valueString = "" ; Boolean firstCalendar = true ; for ( Date v : value ) { if ( firstCalendar ) { valueString = valueString . concat ( "('" ) . concat ( formatter . format ( v ) ...
Method to construct the in expression for date
191
8
35,769
public Expression < Calendar > between ( Calendar startValue , Calendar endValue ) { String valueString = "'" + getCalendarAsString ( startValue ) . concat ( "Z" ) + "' AND '" + getCalendarAsString ( endValue ) + "'" ; return new Expression < Calendar > ( this , Operation . between , valueString ) ; }
Method to construct the between expression for calendar
77
8
35,770
private void setResponseElements ( IntuitMessage intuitMessage , HttpURLConnection httpUrlConnection ) throws FMSException { LOG . debug ( "Response headers:" + httpUrlConnection . getHeaderFields ( ) ) ; ResponseElements responseElements = intuitMessage . getResponseElements ( ) ; responseElements . setEncodingHeader ...
Method to set the response elements by reading the values from the response
305
13
35,771
private InputStream getCopyOfResponseContent ( InputStream is ) throws FMSException { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; InputStream copyIs = null ; try { byte [ ] bbuf = new byte [ LENGTH_256 ] ; while ( true ) { int r = is . read ( bbuf ) ; if ( r < 0 ) { break ; } baos . write ( bbuf , 0 , ...
Method to create the copy of the input stream of response body . This is required while decompress the original content
210
22
35,772
private void setTimeout ( HttpURLConnection httpUrlConnection ) { String connTimeout = Config . getProperty ( Config . TIMEOUT_CONNECTION ) ; if ( StringUtils . hasText ( connTimeout ) ) { httpUrlConnection . setReadTimeout ( new Integer ( connTimeout . trim ( ) ) ) ; } String reqTimeout = Config . getProperty ( Config...
Method to set the connection and request timeouts by reading from the configuration file
122
15
35,773
public PlatformResponse disconnect ( String consumerKey , String consumerSecret , String accessToken , String accessTokenSecret ) throws ConnectionException { httpClient = new PlatformHttpClient ( consumerKey , consumerSecret , accessToken , accessTokenSecret ) ; return this . httpClient . disconnect ( ) ; }
Disconnects the user from quickbooks
59
8
35,774
public User getcurrentUser ( String consumerKey , String consumerSecret , String accessToken , String accessTokenSecret ) throws ConnectionException { httpClient = new PlatformHttpClient ( consumerKey , consumerSecret , accessToken , accessTokenSecret ) ; User user = null ; ; try { user = this . httpClient . getCurrent...
getCurrentUser the user from quickbooks
91
8
35,775
public List < String > getAppMenu ( String consumerKey , String consumerSecret , String accessToken , String accessTokenSecret ) throws ConnectionException { try { List < String > menulist ; httpClient = new PlatformHttpClient ( consumerKey , consumerSecret , accessToken , accessTokenSecret ) ; menulist = this . httpCl...
Get App Menu returns list of all the applications that are linked with the selected company
127
16
35,776
private void swapRequestInterceptor ( Class < ? extends Interceptor > target , Interceptor interceptor ) { List < Interceptor > list = this . getRequestInterceptors ( ) ; for ( Interceptor object : list ) { if ( object . getClass ( ) == target ) { list . set ( list . indexOf ( object ) , interceptor ) ; } } this . setR...
Swap one interceptor with new one
90
8
35,777
private SyncObject getSyncObject ( JsonNode jsonNode ) { String name = null ; JsonNode jn1 = null ; SyncObject syncObject = new SyncObject ( ) ; Iterator < String > ite = jsonNode . fieldNames ( ) ; while ( ite . hasNext ( ) ) { String key = ite . next ( ) ; if ( JsonResourceTypeLocator . lookupType ( key ) != null ) {...
Method to Object Intuitobject
315
6
35,778
public ECheck create ( ECheck eCheck ) throws BaseException { logger . debug ( "Enter ECheckService::create" ) ; // prepare API url String apiUrl = requestContext . getBaseUrl ( ) + "echecks" . replaceAll ( "\\{format\\}" , "json" ) ; logger . info ( "apiUrl - " + apiUrl ) ; // assign TypeReference for deserialization ...
Method to create ECheck
211
5
35,779
public ECheck retrieve ( String eCheckId ) throws BaseException { logger . debug ( "Enter ECheckService::retrieve" ) ; if ( StringUtils . isBlank ( eCheckId ) ) { logger . error ( "IllegalArgumentException {}" , eCheckId ) ; throw new IllegalArgumentException ( "eCheckId cannot be empty or null" ) ; } // prepare API ur...
Method to retrieve ECheck
287
5
35,780
public Refund refund ( String eCheckId , Refund refund ) throws BaseException { logger . debug ( "Enter ECheckService::refund" ) ; if ( StringUtils . isBlank ( eCheckId ) ) { logger . error ( "IllegalArgumentException {}" , eCheckId ) ; throw new IllegalArgumentException ( "eCheckId cannot be empty or null" ) ; } // pr...
Method to refund or void ECheck
299
7
35,781
private CustomFieldDefinition getCustomFieldDefinitionType ( JsonNode jn ) throws IOException { if ( jn . isArray ( ) ) { JsonNode jn1 = jn . get ( 0 ) ; String type = jn1 . get ( TYPE ) . textValue ( ) ; try { return ( CustomFieldDefinition ) Class . forName ( "com.intuit.ipp.data." + type + "CustomFieldDefinition" ) ...
Method to get the CustomFieldDefinition implementation type object
133
10
35,782
private BatchItemResponse getBatchItemResponse ( JsonNode jsonNode ) throws IOException { ObjectMapper mapper = new ObjectMapper ( ) ; SimpleModule simpleModule = new SimpleModule ( "BatchItemResponseDeserializer" , new Version ( 1 , 0 , 0 , null ) ) ; simpleModule . addDeserializer ( BatchItemResponse . class , new Ba...
Method to deserialize the BatchItemResponse object
149
11
35,783
public void execute ( List < IntuitMessage > intuitMessages ) throws FMSException { LOG . debug ( "Enter HTTPBatchClientConnectionInterceptor - batch..." ) ; RequestElements intuitRequest = getFirst ( intuitMessages ) . getRequestElements ( ) ; IntuitRetryPolicyHandler handler = getRetryHandler ( ) ; HttpClientBuilder ...
Major executor . It is not part of interface
580
10
35,784
private IntuitMessage getFirst ( List < IntuitMessage > intuitMessages ) throws FMSException { if ( intuitMessages . isEmpty ( ) ) { throw new FMSException ( "IntuitMessages list is empty. Nothing to upload." ) ; } return intuitMessages . get ( 0 ) ; }
Returns first item from the list
70
6
35,785
public SSLConnectionSocketFactory prepareClientSSL ( ) { try { String path = Config . getProperty ( Config . PROXY_KEYSTORE_PATH ) ; String pass = Config . getProperty ( Config . PROXY_KEYSTORE_PASSWORD ) ; KeyStore trustStore = null ; if ( path != null && pass != null ) { trustStore = KeyStore . getInstance ( KeyStore...
Configures proxy if this is applicable to connection
279
9
35,786
private < T extends CloseableHttpClient > HttpRequestBase prepareHttpRequest ( RequestElements intuitRequest ) throws FMSException { //setTimeout(client, intuitRequest.getContext()); HttpRequestBase httpRequest = extractMethod ( intuitRequest , extractURI ( intuitRequest ) ) ; // populate the headers to HttpRequestBase...
Returns httpRequest instance with configured fields
157
7
35,787
private URI extractURI ( RequestElements intuitRequest ) throws FMSException { URI uri = null ; try { uri = new URI ( intuitRequest . getRequestParameters ( ) . get ( RequestElements . REQ_PARAM_RESOURCE_URL ) ) ; } catch ( URISyntaxException e ) { throw new FMSException ( "URISyntaxException" , e ) ; } return uri ; }
Returns URI instance which will be used as a connection source
94
11
35,788
private HttpRequestBase extractMethod ( RequestElements intuitRequest , URI uri ) throws FMSException { String method = intuitRequest . getRequestParameters ( ) . get ( RequestElements . REQ_PARAM_METHOD_TYPE ) ; if ( method . equals ( MethodType . GET . toString ( ) ) ) { return new HttpGet ( uri ) ; } else if ( metho...
Returns instance of HttpGet or HttpPost type depends from request parameters
128
15
35,789
private IntuitMessage executeHttpRequest ( HttpRequestBase httpRequest , CloseableHttpClient client ) throws FMSException { CloseableHttpResponse httpResponse = null ; IntuitMessage intuitMessage = new IntuitMessage ( ) ; try { // prepare HttpHost object HttpHost target = new HttpHost ( httpRequest . getURI ( ) . getHo...
Executes communication with remote host
295
6
35,790
private void authorizeRequest ( Context context , HttpRequestBase httpRequest ) throws FMSException { context . getAuthorizer ( ) . authorize ( httpRequest ) ; }
Method to authorize the given HttpRequest
35
8
35,791
private IntuitRetryPolicyHandler getRetryHandler ( ) throws FMSException { IntuitRetryPolicyHandler handler = null ; String policy = Config . getProperty ( Config . RETRY_MODE ) ; if ( policy . equalsIgnoreCase ( "fixed" ) ) { String retryCountStr = Config . getProperty ( Config . RETRY_FIXED_COUNT ) ; String retryInte...
Method to get the retry handler which is used to retry to establish the HTTP connection
528
18
35,792
private void setResponseElements ( IntuitMessage intuitMessage , HttpResponse httpResponse ) throws FMSException { ResponseElements responseElements = intuitMessage . getResponseElements ( ) ; if ( httpResponse . getLastHeader ( RequestElements . HEADER_PARAM_CONTENT_ENCODING ) != null ) { responseElements . setEncodin...
Method to set the response elements by reading the values from HttpResponse
369
14
35,793
private RequestConfig setTimeout ( Context context ) { int socketTimeout = 0 ; int connectionTimeout = 0 ; if ( context . getCustomerRequestTimeout ( ) != null ) { socketTimeout = context . getCustomerRequestTimeout ( ) ; } else { String reqTimeout = Config . getProperty ( Config . TIMEOUT_REQUEST ) ; if ( StringUtils ...
Method to set the connection and request timeouts by reading from the configuration file or Context object
212
18
35,794
private HttpEntity populateEntity ( RequestElements intuitRequest ) throws FMSException { byte [ ] compressedData = intuitRequest . getCompressedData ( ) ; if ( null == compressedData ) { // use postString to create httpEntity try { return new StringEntity ( intuitRequest . getPostString ( ) ) ; } catch ( UnsupportedEn...
Creates HttpEntity depends from type of content
131
10
35,795
public static String serialize ( Object obj ) throws SerializationException { try { if ( obj != null ) { return mapper . writeValueAsString ( obj ) ; } else { return null ; } } catch ( Exception e ) { logger . error ( "SerializationException {}" , e . getMessage ( ) ) ; throw new SerializationException ( e . getMessage...
Serialize object to String
84
5
35,796
public static Object deserialize ( String json , TypeReference < ? > typeReference ) throws SerializationException { try { logger . debug ( "Json string to deserialize {} " , json ) ; return mapper . readValue ( json , typeReference ) ; } catch ( IOException e ) { logger . error ( "SerializationException {}" , e . getM...
Deserialize String to object of TypeReference
105
9
35,797
@ SuppressWarnings ( "unchecked" ) public < T extends IEntity > List < T > findAll ( T entity ) throws FMSException { String intuitQuery = "SELECT * FROM " + entity . getClass ( ) . getSimpleName ( ) ; QueryResult result = executeQuery ( intuitQuery ) ; return ( List < T > ) result . getEntities ( ) ; }
Method to retrieve all records for the given entity Note without pagination this will return only 100 records Use query API to add pagintion and obtain additional records
86
31
35,798
@ SuppressWarnings ( "unchecked" ) public < T extends IEntity > T add ( T entity ) throws FMSException { IntuitMessage intuitMessage = prepareAdd ( entity ) ; //execute interceptors executeInterceptors ( intuitMessage ) ; return ( T ) retrieveEntity ( intuitMessage ) ; }
Method to add the given entity
70
6
35,799
@ SuppressWarnings ( "unchecked" ) public < T extends IEntity > T delete ( T entity ) throws FMSException { IntuitMessage intuitMessage = prepareDelete ( entity ) ; //execute interceptors executeInterceptors ( intuitMessage ) ; return ( T ) retrieveEntity ( intuitMessage ) ; }
Method to delete record for the given entity
70
8