idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
35,800
@ SuppressWarnings ( "unchecked" ) public < T extends IEntity > T update ( T entity ) throws FMSException { IntuitMessage intuitMessage = prepareUpdate ( entity ) ; //execute interceptors executeInterceptors ( intuitMessage ) ; return ( T ) retrieveEntity ( intuitMessage ) ; }
Method to update the record of the corresponding entity
70
9
35,801
@ SuppressWarnings ( "unchecked" ) public < T extends IEntity > T updateAccountOnTxns ( T entity ) throws FMSException { IntuitMessage intuitMessage = prepareupdateAccountOnTxns ( entity ) ; //execute interceptors executeInterceptors ( intuitMessage ) ; return ( T ) retrieveEntity ( intuitMessage ) ; }
updateAccountOnTxns used for France Locale with Minor Version > = 5 .
78
17
35,802
@ SuppressWarnings ( "unchecked" ) public < T extends IEntity > T donotUpdateAccountOnTxns ( T entity ) throws FMSException { IntuitMessage intuitMessage = preparedonotUpdateAccountOnTxns ( entity ) ; //execute interceptors executeInterceptors ( intuitMessage ) ; return ( T ) retrieveEntity ( intuitMessage ) ; }
donotUpdateAccountOnTxns used for France Locale with Minor Version > = 5 .
82
19
35,803
@ SuppressWarnings ( "unchecked" ) private < T extends IEntity > T retrieveEntity ( IntuitMessage intuitMessage ) { T returnEntity = null ; IntuitResponse intuitResponse = ( IntuitResponse ) intuitMessage . getResponseElements ( ) . getResponse ( ) ; if ( intuitResponse != null ) { JAXBElement < ? extends IntuitEntity ...
Common method to retrieve result entity from IntuitMessage
133
10
35,804
@ SuppressWarnings ( "unchecked" ) public < T extends IEntity > T voidRequest ( T entity ) throws FMSException { IntuitMessage intuitMessage = prepareVoidRequest ( entity ) ; //execute interceptors executeInterceptors ( intuitMessage ) ; return ( T ) retrieveEntity ( intuitMessage ) ; }
Method to cancel the operation for the corresponding entity
73
9
35,805
@ SuppressWarnings ( "unchecked" ) public < T extends IEntity > T upload ( T entity , InputStream docContent ) throws FMSException { IntuitMessage intuitMessage = prepareUpload ( entity , docContent ) ; //execute interceptors executeInterceptors ( intuitMessage ) ; return ( T ) getReturnEntity ( intuitMessage ) ; }
Method to upload the given document content for the corresponding entity
79
11
35,806
public < T extends IEntity > List < T > upload ( List < UploadEntry > entries ) throws FMSException { List < IntuitMessage > intuitMessages = prepareUpload ( entries ) ; //execute interceptors if ( ! intuitMessages . isEmpty ( ) ) { executeInterceptors ( intuitMessages ) ; } return getResultEntities ( intuitMessages ) ...
Method to upload entities with their correspond binary
85
8
35,807
@ SuppressWarnings ( "unchecked" ) private < T extends IEntity > List < T > getResultEntities ( List < IntuitMessage > intuitMessages ) { List < T > resultEntities = new ArrayList < T > ( ) ; int i = 0 ; for ( IntuitMessage intuitMessage : intuitMessages ) { if ( ! isContainResponse ( intuitMessage , i ) ) { LOG . warn...
Processes list of intuitMessages and returns list of resultEntities
150
15
35,808
private List < IntuitMessage > prepareUpload ( List < UploadEntry > entries ) throws FMSException { List < IntuitMessage > intuitMessages = new ArrayList < IntuitMessage > ( ) ; String boundaryId = null ; for ( UploadEntry item : entries ) { if ( item . isEmpty ( ) ) { LOG . warn ( "UploadEntry instance (hash:" + Syste...
Creates list of IntuitMessage instances based on list of entries
210
13
35,809
private boolean isContainResponse ( IntuitMessage intuitMessage , int idx ) { List < AttachableResponse > response = ( ( IntuitResponse ) intuitMessage . getResponseElements ( ) . getResponse ( ) ) . getAttachableResponse ( ) ; if ( null == response ) { return false ; } if ( 0 >= response . size ( ) ) { return false ; ...
verifies availability of an object in response
103
8
35,810
public < T extends IEntity > T sendEmail ( T entity ) throws FMSException { return sendEmail ( entity , null ) ; }
Send entity via email using address associated with this entity in the system
29
13
35,811
@ SuppressWarnings ( "unchecked" ) public < T extends IEntity > T sendEmail ( T entity , String email ) throws FMSException { if ( ! isAvailableToEmail ( entity ) ) { throw new FMSException ( "Following entity: " + entity . getClass ( ) . getSimpleName ( ) + " cannot be send as email" ) ; } IntuitMessage intuitMessage ...
Send entity via email using specified address
123
7
35,812
public List < CDCQueryResult > executeCDCQuery ( List < ? extends IEntity > entities , String changedSince ) throws FMSException { if ( entities == null || entities . isEmpty ( ) ) { throw new FMSException ( "Entities is required." ) ; } if ( ! StringUtils . hasText ( changedSince ) ) { throw new FMSException ( "change...
Method to retrieve the list of records for the given entities whose last modified date is greater than the given changedSince date
246
23
35,813
public void executeBatch ( BatchOperation batchOperation ) throws FMSException { IntuitMessage intuitMessage = prepareBatch ( batchOperation ) ; //execute interceptors executeInterceptors ( intuitMessage ) ; IntuitResponse intuitResponse = ( IntuitResponse ) intuitMessage . getResponseElements ( ) . getResponse ( ) ; i...
Method to execute the batch operation
554
6
35,814
public < T extends IEntity > void findAllAsync ( T entity , CallbackHandler callbackHandler ) throws FMSException { //findall is to be called as query String query = "SELECT * FROM " + entity . getClass ( ) . getSimpleName ( ) ; executeQueryAsync ( query , callbackHandler ) ; }
Method to retrieve all records for the given entity in asynchronous fashion Note without pagination this will return only 100 records Use query API to add pagintion and obtain additional records
68
34
35,815
public < T extends IEntity > void addAsync ( T entity , CallbackHandler callbackHandler ) throws FMSException { IntuitMessage intuitMessage = prepareAdd ( entity ) ; //set callback handler intuitMessage . getRequestElements ( ) . setCallbackHandler ( callbackHandler ) ; //execute async interceptors executeAsyncIntercep...
Method to add the given entity in asynchronous fashion
78
9
35,816
public < T extends IEntity > void deleteAsync ( T entity , CallbackHandler callbackHandler ) throws FMSException { IntuitMessage intuitMessage = prepareDelete ( entity ) ; //set callback handler intuitMessage . getRequestElements ( ) . setCallbackHandler ( callbackHandler ) ; //execute async interceptors executeAsyncIn...
Method to delete record for the given entity in asynchronous fashion
78
11
35,817
public < T extends IEntity > void updateAsync ( T entity , CallbackHandler callbackHandler ) throws FMSException { IntuitMessage intuitMessage = prepareUpdate ( entity ) ; //set callback handler intuitMessage . getRequestElements ( ) . setCallbackHandler ( callbackHandler ) ; //execute async interceptors executeAsyncIn...
Method to update the record of the corresponding entity in asynchronous fashion
78
12
35,818
public < T extends IEntity > void findByIdAsync ( T entity , CallbackHandler callbackHandler ) throws FMSException { IntuitMessage intuitMessage = prepareFindById ( entity ) ; //set callback handler intuitMessage . getRequestElements ( ) . setCallbackHandler ( callbackHandler ) ; //execute async interceptors executeAsy...
Method to find the record for the given id for the corresponding entity in asynchronous fashion
80
16
35,819
public < T extends IEntity > void uploadAsync ( T entity , InputStream docContent , CallbackHandler callbackHandler ) throws FMSException { IntuitMessage intuitMessage = prepareUpload ( entity , docContent ) ; //set callback handler intuitMessage . getRequestElements ( ) . setCallbackHandler ( callbackHandler ) ; //exe...
Method to upload the file for the given entity in asynchronous fashion
86
12
35,820
public < T extends IEntity > void sendEmailAsync ( T entity , CallbackHandler callbackHandler ) throws FMSException { sendEmailAsync ( entity , null , callbackHandler ) ; }
Method to send the entity to default email for the given id in asynchronous fashion
39
15
35,821
public < T extends IEntity > void sendEmailAsync ( T entity , String email , CallbackHandler callbackHandler ) throws FMSException { if ( ! isAvailableToEmail ( entity ) ) { throw new FMSException ( "Following entity: " + entity . getClass ( ) . getSimpleName ( ) + " cannot send as email (Async) " ) ; } IntuitMessage i...
Method to send the entity to email for the given id in asynchronous fashion
133
14
35,822
private < T extends IEntity > IntuitMessage prepareVoidRequest ( T entity ) throws FMSException { IntuitMessage intuitMessage = new IntuitMessage ( ) ; RequestElements requestElements = intuitMessage . getRequestElements ( ) ; //set the request parameters Map < String , String > requestParameters = requestElements . ge...
Common method to prepare the request params for voidRequest operation for both sync and async calls
186
17
35,823
private < T extends IEntity > IntuitMessage prepareUpload ( T entity , InputStream docContent , String boundaryId ) throws FMSException { IntuitMessage intuitMessage = new IntuitMessage ( ) ; RequestElements requestElements = intuitMessage . getRequestElements ( ) ; //set the request parameters Map < String , String > ...
Common method to prepare the request params for upload operation for both sync and async calls
257
16
35,824
private < T extends IEntity > Object verifyEntityId ( T entity ) throws FMSException { Class < ? > objectClass = entity . getClass ( ) ; Object rid = null ; Method m ; try { m = objectClass . getMethod ( "getId" ) ; rid = m . invoke ( entity ) ; } catch ( Exception e ) { throw new FMSException ( "Unable to read the met...
Verifies that entity has getID method which can be invoked to retrieve entity id
120
16
35,825
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 . getReque...
Common method to prepare the request params for query operation for both sync and async calls
222
16
35,826
private < T extends IEntity > IntuitMessage prepareCDCQuery ( List < ? extends IEntity > entities , String changedSince ) throws FMSException { IntuitMessage intuitMessage = new IntuitMessage ( ) ; RequestElements requestElements = intuitMessage . getRequestElements ( ) ; //set the request params Map < String , String ...
Common method to prepare the request params for CDC query operation for both sync and async calls
335
17
35,827
private < T extends IEntity > IntuitMessage prepareBatch ( BatchOperation batchOperation ) throws FMSException { IntuitMessage intuitMessage = new IntuitMessage ( ) ; RequestElements requestElements = intuitMessage . getRequestElements ( ) ; //set the request params Map < String , String > requestParameters = requestEl...
Common method to prepare the request params for batch operation for both sync and async calls
228
16
35,828
@ SuppressWarnings ( "unchecked" ) protected < T extends IEntity > Object getSerializableObject ( T object ) throws FMSException { Class < ? > objectClass = object . getClass ( ) ; String methodName = "create" . concat ( objectClass . getSimpleName ( ) ) ; ObjectFactory objectEntity = new ObjectFactory ( ) ; Class < ? ...
Method to get the serializable object for the given entity
297
11
35,829
protected QueryResult getQueryResult ( QueryResponse queryResponse ) { QueryResult queryResult = null ; if ( queryResponse != null ) { queryResult = new QueryResult ( ) ; queryResult . setEntities ( getEntities ( queryResponse ) ) ; queryResult . setFault ( queryResponse . getFault ( ) ) ; queryResult . setMaxResults (...
Method to read the query response from QueryResponse and set into QueryResult
127
14
35,830
protected List < CDCQueryResult > getCDCQueryResult ( List < CDCResponse > cdcResponses ) { List < CDCQueryResult > cdcQueryResults = null ; if ( cdcResponses != null ) { Iterator < CDCResponse > cdcResponseItr = cdcResponses . iterator ( ) ; while ( cdcResponseItr . hasNext ( ) ) { cdcQueryResults = new ArrayList < CD...
Method to get the list of CDCQueryResult object from list of CDCResponse
146
15
35,831
protected CDCQueryResult getCDCQueryResult ( CDCResponse cdcResponse ) { CDCQueryResult cdcQueryResult = new CDCQueryResult ( ) ; List < QueryResponse > queryResponses = cdcResponse . getQueryResponse ( ) ; if ( queryResponses != null ) { Map < String , QueryResult > queryResults = new HashMap < String , QueryResult > ...
Method to construct and return the CDCQueryResult object from CDCResponse
266
13
35,832
private void populateQueryResultsInCDC ( Map < String , QueryResult > queryResults , QueryResult queryResult ) { if ( queryResult != null ) { List < ? extends IEntity > entities = queryResult . getEntities ( ) ; if ( entities != null && ! entities . isEmpty ( ) ) { IEntity entity = entities . get ( 0 ) ; String entityN...
Method to populate the QueryResults hash map by reading the key from QueryResult entities
108
16
35,833
private void populateFaultInCDC ( CDCQueryResult cdcQueryResult , QueryResult queryResult ) { if ( queryResult != null ) { Fault fault = queryResult . getFault ( ) ; if ( fault != null ) { cdcQueryResult . setFalut ( fault ) ; } } }
Method to populate the fault in CDCQueryResult if any
64
11
35,834
private void readProperties ( ) { InputStream input = null ; try { input = getClass ( ) . getClassLoader ( ) . getResourceAsStream ( PROP_FILE_NAME ) ; if ( input == null ) { logger . info ( "Unnable to find " + PROP_FILE_NAME ) ; return ; } prop . load ( input ) ; } catch ( Exception e ) { logger . info ( "exception i...
Method to read propeties file and store the data
148
10
35,835
private byte [ ] getUploadFileContent ( RequestElements requestElements ) throws FMSException { Attachable attachable = ( Attachable ) requestElements . getEntity ( ) ; InputStream docContent = requestElements . getUploadRequestElements ( ) . getDocContent ( ) ; // gets the mime value form the filename String mime = ge...
Method to get the file content of the upload file based on the mime type
174
16
35,836
private boolean isImageType ( String mime ) { if ( StringUtils . hasText ( mime ) ) { for ( String imageMime : IMAGE_MIMES ) { if ( mime . equalsIgnoreCase ( imageMime ) ) { return true ; } } } return false ; }
Method to validate whether the given mime is an image file
66
12
35,837
private String getMime ( String name , String delimiter ) { if ( StringUtils . hasText ( name ) ) { return name . substring ( name . lastIndexOf ( delimiter ) , name . length ( ) ) ; } return null ; }
Method get the mime value from the given file name
55
11
35,838
public void setCompressedData ( byte [ ] compressedData ) { if ( compressedData != null ) { this . compressedData = Arrays . copyOf ( compressedData , compressedData . length ) ; } }
Sets compressed data
44
4
35,839
public BankAccount create ( BankAccount bankAccount , String customerId ) throws BaseException { logger . debug ( "Enter BankAccountService::create" ) ; if ( StringUtils . isBlank ( customerId ) ) { logger . error ( "IllegalArgumentException {}" , customerId ) ; throw new IllegalArgumentException ( "customerId cannot b...
Method to create BankAccount for a given customer
309
9
35,840
@ SuppressWarnings ( "unchecked" ) public QueryResponse getAllBankAccounts ( String customerId , int count ) throws BaseException { logger . debug ( "Enter BankAccountService::getAllBankAccounts" ) ; if ( StringUtils . isBlank ( customerId ) ) { logger . error ( "IllegalArgumentException {}" , customerId ) ; throw new ...
Method to Get All BankAccounts for a given customer specifying the count of records to be returned
377
19
35,841
private String extractEntity ( Object obj ) { String name = obj . getClass ( ) . getSimpleName ( ) ; String [ ] extracted = name . split ( "\\$\\$" ) ; if ( extracted . length == NUM_3 ) { return extracted [ 0 ] ; } return null ; }
Method to extract the entity
64
5
35,842
protected String extractPropertyName ( Method method ) { String name = method . getName ( ) ; name = name . startsWith ( "is" ) ? name . substring ( NUM_2 ) : name . substring ( NUM_3 ) ; return name ; }
extract the name of property from method called .
56
10
35,843
public Object getObject ( Type type ) throws FMSException { Object obj = null ; if ( type instanceof ParameterizedType ) { ParameterizedType pt = ( ParameterizedType ) type ; String typeString = pt . getActualTypeArguments ( ) [ 0 ] . toString ( ) . split ( " " ) [ 1 ] ; try { obj = Class . forName ( typeString ) . new...
Method to get the object for the given type
115
9
35,844
public List < EntitlementsResponse . Entitlement > getEntitlement ( ) { if ( entitlement == null ) { entitlement = new ArrayList < EntitlementsResponse . Entitlement > ( ) ; } return this . entitlement ; }
Gets the value of the entitlement property .
51
9
35,845
public void prepareResponse ( Request request , Response response , Entity entity ) { entity . setIntuit_tid ( response . getIntuit_tid ( ) ) ; entity . setRequestId ( request . getContext ( ) . getRequestId ( ) ) ; }
Sets additional attributes to the entity
57
7
35,846
public Expression < Boolean > eq ( Boolean value ) { String valueString = value . toString ( ) ; return new Expression < Boolean > ( this , Operation . eq , valueString ) ; }
Method to construct the equals expression for boolean
40
8
35,847
public Expression < Boolean > neq ( Boolean value ) { String valueString = value . toString ( ) ; return new Expression < Boolean > ( this , Operation . neq , valueString ) ; }
Method to construct the not equals expression for boolean
42
9
35,848
public Expression < Boolean > in ( Boolean [ ] value ) { String listBooleanString = "" ; Boolean firstNumber = true ; for ( Boolean v : value ) { if ( firstNumber ) { listBooleanString = listBooleanString . concat ( "(" ) . concat ( v . toString ( ) ) ; firstNumber = false ; } else { listBooleanString = listBooleanStri...
Method to construct the in expression for boolean
144
8
35,849
public List < JAXBElement < ? extends IntuitEntity > > getIntuitObject ( ) { if ( intuitObject == null ) { intuitObject = new ArrayList < JAXBElement < ? extends IntuitEntity > > ( ) ; } return this . intuitObject ; }
Any IntuitEntity derived object like Customer Invoice can be part of response Gets the value of the intuitObject property .
63
25
35,850
private static PropertyHelper init ( ) { propertHelper = new PropertyHelper ( ) ; try { ResourceBundle bundle = ResourceBundle . getBundle ( "ippdevkit" ) ; propertHelper . setVersion ( bundle . getString ( "version" ) ) ; propertHelper . setRequestSource ( bundle . getString ( "request.source" ) ) ; propertHelper . se...
Method to init the PropertyHelper by loading the ippdevkit . properties file
134
16
35,851
@ SuppressWarnings ( "unchecked" ) private < T extends IEntity > List < T > getEntities ( QueryResponse queryResponse ) { List < T > entityList = new ArrayList < T > ( ) ; List < JAXBElement < ? extends IntuitEntity > > intuitObjectsList = queryResponse . getIntuitObject ( ) ; // Iterate the IntuitObjects list in Query...
Method to parse the QueryResponse and create the entity list
207
11
35,852
private boolean isDownload ( String action ) { if ( StringUtils . hasText ( action ) && action . equals ( OperationType . DOWNLOAD . toString ( ) ) ) { return true ; } return false ; }
Method to validate if the given action is download feature
46
10
35,853
private InputStream getDownloadedFile ( String response ) throws FMSException { if ( response != null ) { try { URL url = new URL ( response ) ; return url . openStream ( ) ; } catch ( Exception e ) { throw new FMSException ( "Exception while downloading the file from URL." , e ) ; } } return null ; }
Method to get the input stream from the download URL returned from service
74
13
35,854
private void executeRequestInterceptors ( final IntuitMessage intuitMessage ) throws FMSException { Iterator < Interceptor > itr = requestInterceptors . iterator ( ) ; while ( itr . hasNext ( ) ) { Interceptor interceptor = itr . next ( ) ; interceptor . execute ( intuitMessage ) ; } }
Method to execute only request interceptors which are added to requestInterceptors list
74
16
35,855
private void executeResponseInterceptors ( final IntuitMessage intuitMessage ) throws FMSException { Iterator < Interceptor > itr = responseInterceptors . iterator ( ) ; while ( itr . hasNext ( ) ) { Interceptor interceptor = itr . next ( ) ; interceptor . execute ( intuitMessage ) ; } }
Method to execute only response interceptors which are added to the responseInterceptors list
74
17
35,856
protected void invokeFeature ( String featureSwitch , Feature feature ) { if ( Config . getBooleanProperty ( featureSwitch , true ) ) { feature . execute ( ) ; } }
Executes feature if switch setting is on
37
8
35,857
protected void updateBigDecimalScale ( IntuitEntity intuitType ) { Feature feature = new Feature ( ) { private IntuitEntity obj ; public < T extends IntuitEntity > void set ( T object ) { obj = object ; } public void execute ( ) { ( new BigDecimalScaleUpdater ( ) ) . execute ( obj ) ; } } ; feature . set ( intuitType )...
Updates instances of BigDecimal with new scale in intuitEntity
106
14
35,858
private void prepareDataServiceRequest ( IntuitMessage intuitMessage , RequestElements requestElements , Map < String , String > requestParameters , String action ) throws FMSException { requestParameters . put ( RequestElements . REQ_PARAM_RESOURCE_URL , getUri ( intuitMessage . isPlatformService ( ) , action , reques...
Method to prepare request parameters for data service
573
8
35,859
private void setupAcceptEncoding ( Map < String , String > requestHeaders ) { // validates whether to add headers for accept-encoding for compression String acceptCompressionFormat = Config . getProperty ( Config . COMPRESSION_RESPONSE_FORMAT ) ; if ( StringUtils . hasText ( acceptCompressionFormat ) ) { requestHeaders...
Setup accept encoding header from configuration
105
6
35,860
private void setupAcceptHeader ( String action , Map < String , String > requestHeaders , Map < String , String > requestParameters ) { // validates whether to add headers for accept for serialization String serializeAcceptFormat = getSerializationResponseFormat ( ) ; if ( StringUtils . hasText ( serializeAcceptFormat ...
Setup accept header depends from the semantic of the request
184
10
35,861
private < T extends IEntity > String getEntityName ( T entity ) { if ( entity != null ) { return entity . getClass ( ) . getSimpleName ( ) . toLowerCase ( ) ; } return null ; }
Method to get the entity name from the given entity object
48
11
35,862
private < T extends IEntity > String getUri ( Boolean platformService , String action , Context context , Map < String , String > requestParameters , Boolean entitlementService ) throws FMSException { String uri = null ; if ( ! platformService ) { ServiceType serviceType = context . getIntuitServiceType ( ) ; if ( enti...
Method to construct the URI
201
5
35,863
protected String getBaseUrl ( String url ) { if ( url . endsWith ( "/" ) ) { return url . substring ( 0 , url . length ( ) - 1 ) ; } else { return url ; } }
Return QBO base configuration from config file
47
8
35,864
private < T extends IEntity > String prepareQBOUri ( String entityName , Context context , Map < String , String > requestParameters ) throws FMSException { StringBuilder uri = new StringBuilder ( ) ; if ( entityName . equalsIgnoreCase ( "Taxservice" ) ) { entityName = entityName + "/" + "taxcode" ; } // constructs req...
Method to construct the QBO URI
514
7
35,865
private void addEntityID ( Map < String , String > requestParameters , StringBuilder uri ) { if ( StringUtils . hasText ( requestParameters . get ( RequestElements . REQ_PARAM_ENTITY_ID ) ) ) { uri . append ( "/" ) . append ( requestParameters . get ( RequestElements . REQ_PARAM_ENTITY_ID ) ) ; } }
adding the entity id in the URI which is required for READ operation
88
13
35,866
private void addEntitySelector ( Map < String , String > requestParameters , StringBuilder uri ) { if ( StringUtils . hasText ( requestParameters . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) ) ) { uri . append ( "/" ) . append ( requestParameters . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) ) ; } }
adding additional selector in the URI which is required for READ operation Main purpose is to select or modify requested resource with well - defined keyword
91
26
35,867
private < T extends IEntity > String prepareQBOPremierUri ( String entityName , Context context , Map < String , String > requestParameters ) throws FMSException { StringBuilder uri = new StringBuilder ( ) ; // constructs request URI uri . append ( Config . getProperty ( "BASE_URL_QBO_OLB" ) ) . append ( "/" ) . append...
Method to construct the OLB QBO URI
303
9
35,868
private String prepareIPSUri ( String action , Context context ) throws FMSException { StringBuilder uri = new StringBuilder ( ) ; uri . append ( Config . getProperty ( Config . BASE_URL_PLATFORMSERVICE ) ) . append ( "/" ) . append ( context . getAppDBID ( ) ) . append ( "?act=" ) . append ( action ) . append ( "&toke...
Method to construct the IPS URI
114
6
35,869
private String buildRequestParams ( Map < String , String > requestParameters ) throws FMSException { StringBuilder reqParams = new StringBuilder ( ) ; Set < String > keySet = requestParameters . keySet ( ) ; Iterator < String > keySetIterator = keySet . iterator ( ) ; while ( keySetIterator . hasNext ( ) ) { String ke...
Method to build the request params which are to be added in the URI
384
14
35,870
private void prepareUploadParams ( RequestElements requestElements ) { Map < String , String > requestHeaders = requestElements . getRequestHeaders ( ) ; UploadRequestElements uploadRequestElements = requestElements . getUploadRequestElements ( ) ; String boundaryId = uploadRequestElements . getBoundaryId ( ) ; String ...
Method to prepare the request params for upload functionality
425
9
35,871
private boolean isDownloadPDF ( Map < String , String > map ) { return StringUtils . hasText ( map . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) ) && map . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) . equalsIgnoreCase ( ContentTypes . PDF . name ( ) ) ; }
Method returns true if this request expects PDF as response
82
10
35,872
private boolean isSendEmail ( Map < String , String > map ) { return StringUtils . hasText ( map . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) ) && map . get ( RequestElements . REQ_PARAM_ENTITY_SELECTOR ) . equalsIgnoreCase ( RequestElements . PARAM_SEND_SELECTOR ) ; }
Method returns true if this request should be send as email
86
11
35,873
private boolean isUpload ( String action ) { if ( StringUtils . hasText ( action ) && action . equals ( OperationType . UPLOAD . toString ( ) ) ) { return true ; } return false ; }
Method to validate if the given action is upload feature
47
10
35,874
private SyncError getSyncError ( JsonNode jsonNode ) throws IOException { ObjectMapper mapper = new ObjectMapper ( ) ; SimpleModule simpleModule = new SimpleModule ( "SyncErrorDeserializer" , new Version ( 1 , 0 , 0 , null ) ) ; simpleModule . addDeserializer ( SyncError . class , new SyncErrorDeserializer ( ) ) ; mapp...
Method to deserialize the SyncError object
111
9
35,875
public Expression < Enum < ? > > eq ( Enum < ? > value ) { String valueString = "'" + EnumPath . getValue ( value ) + "'" ; return new Expression < Enum < ? > > ( this , Operation . eq , valueString ) ; }
Method to construct the equals expression for enum
61
8
35,876
private static String getValue ( Enum < ? > value ) { try { Method m = value . getClass ( ) . getDeclaredMethod ( "value" ) ; return ( String ) m . invoke ( value ) ; } catch ( NoSuchMethodException ex ) { } catch ( IllegalAccessException ex ) { } catch ( InvocationTargetException ex ) { } return value . toString ( ) ;...
Intuit data enumerations have a value property which should be used in queries instead of enum names .
86
20
35,877
public Token createToken ( Token token ) throws BaseException { logger . debug ( "Enter TokenService::createToken" ) ; // prepare API url String apiUrl = requestContext . getBaseUrl ( ) + "tokens" ; logger . info ( "apiUrl - " + apiUrl ) ; // assign TypeReference for deserialization TypeReference < Token > typeReferenc...
Method to create BankAccount
193
5
35,878
private String getCDCQueryJson ( CDCQuery cdcQuery ) throws SerializationException { ObjectMapper mapper = getObjectMapper ( ) ; String json = null ; try { json = mapper . writeValueAsString ( cdcQuery ) ; } catch ( Exception e ) { throw new SerializationException ( e ) ; } return json ; }
Method to get the Json string for CDCQuery object
75
11
35,879
private ObjectMapper getObjectMapper ( ) { ObjectMapper mapper = new ObjectMapper ( ) ; AnnotationIntrospector primary = new JacksonAnnotationIntrospector ( ) ; AnnotationIntrospector secondary = new JaxbAnnotationIntrospector ( ) ; AnnotationIntrospector pair = new AnnotationIntrospectorPair ( primary , secondary ) ; ...
Method to get the Jackson object mapper
122
8
35,880
public OAuthMigrationResponse migrate ( ) throws ConnectionException { logger . debug ( "Enter OAuthMigrationClient::migrate" ) ; try { HttpRequestClient client = new HttpRequestClient ( oAuthMigrationRequest . getOauth2config ( ) . getProxyConfig ( ) ) ; //prepare post json String requestjson = new JSONObject ( ) . pu...
Calls the migrate API based on the the request provided and returns an object with oauth2 tokens
418
20
35,881
public Date unmarshal ( String value ) { if ( value != null ) { if ( value . length ( ) >= lengthOfDateFmtYYYY_MM_DD ) { //Extract just the date from the string YYYY-MM-DD value = value . substring ( 0 , lengthOfDateFmtYYYY_MM_DD ) ; boolean isMatch = value . matches ( datePattern ) ; if ( isMatch ) { return DatatypeCo...
Unmarshal a Date .
175
7
35,882
public < T extends IEntity > void addEntity ( T entity , OperationEnum operation , String bId ) { BatchItemRequest batchItemRequest = new BatchItemRequest ( ) ; batchItemRequest . setBId ( bId ) ; batchItemRequest . setOperation ( operation ) ; batchItemRequest . setIntuitObject ( getIntuitObject ( entity ) ) ; batchIt...
Method to add the entity batch operations to the batchItemRequest
103
12
35,883
public void addQuery ( String query , String bId ) { BatchItemRequest batchItemRequest = new BatchItemRequest ( ) ; batchItemRequest . setBId ( bId ) ; batchItemRequest . setQuery ( query ) ; batchItemRequests . add ( batchItemRequest ) ; bIds . add ( bId ) ; }
Method to add the query batch operation to batchItemRequest
74
11
35,884
public void addCDCQuery ( List < ? extends IEntity > entities , String changedSince , String bId ) throws FMSException { if ( entities == null || entities . isEmpty ( ) ) { throw new FMSException ( "Entities is required." ) ; } if ( ! StringUtils . hasText ( changedSince ) ) { throw new FMSException ( "changedSince is ...
Method to add the cdc query batch operation to batchItemRequest
341
13
35,885
public void addReportQuery ( String reportQuery , String bId ) { BatchItemRequest batchItemRequest = new BatchItemRequest ( ) ; batchItemRequest . setBId ( bId ) ; batchItemRequest . setReportQuery ( reportQuery ) ; batchItemRequests . add ( batchItemRequest ) ; bIds . add ( bId ) ; }
Method to add the report query batch operation to batchItemRequest
78
12
35,886
@ SuppressWarnings ( "unchecked" ) protected < T > JAXBElement < ? extends IntuitEntity > getIntuitObject ( T entity ) { Class < ? > objectClass = entity . getClass ( ) ; String methodName = "create" . concat ( objectClass . getSimpleName ( ) ) ; ObjectFactory objectEntity = new ObjectFactory ( ) ; Class < ? > objectEn...
Method to get the corresponding IEntity type for the given JAXBElement
250
15
35,887
public CredentialsProvider setProxyAuthentication ( ProxyConfig proxyConfig ) { if ( proxyConfig == null ) { return null ; } String username = proxyConfig . getUsername ( ) ; String password = proxyConfig . getPassword ( ) ; if ( ! username . isEmpty ( ) && ! password . isEmpty ( ) ) { String host = proxyConfig . getHo...
Method to set proxy authentication
238
5
35,888
public Response makeJsonRequest ( Request request , OAuthMigrationRequest migrationRequest ) throws InvalidRequestException { logger . debug ( "Enter HttpRequestClient::makeJsonRequest" ) ; //create oauth consumer using tokens OAuthConsumer consumer = new CommonsHttpOAuthConsumer ( migrationRequest . getConsumerKey ( )...
Method to make the HTTP POST request using the request attributes supplied
490
12
35,889
public static Marshaller createMarshaller ( ) throws JAXBException { Marshaller marshaller = MessageUtilsHelper . getContext ( ) . createMarshaller ( ) ; marshaller . setProperty ( Marshaller . JAXB_FORMATTED_OUTPUT , Boolean . TRUE ) ; return marshaller ; }
Create Marshaller from the JAXB context .
72
10
35,890
public URL constructURL ( ) throws InvalidRequestException { String stringUri = url ; try { URI uri = new URI ( stringUri ) ; return uri . toURL ( ) ; } catch ( final URISyntaxException e ) { throw new InvalidRequestException ( "Bad URI: " + stringUri , e ) ; } catch ( final MalformedURLException e ) { throw new Invali...
Prepares request URL
106
4
35,891
public OptionalSyntax where ( Expression < ? > ... expression ) { for ( Expression < ? > exp : expression ) { getMessage ( ) . getOptional ( ) . add ( exp . toString ( ) ) ; LOG . debug ( "expression: " + exp ) ; } QueryMessage mess = getMessage ( ) ; return new OptionalSyntax ( mess ) ; }
Method to get the optional syntax for where operator
77
9
35,892
public OptionalSyntax orderBy ( Path < ? > ... path ) { String fieldList = "" ; boolean firstExpression = true ; for ( Path < ? > exp : path ) { if ( firstExpression ) { fieldList = fieldList . concat ( exp . toString ( ) ) ; firstExpression = false ; } else { fieldList = fieldList . concat ( ", " ) . concat ( exp . to...
Method to get the optional syntax for order by operator
141
10
35,893
public OptionalSyntax skip ( int num ) { getMessage ( ) . setStartposition ( num ) ; QueryMessage mess = getMessage ( ) ; return new OptionalSyntax ( mess ) ; }
Method to get the optional syntax for skip operator
41
9
35,894
public OptionalSyntax take ( int num ) { getMessage ( ) . setMaxresults ( num ) ; QueryMessage mess = getMessage ( ) ; return new OptionalSyntax ( mess ) ; }
Method to get the optional syntax for take operator
41
9
35,895
public static String getResult ( HttpResponse response ) throws IOException { StringBuffer result = new StringBuffer ( ) ; if ( response . getEntity ( ) != null && response . getEntity ( ) . getContent ( ) != null ) { BufferedReader rd = new BufferedReader ( new InputStreamReader ( response . getEntity ( ) . getContent...
Parse the response and return the string from httpresponse body
133
12
35,896
JavaXmlQuery compile ( XPath xpath ) { try { this . expression = xpath . compile ( getQuery ( ) ) ; } catch ( XPathExpressionException e ) { LOGGER . error ( "Cannot compile XPath query: " + getQuery ( ) , e ) ; } return this ; }
Adds a compiled expression to the query
68
7
35,897
private Object getObjectValue ( XmlNode node , String fieldName ) { // we have to take into account the fact that fieldName will be in the lower case if ( node != null ) { String name = node . getName ( ) ; switch ( node . getType ( ) ) { case XmlNode . ATTRIBUTE_NODE : return name . equalsIgnoreCase ( fieldName ) ? no...
Returns the object value for the given VTD XML node and field name
225
14
35,898
private String getStringValue ( XmlNodeArray nodes ) { StringBuilder stringBuilder = new StringBuilder ( ) ; // If all we have is just a bunch of nodes and the user wants a string // we'll use a parent element called <string> to have a valid XML document stringBuilder . append ( "<string>" ) ; for ( XmlNode node : node...
Returns the string value for the given node array
113
9
35,899
private Object getObjectValue ( Node node , String fieldName ) { // we have to take into account the fact that fieldName will be in the lower case if ( node != null ) { String name = node . getLocalName ( ) ; switch ( node . getNodeType ( ) ) { case Node . ATTRIBUTE_NODE : return name . equalsIgnoreCase ( fieldName ) ?...
Returns the object value for the given field name and node
223
11