signature:
public class MailMessage { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code MailMessage }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Mail Template . . .
if ( this . getMailTemplate ( ) != null ) { returnVal . put ( JSONMapping . MAIL_TEMPLATE , this . getMailTemplate ( ) ) ; } // Mail SMTP Server . . .
if ( this . getMailSMTPServer ( ) != null ) { returnVal . put ( JSONMapping . MAIL_SMTP_SERVER , this . getMailSMTPServer ( ) ) ; } // Recipients . . .
if ( this . getRecipients ( ) != null && this . getRecipients ( ) . length > 0 ) { JSONArray jsonArray = new JSONArray ( ) ; for ( String item : this . getRecipients ( ) ) { jsonArray . put ( item ) ; } returnVal . put ( JSONMapping . RECIPIENTS , jsonArray ) ; } // Attachments . . .
if ( this . getAttachments ( ) != null && ! this . getAttachments ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( MailMessageAttachment item : this . getAttachments ( ) ) { jsonArray . put ( item . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . ATTACHMENTS , jsonArray ) ; } // Name Values . . .
if ( this . getNameValues ( ) != null && ! this . getNameValues ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( MailMessageNameValue item : this . getNameValues ( ) ) { jsonArray . put ( item . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . NAME_VALUES , jsonArray ) ; } return returnVal ;


signature:
public class ServiceTicket { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code ServiceTicket }
 * @ throws JSONException If there is a problem with the JSON Body . */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation: JSONObject returnVal = new JSONObject ( ) ; returnVal . put ( JSONMapping . CLIENT , this . getPrincipalClient ( ) ) ; returnVal . put ( JSONMapping . SESSION_KEY , this . getSessionKeyBase64 ( ) ) ; returnVal . put ( JSONMapping . TICKET_EXPIRES , this . getTicketExpires ( ) ) ; returnVal . put ( JSONMapping . AUTHORISED_USERNAME , this . getAuthorisedUsername ( ) ) ; return returnVal ;


signature:
public class WebSocketSendToFlowClient { /** * Sends the { @ code formToSendToFlowParam } to a { @ code Flow } in Fluid .
 * The return value is the { @ code FluidItem } created as a result .
 * The Web socket has the ability to wait for the workflow to finish
 * and then only respond with the final result of the item .
 * @ param formToSendToFlowParam The Fluid Form to send to flow .
 * @ param destinationFlowParam The destination flow .
 * @ return The { @ code formToSendToFlowParam } created as { @ code FluidItem } . */
public FluidItem sendToFlowSynchronized ( Form formToSendToFlowParam , String destinationFlowParam ) { } }

implementation:
if ( formToSendToFlowParam == null ) { return null ; } if ( destinationFlowParam == null || destinationFlowParam . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "No destination Flow provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } FluidItem itemToSend = new FluidItem ( ) ; itemToSend . setFlow ( destinationFlowParam ) ; itemToSend . setForm ( formToSendToFlowParam ) ; // Send all the messages . . .
itemToSend . setEcho ( UUID . randomUUID ( ) . toString ( ) ) ; // Start a new request . . .
String uniqueReqId = this . initNewRequest ( ) ; // Send the actual message . . .
this . sendMessage ( itemToSend , uniqueReqId ) ; try { List < FluidItem > returnValue = this . getHandler ( uniqueReqId ) . getCF ( ) . get ( this . getTimeoutInMillis ( ) , TimeUnit . MILLISECONDS ) ; // Connection was closed . . this is a problem . . . .
if ( this . getHandler ( uniqueReqId ) . isConnectionClosed ( ) ) { throw new FluidClientException ( "WebSocket-SendToFlow: " + "The connection was closed by the server prior to the response received." , FluidClientException . ErrorCode . IO_ERROR ) ; } if ( returnValue == null || returnValue . isEmpty ( ) ) { return null ; } return returnValue . get ( 0 ) ; } // Interrupted . . .
catch ( InterruptedException exceptParam ) { throw new FluidClientException ( "WebSocket-Interrupted-SendToFlow: " + exceptParam . getMessage ( ) , exceptParam , FluidClientException . ErrorCode . STATEMENT_EXECUTION_ERROR ) ; } // Error on the web - socket . . .
catch ( ExecutionException executeProblem ) { Throwable cause = executeProblem . getCause ( ) ; // Fluid client exception . . .
if ( cause instanceof FluidClientException ) { throw ( FluidClientException ) cause ; } else { throw new FluidClientException ( "WebSocket-SendToFlow: " + cause . getMessage ( ) , cause , FluidClientException . ErrorCode . STATEMENT_EXECUTION_ERROR ) ; } } // Timeout . . .
catch ( TimeoutException eParam ) { throw new FluidClientException ( "WebSocket-SendToFlow: Timeout while waiting for all return data. There were '" + this . getHandler ( uniqueReqId ) . getReturnValue ( ) . size ( ) + "' items after a Timeout of " + ( TimeUnit . MILLISECONDS . toSeconds ( this . getTimeoutInMillis ( ) ) ) + " seconds." , FluidClientException . ErrorCode . IO_ERROR ) ; } finally { this . removeHandler ( uniqueReqId ) ; }


signature:
public class ABaseFluidVO { /** * Gets the Service Ticket associated with the Fluid session as HEX .
 * @ return Service Ticket of Fluid session in Hex format .
 * @ see com . fluidbpm . program . api . vo . ws . auth . ServiceTicket */
public String getServiceTicketAsHexUpper ( ) { } }

implementation: String serviceTicket = this . getServiceTicket ( ) ; if ( serviceTicket == null ) { return null ; } if ( serviceTicket . isEmpty ( ) ) { return serviceTicket ; } byte [ ] base64Bytes = Base64 . getDecoder ( ) . decode ( serviceTicket ) ; return this . bytesToHex ( base64Bytes ) ;


signature:
public class ABaseFluidVO { /** * Convert the byte [ ] to a HEX string as upper case .
 * @ param bytesToConvert The { @ code byte [ ] } to convert .
 * @ return String with upper case HEX . */
private String bytesToHex ( byte [ ] bytesToConvert ) { } }

implementation: if ( bytesToConvert == null ) { return null ; } if ( bytesToConvert . length == 0 ) { return UtilGlobal . EMPTY ; } char [ ] hexChars = new char [ bytesToConvert . length * 2 ] ; for ( int index = 0 ; index < bytesToConvert . length ; index ++ ) { int andWith127 = ( bytesToConvert [ index ] & 0xFF ) ; hexChars [ index * 2 ] = HEX_ARRAY [ andWith127 >>> 4 ] ; hexChars [ index * 2 + 1 ] = HEX_ARRAY [ andWith127 & 0x0F ] ; } return new String ( hexChars ) ;


signature:
public class RoleToUserQuery { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code RoleToUserQuery }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // User Query . . .
if ( this . getUserQuery ( ) != null ) { returnVal . put ( JSONMapping . USER_QUERY , this . getUserQuery ( ) . toJsonObject ( ) ) ; } // Role . . .
if ( this . getRole ( ) != null ) { returnVal . put ( JSONMapping . ROLE , this . getRole ( ) . toJsonObject ( ) ) ; } return returnVal ;


signature:
public class FormFieldClient { /** * Create a new Text Masked field .
 * @ param formFieldParam Field to Create .
 * @ param maskValueParam The masked value . Example : ( 999 ) 999 xxx .
 * @ return Created Field . */
public Field createFieldTextMasked ( Field formFieldParam , String maskValueParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( maskValueParam == null || maskValueParam . trim ( ) . isEmpty ( ) ) { maskValueParam = "" ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . Text ) ; formFieldParam . setTypeMetaData ( FieldMetaData . Text . MASKED . concat ( maskValueParam ) ) ; } return new Field ( this . putJson ( formFieldParam , WS . Path . FormField . Version1 . formFieldCreate ( ) ) ) ;


signature:
public class FormFieldClient { /** * Create a new Text Barcode field .
 * @ param formFieldParam Field to Create .
 * @ param barcodeTypeParam The type of barcode .
 * @ return Created Field .
 * @ see com . fluidbpm . ws . client . v1 . ABaseFieldClient . FieldMetaData . Text */
public Field createFieldTextBarcode ( Field formFieldParam , String barcodeTypeParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( barcodeTypeParam == null || barcodeTypeParam . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "Barcode type cannot be empty." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . Text ) ; formFieldParam . setTypeMetaData ( FieldMetaData . Text . BARCODE . concat ( barcodeTypeParam ) ) ; } return new Field ( this . putJson ( formFieldParam , WS . Path . FormField . Version1 . formFieldCreate ( ) ) ) ;


signature:
public class FormFieldClient { /** * Create a new Multi Choice field .
 * @ param formFieldParam Field to Create .
 * @ param multiChoiceValuesParam The available multi choice values .
 * @ return Created Field . */
public Field createFieldMultiChoicePlain ( Field formFieldParam , List < String > multiChoiceValuesParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( multiChoiceValuesParam == null ) { multiChoiceValuesParam = new ArrayList ( ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . MultipleChoice ) ; formFieldParam . setTypeMetaData ( FieldMetaData . MultiChoice . PLAIN ) ; formFieldParam . setFieldValue ( new MultiChoice ( multiChoiceValuesParam ) ) ; } return new Field ( this . putJson ( formFieldParam , WS . Path . FormField . Version1 . formFieldCreate ( ) ) ) ;


signature:
public class FormFieldClient { /** * Create a new Decimal Spinner field .
 * @ param formFieldParam Field to Create .
 * @ param minParam The min allowed value .
 * @ param maxParam The max allowed value .
 * @ param stepFactorParam The increment factor .
 * @ param prefixParam The Prefix of the spinner . Example . $ .
 * @ return Created Field . */
public Field createFieldDecimalSpinner ( Field formFieldParam , double minParam , double maxParam , double stepFactorParam , String prefixParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . Decimal ) ; formFieldParam . setTypeMetaData ( this . getMetaDataForDecimalAs ( FieldMetaData . Decimal . SPINNER , minParam , maxParam , stepFactorParam , prefixParam ) ) ; } return new Field ( this . putJson ( formFieldParam , WS . Path . FormField . Version1 . formFieldCreate ( ) ) ) ;


signature:
public class FormFieldClient { /** * Create a new Decimal Slider field .
 * @ param formFieldParam Field to Create .
 * @ param minParam The min allowed value .
 * @ param maxParam The max allowed value .
 * @ param stepFactorParam The increment factor .
 * @ return Created Field . */
public Field createFieldDecimalSlider ( Field formFieldParam , double minParam , double maxParam , double stepFactorParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . Decimal ) ; formFieldParam . setTypeMetaData ( this . getMetaDataForDecimalAs ( FieldMetaData . Decimal . SLIDER , minParam , maxParam , stepFactorParam , null ) ) ; } return new Field ( this . putJson ( formFieldParam , WS . Path . FormField . Version1 . formFieldCreate ( ) ) ) ;


signature:
public class FormFieldClient { /** * Creates a new Table Field .
 * @ param formFieldParam The Base field to create .
 * @ param formDefinitionParam The Form Definition for the Table Field .
 * @ param sumDecimalsParam Whether decimals should be summed .
 * @ return Table Field . */
public Field createFieldTable ( Field formFieldParam , Form formDefinitionParam , boolean sumDecimalsParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . Table ) ; formFieldParam . setTypeMetaData ( this . getMetaDataForTableField ( formDefinitionParam , sumDecimalsParam ) ) ; } return new Field ( this . putJson ( formFieldParam , WS . Path . FormField . Version1 . formFieldCreate ( ) ) ) ;


signature:
public class FormFieldClient { /** * Update an existing Masked Text field .
 * @ param formFieldParam Field to Update .
 * @ param maskValueParam The new masked value .
 * @ return Updated Field . */
public Field updateFieldTextMasked ( Field formFieldParam , String maskValueParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( maskValueParam == null || maskValueParam . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "Masked value cannot be empty." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . Text ) ; formFieldParam . setTypeMetaData ( FieldMetaData . Text . MASKED . concat ( maskValueParam ) ) ; } return new Field ( this . postJson ( formFieldParam , WS . Path . FormField . Version1 . formFieldUpdate ( ) ) ) ;


signature:
public class FormFieldClient { /** * Update an existing Barcode Text field .
 * @ param formFieldParam Field to Update .
 * @ param barcodeTypeParam The new type of barcode image .
 * @ return Updated Field . */
public Field updateFieldTextBarcode ( Field formFieldParam , String barcodeTypeParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( barcodeTypeParam == null || barcodeTypeParam . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "Barcode type cannot be empty." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . Text ) ; formFieldParam . setTypeMetaData ( FieldMetaData . Text . BARCODE . concat ( barcodeTypeParam ) ) ; } return new Field ( this . postJson ( formFieldParam , WS . Path . FormField . Version1 . formFieldUpdate ( ) ) ) ;


signature:
public class FormFieldClient { /** * Update an existing Paragraph Text field .
 * @ param formFieldParam Field to Update .
 * @ return Updated Field . */
public Field updateFieldParagraphTextPlain ( Field formFieldParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . ParagraphText ) ; formFieldParam . setTypeMetaData ( FieldMetaData . ParagraphText . PLAIN ) ; } return new Field ( this . postJson ( formFieldParam , WS . Path . FormField . Version1 . formFieldUpdate ( ) ) ) ;


signature:
public class FormFieldClient { /** * Update an existing Multi Choice field .
 * @ param formFieldParam Field to Update .
 * @ param multiChoiceValuesParam New available Multi - choices .
 * @ return Updated Field . */
public Field updateFieldMultiChoicePlain ( Field formFieldParam , List < String > multiChoiceValuesParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( multiChoiceValuesParam == null || multiChoiceValuesParam . isEmpty ( ) ) { throw new FluidClientException ( "No Multi-choice values provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } List < String > beforeAvail = null , beforeSelected = null ; if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . MultipleChoice ) ; formFieldParam . setTypeMetaData ( FieldMetaData . MultiChoice . PLAIN ) ; if ( formFieldParam . getFieldValue ( ) instanceof MultiChoice ) { MultiChoice casted = ( MultiChoice ) formFieldParam . getFieldValue ( ) ; beforeAvail = casted . getAvailableMultiChoices ( ) ; beforeSelected = casted . getSelectedMultiChoices ( ) ; } formFieldParam . setFieldValue ( new MultiChoice ( multiChoiceValuesParam ) ) ; } Field returnVal = new Field ( this . postJson ( formFieldParam , WS . Path . FormField . Version1 . formFieldUpdate ( ) ) ) ; if ( formFieldParam != null ) { formFieldParam . setFieldValue ( new MultiChoice ( beforeSelected , beforeAvail ) ) ; } return returnVal ;


signature:
public class FormFieldClient { /** * Updates the Decimal Spinner field .
 * @ param formFieldParam The Field .
 * @ param minParam The min allowed value .
 * @ param maxParam The max allowed value .
 * @ param stepFactorParam The increments or step factor .
 * @ param prefixParam The prefix to the decimal . Example is $ for currency .
 * @ return Updated Decimal Spinner . */
public Field updateFieldDecimalSpinner ( Field formFieldParam , double minParam , double maxParam , double stepFactorParam , String prefixParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . Decimal ) ; formFieldParam . setTypeMetaData ( this . getMetaDataForDecimalAs ( FieldMetaData . Decimal . SPINNER , minParam , maxParam , stepFactorParam , prefixParam ) ) ; } return new Field ( this . postJson ( formFieldParam , WS . Path . FormField . Version1 . formFieldUpdate ( ) ) ) ;


signature:
public class FormFieldClient { /** * Updates the Decimal Slider field .
 * @ param formFieldParam The Field .
 * @ param minParam The min allowed value .
 * @ param maxParam The max allowed value .
 * @ param stepFactorParam The increments or step factor .
 * @ return Updated Decimal Slider . */
public Field updateFieldDecimalSlider ( Field formFieldParam , double minParam , double maxParam , double stepFactorParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . Decimal ) ; formFieldParam . setTypeMetaData ( this . getMetaDataForDecimalAs ( FieldMetaData . Decimal . SLIDER , minParam , maxParam , stepFactorParam , null ) ) ; } return new Field ( this . postJson ( formFieldParam , WS . Path . FormField . Version1 . formFieldUpdate ( ) ) ) ;


signature:
public class FormFieldClient { /** * Updates a Table Field .
 * @ param formFieldParam The Field to Update .
 * @ param formDefinitionParam The Form Definition to Update .
 * @ param sumDecimalsParam Whether decimals should be summed .
 * @ return Updated Field . */
public Field updateFieldTable ( Field formFieldParam , Form formDefinitionParam , boolean sumDecimalsParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . Table ) ; formFieldParam . setTypeMetaData ( this . getMetaDataForTableField ( formDefinitionParam , sumDecimalsParam ) ) ; } return new Field ( this . postJson ( formFieldParam , WS . Path . FormField . Version1 . formFieldUpdate ( ) ) ) ;


signature:
public class FormFieldClient { /** * Retrieve a Form Field via name .
 * @ param fieldNameParam The field name .
 * @ return Field and properties . */
public Field getFieldByName ( String fieldNameParam ) { } }

implementation: Field field = new Field ( ) ; field . setFieldName ( fieldNameParam ) ; if ( this . serviceTicket != null ) { field . setServiceTicket ( this . serviceTicket ) ; } return new Field ( this . postJson ( field , WS . Path . FormField . Version1 . getByName ( ) ) ) ;


signature:
public class FormFieldClient { /** * Retrieve the Form Fields via Form Definition name .
 * @ param formNameParam The form definition name .
 * @ param editOnlyFieldsParam Only return the fields that are editable .
 * @ return Form Fields for { @ code formNameParam } */
public FormFieldListing getFieldsByFormNameAndLoggedInUser ( String formNameParam , boolean editOnlyFieldsParam ) { } }

implementation: Form form = new Form ( ) ; form . setFormType ( formNameParam ) ; if ( this . serviceTicket != null ) { form . setServiceTicket ( this . serviceTicket ) ; } return new FormFieldListing ( this . postJson ( form , WS . Path . FormField . Version1 . getByFormDefinitionAndLoggedInUser ( editOnlyFieldsParam ) ) ) ;


signature:
public class FormFieldClient { /** * Retrieve the Form Fields via Form Definition id .
 * @ param formTypeIdParam The form definition id .
 * @ param editOnlyFieldsParam Only return the fields that are editable .
 * @ return Form Fields for { @ code formIdParam } */
public FormFieldListing getFieldsByFormTypeIdAndLoggedInUser ( Long formTypeIdParam , boolean editOnlyFieldsParam ) { } }

implementation: Form form = new Form ( ) ; form . setFormTypeId ( formTypeIdParam ) ; if ( this . serviceTicket != null ) { form . setServiceTicket ( this . serviceTicket ) ; } return new FormFieldListing ( this . postJson ( form , WS . Path . FormField . Version1 . getByFormDefinitionAndLoggedInUser ( editOnlyFieldsParam ) ) ) ;


signature:
public class FormFieldClient { /** * Deletes the provided field .
 * Ensure that Id is set .
 * @ param fieldParam The Field to delete .
 * @ return The deleted Field . */
public Field deleteField ( Field fieldParam ) { } }

implementation: if ( fieldParam != null && this . serviceTicket != null ) { fieldParam . setServiceTicket ( this . serviceTicket ) ; } return new Field ( this . postJson ( fieldParam , WS . Path . FormField . Version1 . formFieldDelete ( ) ) ) ;


signature:
public class FormFieldClient { /** * Forcefully deletes the provided field .
 * Ensure that Id is set .
 * Only ' admin ' is able to forcefully delete a field .
 * @ param fieldParam The Field to delete .
 * @ return The deleted Field . */
public Field forceDeleteField ( Field fieldParam ) { } }

implementation: if ( fieldParam != null && this . serviceTicket != null ) { fieldParam . setServiceTicket ( this . serviceTicket ) ; } return new Field ( this . postJson ( fieldParam , WS . Path . FormField . Version1 . formFieldDelete ( true ) ) ) ;


signature:
public class FormFieldClient { /** * Generates the Meta Data for a table field .
 * @ param formDefinitionParam The Form Definition to use .
 * @ param sumDecimalsParam Whether decimal values should be summarized .
 * @ return Meta Data for the Table Field . */
private String getMetaDataForTableField ( Form formDefinitionParam , boolean sumDecimalsParam ) { } }

implementation:
StringBuilder returnBuffer = new StringBuilder ( ) ; Long definitionId = ( formDefinitionParam == null ) ? - 1L : formDefinitionParam . getId ( ) ; // Min . . .
returnBuffer . append ( definitionId ) ; returnBuffer . append ( FieldMetaData . TableField . UNDERSCORE ) ; returnBuffer . append ( FieldMetaData . TableField . SUM_DECIMALS ) ; returnBuffer . append ( FieldMetaData . Decimal . SQ_OPEN ) ; returnBuffer . append ( sumDecimalsParam ) ; returnBuffer . append ( FieldMetaData . Decimal . SQ_CLOSE ) ; return returnBuffer . toString ( ) ;


signature:
public class AuthEncryptedData { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code AuthEncryptedData }
 * @ throws JSONException If there is a problem with the JSON Body . */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation: JSONObject returnVal = new JSONObject ( ) ; returnVal . put ( JSONMapping . TICKET_EXPIRES , this . getTicketExpires ( ) ) ; returnVal . put ( JSONMapping . ROLE_LISTING , this . getRoleListing ( ) ) ; returnVal . put ( JSONMapping . SESSION_KEY , this . getSessionKeyBase64 ( ) ) ; return returnVal ;


signature:
public class UserFieldClient { /** * Create a new True False field .
 * @ param formFieldParam Field to Create .
 * @ return Created Field . */
public Field createFieldTrueFalse ( Field formFieldParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . TrueFalse ) ; formFieldParam . setTypeMetaData ( FieldMetaData . TrueFalse . TRUE_FALSE ) ; } return new Field ( this . putJson ( formFieldParam , WS . Path . UserField . Version1 . userFieldCreate ( ) ) ) ;


signature:
public class UserFieldClient { /** * Create a new Date and time field .
 * @ param formFieldParam Field to Create .
 * @ return Created Field . */
public Field createFieldDateTimeDateAndTime ( Field formFieldParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . DateTime ) ; formFieldParam . setTypeMetaData ( FieldMetaData . DateTime . DATE_AND_TIME ) ; } return new Field ( this . putJson ( formFieldParam , WS . Path . UserField . Version1 . userFieldCreate ( ) ) ) ;


signature:
public class UserFieldClient { /** * Create a new Decimal field .
 * @ param formFieldParam Field to Create .
 * @ return Created Field . */
public Field createFieldDecimalPlain ( Field formFieldParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . Decimal ) ; formFieldParam . setTypeMetaData ( FieldMetaData . Decimal . PLAIN ) ; } return new Field ( this . putJson ( formFieldParam , WS . Path . UserField . Version1 . userFieldCreate ( ) ) ) ;


signature:
public class UserFieldClient { /** * Update an existing True False field .
 * @ param formFieldParam Field to Update .
 * @ return Updated Field . */
public Field updateFieldTrueFalse ( Field formFieldParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . TrueFalse ) ; formFieldParam . setTypeMetaData ( FieldMetaData . TrueFalse . TRUE_FALSE ) ; } return new Field ( this . postJson ( formFieldParam , WS . Path . UserField . Version1 . userFieldUpdate ( ) ) ) ;


signature:
public class UserFieldClient { /** * Update an existing Multi Choice field .
 * @ param formFieldParam Field to Update .
 * @ param multiChoiceValuesParam New available Multi - choices .
 * @ return Updated Field . */
public Field updateFieldMultiChoicePlain ( Field formFieldParam , List < String > multiChoiceValuesParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( multiChoiceValuesParam == null || multiChoiceValuesParam . isEmpty ( ) ) { throw new FluidClientException ( "No Multi-choice values provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . MultipleChoice ) ; formFieldParam . setTypeMetaData ( FieldMetaData . MultiChoice . PLAIN ) ; formFieldParam . setFieldValue ( new MultiChoice ( multiChoiceValuesParam ) ) ; } return new Field ( this . postJson ( formFieldParam , WS . Path . UserField . Version1 . userFieldUpdate ( ) ) ) ;


signature:
public class UserFieldClient { /** * Update an existing Date field .
 * @ param formFieldParam Field to Update .
 * @ return Updated Field . */
public Field updateFieldDateTimeDate ( Field formFieldParam ) { } }

implementation: if ( formFieldParam != null && this . serviceTicket != null ) { formFieldParam . setServiceTicket ( this . serviceTicket ) ; } if ( formFieldParam != null ) { formFieldParam . setTypeAsEnum ( Field . Type . DateTime ) ; formFieldParam . setTypeMetaData ( FieldMetaData . DateTime . DATE ) ; } return new Field ( this . postJson ( formFieldParam , WS . Path . UserField . Version1 . userFieldUpdate ( ) ) ) ;


signature:
public class UserFieldClient { /** * Update an existing User field value .
 * @ param userFieldValueParam Field to Update .
 * @ return Updated Field . */
public Field updateFieldValue ( Field userFieldValueParam ) { } }

implementation: if ( userFieldValueParam != null && this . serviceTicket != null ) { userFieldValueParam . setServiceTicket ( this . serviceTicket ) ; } return new Field ( this . postJson ( userFieldValueParam , WS . Path . UserField . Version1 . userFieldUpdateValue ( ) ) ) ;


signature:
public class UserFieldClient { /** * Retrieves field information by { @ code fieldIdParam } .
 * @ param fieldNameParam The field name .
 * @ return Field Definition by primary key . */
public Field getFieldByName ( String fieldNameParam ) { } }

implementation:
Field field = new Field ( ) ; field . setFieldName ( fieldNameParam ) ; // Set for Payara server . . .
field . setFieldValue ( new MultiChoice ( ) ) ; if ( this . serviceTicket != null ) { field . setServiceTicket ( this . serviceTicket ) ; } return new Field ( this . postJson ( field , WS . Path . UserField . Version1 . getByName ( ) ) ) ;


signature:
public class UserFieldClient { /** * Deletes a field from Fluid .
 * @ param fieldParam The field to delete . Important that Id is set .
 * @ return Deleted Field . */
public Field deleteField ( Field fieldParam ) { } }

implementation: if ( fieldParam != null && this . serviceTicket != null ) { fieldParam . setServiceTicket ( this . serviceTicket ) ; } return new Field ( this . postJson ( fieldParam , WS . Path . UserField . Version1 . userFieldDelete ( ) ) ) ;


signature:
public class UserFieldClient { /** * Forcefully Deletes a field from Fluid .
 * Only ' admin ' is allowed to make this call .
 * @ param fieldParam The field to delete . Important that Id is set .
 * @ return Deleted Field . */
public Field forceDeleteField ( Field fieldParam ) { } }

implementation: if ( fieldParam != null && this . serviceTicket != null ) { fieldParam . setServiceTicket ( this . serviceTicket ) ; } return new Field ( this . postJson ( fieldParam , WS . Path . UserField . Version1 . userFieldDelete ( true ) ) ) ;


signature:
public class ESFormFieldMappingUtil { /** * Creates / Updates the index { @ code indexParam } with mappings
 * provided in { @ code fluidFormMappingToUpdateParam } .
 * @ param indexParam The ElasticSearch index effected .
 * @ param parentTypeParam The { @ code _ parent } type to be set .
 * @ param fluidFormMappingToUpdateParam The Fluid { @ code Form } to be
 * update .
 * @ see Form
 * @ throws FluidElasticSearchException If validation or acknowledgement problems occur . */
public void mergeMappingForIndex ( String indexParam , String parentTypeParam , Form fluidFormMappingToUpdateParam ) { } }

implementation:
if ( indexParam == null ) { throw new FluidElasticSearchException ( "Index name '" + indexParam + "' is invalid." ) ; } // The Form mapping to update . . .
if ( fluidFormMappingToUpdateParam == null ) { throw new FluidElasticSearchException ( "Form for mapping not set." ) ; } // Form Type Id . . .
if ( fluidFormMappingToUpdateParam . getFormTypeId ( ) == null || fluidFormMappingToUpdateParam . getFormTypeId ( ) . longValue ( ) < 1 ) { throw new FluidElasticSearchException ( "Form 'FormType' not set for mapping." ) ; } String formTypeString = fluidFormMappingToUpdateParam . getFormTypeId ( ) . toString ( ) ; JSONObject newContentMappingBuilderFromParam = fluidFormMappingToUpdateParam . toJsonMappingForElasticSearch ( ) ; // Retrieve and update . . .
GetIndexResponse getExistingIndex = this . getOrCreateIndex ( indexParam ) ; JSONObject existingPropsToUpdate = null ; for ( ObjectCursor mappingKey : getExistingIndex . getMappings ( ) . keys ( ) ) { // Found index . . .
if ( ! mappingKey . value . toString ( ) . equals ( indexParam ) ) { continue ; } // Found a match . . .
Object obj = getExistingIndex . getMappings ( ) . get ( mappingKey . value . toString ( ) ) ; if ( obj instanceof ImmutableOpenMap ) { ImmutableOpenMap casted = ( ImmutableOpenMap ) obj ; // Type . . .
if ( casted . containsKey ( formTypeString ) && casted . get ( formTypeString ) instanceof MappingMetaData ) { MappingMetaData mappingMetaData = ( MappingMetaData ) casted . get ( formTypeString ) ; try { existingPropsToUpdate = new JSONObject ( mappingMetaData . source ( ) . string ( ) ) ; break ; } catch ( IOException eParam ) { throw new FluidElasticSearchException ( "Unable to retrieve source from 'Mapping Meta-Data'. " + eParam . getMessage ( ) , eParam ) ; } } } } // No mapping for the type create a new one . . .
if ( existingPropsToUpdate == null ) { existingPropsToUpdate = new JSONObject ( ) ; existingPropsToUpdate . put ( ABaseFluidJSONObject . JSONMapping . Elastic . PROPERTIES , newContentMappingBuilderFromParam ) ; // Set the additional properties . . .
this . setAdditionalProps ( existingPropsToUpdate , parentTypeParam ) ; PutMappingRequestBuilder putMappingRequestBuilder = this . client . admin ( ) . indices ( ) . preparePutMapping ( indexParam ) ; putMappingRequestBuilder = putMappingRequestBuilder . setType ( formTypeString ) ; putMappingRequestBuilder = putMappingRequestBuilder . setSource ( existingPropsToUpdate . toString ( ) , XContentType . JSON ) ; PutMappingResponse putMappingResponse = putMappingRequestBuilder . get ( ) ; if ( ! putMappingResponse . isAcknowledged ( ) ) { throw new FluidElasticSearchException ( "Index Update for Creating '" + indexParam + "' and type '" + formTypeString + "' not acknowledged by ElasticSearch." ) ; } // Creation done .
return ; } // Update the existing index . . .
JSONObject existingPropertiesUpdated = existingPropsToUpdate . getJSONObject ( formTypeString ) . getJSONObject ( ABaseFluidJSONObject . JSONMapping . Elastic . PROPERTIES ) ; // Merge existing with new . . .
for ( String existingKey : existingPropertiesUpdated . keySet ( ) ) { newContentMappingBuilderFromParam . put ( existingKey , existingPropertiesUpdated . get ( existingKey ) ) ; } // Check to see whether there are any new fields added . . .
boolean noChanges = true ; for ( String possibleExistingKey : newContentMappingBuilderFromParam . keySet ( ) ) { if ( ! existingPropertiesUpdated . has ( possibleExistingKey ) ) { noChanges = false ; break ; } } if ( noChanges ) { return ; } // Update the properties to new values . . .
existingPropsToUpdate . put ( ABaseFluidJSONObject . JSONMapping . Elastic . PROPERTIES , newContentMappingBuilderFromParam ) ; // Set the additional properties . . .
this . setAdditionalProps ( existingPropsToUpdate , parentTypeParam ) ; // Push the change . . .
PutMappingRequestBuilder putMappingRequestBuilder = this . client . admin ( ) . indices ( ) . preparePutMapping ( indexParam ) ; putMappingRequestBuilder = putMappingRequestBuilder . setType ( formTypeString ) ; putMappingRequestBuilder = putMappingRequestBuilder . setSource ( existingPropsToUpdate . toString ( ) , XContentType . JSON ) ; PutMappingResponse putMappingResponse = putMappingRequestBuilder . get ( ) ; if ( ! putMappingResponse . isAcknowledged ( ) ) { throw new FluidElasticSearchException ( "Index Update for '" + indexParam + "' and type '" + formTypeString + "' not acknowledged by ElasticSearch." ) ; }


signature:
public class ESFormFieldMappingUtil { /** * Set the additional properties on the { @ code existingPropsToUpdateParam } json object .
 * @ param existingPropsToUpdateParam The existing properties to update .
 * @ param parentTypeParam The { @ code _ parent } type to set . */
private void setAdditionalProps ( JSONObject existingPropsToUpdateParam , String parentTypeParam ) { } }

implementation: if ( parentTypeParam == null || parentTypeParam . trim ( ) . length ( ) == 0 ) { return ; } JSONObject typeJson = new JSONObject ( ) ; typeJson . put ( Field . JSONMapping . FIELD_TYPE , parentTypeParam ) ; existingPropsToUpdateParam . put ( Form . JSONMapping . _PARENT , typeJson ) ;


signature:
public class ESFormFieldMappingUtil { /** * Creates a new index or fetches existing index .
 * @ param indexParam The name of the index to create in lower - case .
 * @ return Newly created or existing index .
 * @ see GetIndexResponse */
public GetIndexResponse getOrCreateIndex ( String indexParam ) { } }

implementation: if ( this . doesIndexExist ( indexParam ) ) { return this . client . admin ( ) . indices ( ) . prepareGetIndex ( ) . get ( ) ; } else { CreateIndexRequestBuilder createIndexRequestBuilder = this . client . admin ( ) . indices ( ) . prepareCreate ( indexParam ) ; CreateIndexResponse mappingCreateResponse = createIndexRequestBuilder . execute ( ) . actionGet ( ) ; if ( ! mappingCreateResponse . isAcknowledged ( ) ) { throw new FluidElasticSearchException ( "Index Creation for '" + indexParam + "' not acknowledged by ElasticSearch." ) ; } return this . client . admin ( ) . indices ( ) . prepareGetIndex ( ) . get ( ) ; }


signature:
public class JobView { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code RoleToJobView }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Rule . . .
if ( this . getRule ( ) != null ) { returnVal . put ( JSONMapping . RULE , this . getRule ( ) ) ; } // View Name . . .
if ( this . getViewName ( ) != null ) { returnVal . put ( JSONMapping . VIEW_NAME , this . getViewName ( ) ) ; } // View Group Name . . .
if ( this . getViewGroupName ( ) != null ) { returnVal . put ( JSONMapping . VIEW_GROUP_NAME , this . getViewGroupName ( ) ) ; } // View Flow Name . . .
if ( this . getViewGroupName ( ) != null ) { returnVal . put ( JSONMapping . VIEW_FLOW_NAME , this . getViewFlowName ( ) ) ; } // View Step Name . . .
if ( this . getViewGroupName ( ) != null ) { returnVal . put ( JSONMapping . VIEW_STEP_NAME , this . getViewStepName ( ) ) ; } // View Priority . . .
if ( this . getViewPriority ( ) != null ) { returnVal . put ( JSONMapping . VIEW_PRIORITY , this . getViewPriority ( ) ) ; } // View Type . . .
if ( this . getViewType ( ) != null ) { returnVal . put ( JSONMapping . VIEW_TYPE , this . getViewType ( ) ) ; } return returnVal ;


signature:
public class NativeSQLQuery { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code UserQuery }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Datasource Name . . .
if ( this . getDatasourceName ( ) != null ) { returnVal . put ( JSONMapping . DATASOURCE_NAME , this . getDatasourceName ( ) ) ; } // Query . . .
if ( this . getQuery ( ) != null ) { returnVal . put ( JSONMapping . QUERY , this . getQuery ( ) ) ; } // Stored Procedure . . .
if ( this . getStoredProcedure ( ) != null ) { returnVal . put ( JSONMapping . STORED_PROCEDURE , this . getStoredProcedure ( ) ) ; } // Inputs . . .
if ( this . getSqlInputs ( ) != null ) { JSONArray jsonArray = new JSONArray ( ) ; for ( SQLColumn toAdd : this . getSqlInputs ( ) ) { jsonArray . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . SQL_INPUTS , jsonArray ) ; } return returnVal ;


signature:
public class NativeSQLQuery { /** * Add a SQL input parameter .
 * If the sql inputs is { @ code null } , a new instance
 * of { @ code ArrayList } will be created prior to adding the parameter .
 * @ param sqlInputToAddParam The SQL Input to add .
 * @ see SQLColumn */
@ XmlTransient public void addSqlInput ( SQLColumn sqlInputToAddParam ) { } }

implementation: if ( this . sqlInputs == null ) { this . sqlInputs = new ArrayList < > ( ) ; } if ( sqlInputToAddParam == null ) { return ; } this . sqlInputs . add ( sqlInputToAddParam ) ;


signature:
public class FlowClient { /** * Creates a new Flow with an Introduction and Exit basic rule .
 * @ param flowParam The flow to Create .
 * @ return The created flow .
 * @ see Flow */
public Flow createFlow ( Flow flowParam ) { } }

implementation: if ( flowParam != null && this . serviceTicket != null ) { flowParam . setServiceTicket ( this . serviceTicket ) ; } return new Flow ( this . putJson ( flowParam , WS . Path . Flow . Version1 . flowCreate ( ) ) ) ;


signature:
public class FlowClient { /** * Updates an existing Flow .
 * @ param flowParam The flow to Update .
 * @ return The updated flow .
 * @ see Flow */
public Flow updateFlow ( Flow flowParam ) { } }

implementation: if ( flowParam != null && this . serviceTicket != null ) { flowParam . setServiceTicket ( this . serviceTicket ) ; } return new Flow ( this . postJson ( flowParam , WS . Path . Flow . Version1 . flowUpdate ( ) ) ) ;


signature:
public class FlowClient { /** * Retrieves a Flow by Primary Key .
 * @ param flowIdParam The Flow primary key .
 * @ return The Flow . */
public Flow getFlowById ( Long flowIdParam ) { } }

implementation: Flow flow = new Flow ( flowIdParam ) ; if ( this . serviceTicket != null ) { flow . setServiceTicket ( this . serviceTicket ) ; } return new Flow ( this . postJson ( flow , WS . Path . Flow . Version1 . getById ( ) ) ) ;


signature:
public class FlowClient { /** * Retrieves a Flow by unique Name .
 * @ param flowNameParam The Flow name .
 * @ return The Flow . */
public Flow getFlowByName ( String flowNameParam ) { } }

implementation: Flow flow = new Flow ( ) ; flow . setName ( flowNameParam ) ; if ( this . serviceTicket != null ) { flow . setServiceTicket ( this . serviceTicket ) ; } return new Flow ( this . postJson ( flow , WS . Path . Flow . Version1 . getByName ( ) ) ) ;


signature:
public class FlowClient { /** * Delete an existing Flow .
 * @ param flowParam The Flow to delete .
 * @ return The deleted Flow . */
public Flow deleteFlow ( Flow flowParam ) { } }

implementation: if ( flowParam != null && this . serviceTicket != null ) { flowParam . setServiceTicket ( this . serviceTicket ) ; } return new Flow ( this . postJson ( flowParam , WS . Path . Flow . Version1 . flowDelete ( ) ) ) ;


signature:
public class FlowClient { /** * Forcefully Delete an existing Flow .
 * Only ' admin ' can forcefully delete a Flow .
 * @ param flowParam The Flow to delete .
 * @ return The deleted Flow . */
public Flow forceDeleteFlow ( Flow flowParam ) { } }

implementation: if ( flowParam != null && this . serviceTicket != null ) { flowParam . setServiceTicket ( this . serviceTicket ) ; } return new Flow ( this . postJson ( flowParam , WS . Path . Flow . Version1 . flowDelete ( true ) ) ) ;


signature:
public class GlobalFieldClient { /** * Update an existing Global field value .
 * @ param globalFieldValueParam Field to Update .
 * @ return Updated Field . */
public Field updateFieldValue ( Field globalFieldValueParam ) { } }

implementation: if ( globalFieldValueParam != null && this . serviceTicket != null ) { globalFieldValueParam . setServiceTicket ( this . serviceTicket ) ; } return new Field ( this . postJson ( globalFieldValueParam , Version1 . globalFieldUpdateValue ( ) ) ) ;


signature:
public class GlobalFieldClient { /** * Retrieves field value by { @ code fieldNameParam } .
 * @ param fieldNameParam The field name .
 * @ return Field by primary key . */
public Field getFieldValueByName ( String fieldNameParam ) { } }

implementation: Field field = new Field ( ) ; field . setFieldName ( fieldNameParam ) ; return this . getFieldValueBy ( field ) ;


signature:
public class GlobalFieldClient { /** * Retrieves field value by { @ code fieldParam } .
 * @ param fieldParam The field name .
 * @ return Field by primary key . */
private Field getFieldValueBy ( Field fieldParam ) { } }

implementation:
if ( fieldParam != null ) { // Set for Payara server . . .
fieldParam . setFieldValue ( new MultiChoice ( ) ) ; if ( this . serviceTicket != null ) { fieldParam . setServiceTicket ( this . serviceTicket ) ; } } return new Field ( this . postJson ( fieldParam , Version1 . getValueBy ( ) ) ) ;


signature:
public class GlobalFieldClient { /** * Retrieve all the Global field values .
 * @ return Global Fields in the destination system .
 * @ see GlobalFieldListing
 * @ see Field */
public List < Field > getAllGlobalFieldValues ( ) { } }

implementation:
Field field = new Field ( ) ; // Set for Payara server . . .
field . setFieldValue ( new MultiChoice ( ) ) ; if ( this . serviceTicket != null ) { field . setServiceTicket ( this . serviceTicket ) ; } return new GlobalFieldListing ( this . postJson ( field , Version1 . getAllValues ( ) ) ) . getListing ( ) ;


signature:
public class ESFormUtil { /** * Gets the ancestor for the { @ code electronicFormIdParam } Form .
 * @ param electronicFormIdParam Identifier for the Form .
 * @ param includeFieldDataParam Whether to populate the return { @ code Form } fields .
 * @ param includeTableFieldsParam Whether to populate the return { @ code Form } table fields .
 * @ return { @ code Form } descendants .
 * @ see Form */
public Form getFormAncestor ( Long electronicFormIdParam , boolean includeFieldDataParam , boolean includeTableFieldsParam ) { } }

implementation:
if ( electronicFormIdParam == null ) { return null ; } // Query using the descendantId directly . . .
StringBuffer ancestorQuery = new StringBuffer ( Form . JSONMapping . DESCENDANT_IDS ) ; ancestorQuery . append ( ":\"" ) ; ancestorQuery . append ( electronicFormIdParam ) ; ancestorQuery . append ( "\"" ) ; // Search for the Ancestor . . .
List < Form > ancestorForms = null ; if ( includeFieldDataParam ) { ancestorForms = this . searchAndConvertHitsToFormWithAllFields ( QueryBuilders . queryStringQuery ( ancestorQuery . toString ( ) ) , Index . DOCUMENT , DEFAULT_OFFSET , 1 , new Long [ ] { } ) ; } else { ancestorForms = this . searchAndConvertHitsToFormWithNoFields ( QueryBuilders . queryStringQuery ( ancestorQuery . toString ( ) ) , Index . DOCUMENT , DEFAULT_OFFSET , 1 , new Long [ ] { } ) ; } Form returnVal = null ; if ( ancestorForms != null && ! ancestorForms . isEmpty ( ) ) { returnVal = ancestorForms . get ( 0 ) ; } // No result . . .
if ( returnVal == null ) { return null ; } // Whether table field data should be included . . .
if ( ! includeTableFieldsParam ) { return returnVal ; } // Populate the Table Fields . . .
this . populateTableFields ( false , includeFieldDataParam , returnVal . getFormFields ( ) ) ; return returnVal ;


signature:
public class ESFormUtil { /** * Gets the descendants for the { @ code electronicFormIdParam } Form .
 * @ param electronicFormIdParam Identifier for the Form .
 * @ param includeFieldDataParam Whether to populate the return { @ code List < Form > } fields .
 * @ param includeTableFieldsParam Whether to populate the return { @ code List < Form > } table fields .
 * @ param includeTableFieldFormRecordInfoParam Does table record form data need to be included .
 * @ return { @ code List < Form > } descendants .
 * @ see Form */
@ Override public List < Form > getFormDescendants ( Long electronicFormIdParam , boolean includeFieldDataParam , boolean includeTableFieldsParam , boolean includeTableFieldFormRecordInfoParam ) { } }

implementation:
if ( electronicFormIdParam == null ) { return null ; } List < Long > electronicFormIds = new ArrayList ( ) ; electronicFormIds . add ( electronicFormIdParam ) ; // Get Form Descendants . . .
return this . getFormDescendants ( electronicFormIds , includeFieldDataParam , includeTableFieldsParam , includeTableFieldFormRecordInfoParam ) ;


signature:
public class ESFormUtil { /** * Gets the descendants for the { @ code electronicFormIdsParam } Forms .
 * @ param electronicFormIdsParam Identifiers for the Forms to retrieve .
 * @ param includeFieldDataParam Whether to populate the return { @ code List < Form > } fields .
 * @ param includeTableFieldsParam Whether to populate the return { @ code List < Form > } table fields .
 * @ param includeTableFieldFormRecordInfoParam Does table record form data need to be included .
 * @ return { @ code List < Form > } descendants .
 * @ see Form */
public List < Form > getFormDescendants ( List < Long > electronicFormIdsParam , boolean includeFieldDataParam , boolean includeTableFieldsParam , boolean includeTableFieldFormRecordInfoParam ) { } }

implementation:
if ( electronicFormIdsParam == null || electronicFormIdsParam . isEmpty ( ) ) { return null ; } // String stringQuery = " formType : ( \ " JIT Schedule \ " \ " SMT Training \ " ) AND flowState : \ " Not In Flow \ " " ;
// Query using the descendantId directly . . .
StringBuffer descendantQuery = new StringBuffer ( Form . JSONMapping . ANCESTOR_ID ) ; descendantQuery . append ( ":(" ) ; for ( Long electronicFormId : electronicFormIdsParam ) { descendantQuery . append ( "\"" ) ; descendantQuery . append ( electronicFormId ) ; descendantQuery . append ( "\"" ) ; descendantQuery . append ( " " ) ; } String fullQueryToExec = descendantQuery . toString ( ) ; fullQueryToExec = fullQueryToExec . substring ( 0 , fullQueryToExec . length ( ) - 1 ) ; fullQueryToExec = fullQueryToExec . concat ( ")" ) ; // Search for the Descendants . . .
List < Form > returnVal = null ; if ( includeFieldDataParam ) { returnVal = this . searchAndConvertHitsToFormWithAllFields ( QueryBuilders . queryStringQuery ( fullQueryToExec ) , Index . DOCUMENT , DEFAULT_OFFSET , MAX_NUMBER_OF_TABLE_RECORDS , new Long [ ] { } ) ; } else { returnVal = this . searchAndConvertHitsToFormWithNoFields ( QueryBuilders . queryStringQuery ( fullQueryToExec ) , Index . DOCUMENT , DEFAULT_OFFSET , MAX_NUMBER_OF_TABLE_RECORDS , new Long [ ] { } ) ; } // Whether table field data should be included . . .
if ( ! includeTableFieldsParam ) { return returnVal ; } // No result . . .
if ( returnVal == null ) { return returnVal ; } // Populate in order to have table field data . . .
for ( Form descendantForm : returnVal ) { this . populateTableFields ( false , includeFieldDataParam , descendantForm . getFormFields ( ) ) ; } return returnVal ;


signature:
public class ESFormUtil { /** * Retrieves the Table field records as { @ code List < Form > } .
 * @ param electronicFormIdParam The Form Identifier .
 * @ param includeFieldDataParam Whether to populate the return { @ code List < Form > } fields .
 * @ return { @ code List < Form > } records . */
public List < Form > getFormTableForms ( Long electronicFormIdParam , boolean includeFieldDataParam ) { } }

implementation:
if ( electronicFormIdParam == null ) { return null ; } // Query using the descendantId directly . . .
StringBuffer primaryQuery = new StringBuffer ( ABaseFluidJSONObject . JSONMapping . ID ) ; primaryQuery . append ( ":\"" ) ; primaryQuery . append ( electronicFormIdParam ) ; primaryQuery . append ( "\"" ) ; // Search for the primary . . .
List < Form > formsWithId = null ; if ( includeFieldDataParam ) { formsWithId = this . searchAndConvertHitsToFormWithAllFields ( QueryBuilders . queryStringQuery ( primaryQuery . toString ( ) ) , Index . DOCUMENT , DEFAULT_OFFSET , 1 , new Long [ ] { } ) ; } else { formsWithId = this . searchAndConvertHitsToFormWithNoFields ( QueryBuilders . queryStringQuery ( primaryQuery . toString ( ) ) , Index . DOCUMENT , DEFAULT_OFFSET , 1 , new Long [ ] { } ) ; } Form returnVal = null ; if ( formsWithId != null && ! formsWithId . isEmpty ( ) ) { returnVal = formsWithId . get ( 0 ) ; } // No result . . .
if ( returnVal == null ) { return null ; } // Populate the Table Fields . . .
return this . populateTableFields ( true , includeFieldDataParam , returnVal . getFormFields ( ) ) ;


signature:
public class SQLFormDefinitionUtil { /** * Retrieves the Form Definition and Title mapping
 * currently stored in Fluid .
 * @ return Form Definition Id and Title . */
public Map < Long , String > getFormDefinitionIdAndTitle ( ) { } }

implementation:
// When already cached , use the cached value . . .
if ( ! LOCAL_MAPPING . isEmpty ( ) ) { Map < Long , String > returnVal = new HashMap < > ( LOCAL_MAPPING ) ; // The id ' s are outdated . . .
if ( System . currentTimeMillis ( ) > timeToUpdateAgain ) { synchronized ( LOCAL_MAPPING ) { LOCAL_MAPPING . clear ( ) ; } } return returnVal ; } // Only allow one thread to set the local mapping . . .
synchronized ( LOCAL_MAPPING ) { if ( ! LOCAL_MAPPING . isEmpty ( ) ) { return new HashMap < > ( LOCAL_MAPPING ) ; } PreparedStatement preparedStatement = null ; ResultSet resultSet = null ; try { ISyntax syntax = SyntaxFactory . getInstance ( ) . getSyntaxFor ( this . getSQLTypeFromConnection ( ) , ISyntax . ProcedureMapping . FormDefinition . GetFormDefinitions ) ; preparedStatement = this . getConnection ( ) . prepareStatement ( syntax . getPreparedStatement ( ) ) ; resultSet = preparedStatement . executeQuery ( ) ; // Iterate each of the form containers . . .
while ( resultSet . next ( ) ) { Long id = resultSet . getLong ( 1 ) ; String title = resultSet . getString ( 2 ) ; LOCAL_MAPPING . put ( id , title ) ; } // Update in 10 mins . . .
timeToUpdateAgain = ( System . currentTimeMillis ( ) + TimeUnit . MINUTES . toMillis ( 10 ) ) ; } catch ( SQLException sqlError ) { throw new FluidSQLException ( sqlError ) ; } finally { this . closeStatement ( preparedStatement , resultSet ) ; } return new HashMap < > ( LOCAL_MAPPING ) ; }


signature:
public class AuthResponse { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code AuthResponse }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Salt . . .
if ( this . getSalt ( ) != null ) { returnVal . put ( JSONMapping . SALT , this . getSalt ( ) ) ; } // Encrypted Data Base 64 . . .
if ( this . getEncryptedDataBase64 ( ) != null ) { returnVal . put ( JSONMapping . ENCRYPTED_DATA_BASE_64 , this . getEncryptedDataBase64 ( ) ) ; } // Encrypted Data HMAC Base 64 . . .
if ( this . getEncryptedDataHmacBase64 ( ) != null ) { returnVal . put ( JSONMapping . ENCRYPTED_DATA_HMAC_BASE_64 , this . getEncryptedDataHmacBase64 ( ) ) ; } // IV Base 64 . . .
if ( this . getIvBase64 ( ) != null ) { returnVal . put ( JSONMapping . IV_BASE_64 , this . getIvBase64 ( ) ) ; } // Seed Base 64 . . .
if ( this . getSeedBase64 ( ) != null ) { returnVal . put ( JSONMapping . SEED_BASE_64 , this . getSeedBase64 ( ) ) ; } // Service Ticket Base 64 . . .
if ( this . getServiceTicketBase64 ( ) != null ) { returnVal . put ( JSONMapping . SERVICE_TICKET_BASE_64 , this . getServiceTicketBase64 ( ) ) ; } return returnVal ;


signature:
public class CompressedResponse { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code MailMessageAttachment }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Data Base64 . . .
if ( this . getDataBase64 ( ) != null ) { returnVal . put ( JSONMapping . DATA_BASE_64 , this . getDataBase64 ( ) ) ; } return returnVal ;


signature:
public class TableField { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code TableField }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Sum Decimals . . .
if ( this . getSumDecimals ( ) != null ) { returnVal . put ( JSONMapping . SUM_DECIMALS , this . getSumDecimals ( ) ) ; } // Table Field Records . . .
if ( this . getTableRecords ( ) != null && ! this . getTableRecords ( ) . isEmpty ( ) ) { JSONArray assoFormsArr = new JSONArray ( ) ; for ( Form toAdd : this . getTableRecords ( ) ) { assoFormsArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . TABLE_RECORDS , assoFormsArr ) ; } return returnVal ;


signature:
public class ABaseListing { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code RoleToFormDefinition }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override @ XmlTransient public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Listing . . .
int listingCountFromListing = 0 ; if ( this . getListing ( ) != null && ! this . getListing ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; listingCountFromListing = this . getListing ( ) . size ( ) ; for ( T toAdd : this . getListing ( ) ) { jsonArray . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . LISTING , jsonArray ) ; } // Listing count . . .
if ( this . getListingCount ( ) == null ) { returnVal . put ( JSONMapping . LISTING_COUNT , new Integer ( listingCountFromListing ) ) ; } else { returnVal . put ( JSONMapping . LISTING_COUNT , this . getListingCount ( ) ) ; } // Listing index . . .
if ( this . getListingIndex ( ) != null ) { returnVal . put ( JSONMapping . LISTING_INDEX , this . getListingIndex ( ) ) ; } // Listing page . . .
if ( this . getListingIndex ( ) != null ) { returnVal . put ( JSONMapping . LISTING_PAGE , this . getListingPage ( ) ) ; } return returnVal ;


signature:
public class TokenStatus { /** * Check the { @ code getExpirationTime } to confirm whether
 * the ticket has expired .
 * @ return Whether the ticket has expired . */
public boolean isExpired ( ) { } }

implementation: if ( this . getExpirationTime ( ) == null ) { return true ; } Date expirationTime = new Date ( this . getExpirationTime ( ) ) ; return ( expirationTime . before ( new Date ( ) ) ) ;


signature:
public class UserNotificationClient { /** * Creates a new { @ code UserNotification } for a user .
 * The user will be notified through the Fluid User Dashboard or 3rd Party application .
 * @ param userNotificationParam The { @ code UserNotification } to create .
 * @ return The Created User Notification .
 * @ see com . fluidbpm . program . api . vo . user . User
 * @ see UserNotification */
public UserNotification createUserNotification ( UserNotification userNotificationParam ) { } }

implementation: if ( userNotificationParam != null && this . serviceTicket != null ) { userNotificationParam . setServiceTicket ( this . serviceTicket ) ; } return new UserNotification ( this . putJson ( userNotificationParam , WS . Path . UserNotification . Version1 . userNotificationCreate ( ) ) ) ;


signature:
public class UserNotificationClient { /** * Creates a new { @ code UserNotification } for a user .
 * The user will be notified through the Fluid User Dashboard or 3rd Party application .
 * @ param userNotificationParam The User Notification to update .
 * @ return The Updated UserNotification .
 * @ see com . fluidbpm . program . api . vo . user . User
 * @ see UserNotification */
public UserNotification updateUserNotification ( UserNotification userNotificationParam ) { } }

implementation: if ( userNotificationParam != null && this . serviceTicket != null ) { userNotificationParam . setServiceTicket ( this . serviceTicket ) ; } return new UserNotification ( this . postJson ( userNotificationParam , WS . Path . UserNotification . Version1 . userNotificationUpdate ( ) ) ) ;


signature:
public class UserNotificationClient { /** * Marks the { @ code userNotificationParam } notification as read .
 * @ param userNotificationParam The User Notification to mark as read .
 * @ param asyncParam Should the notification mark - as - read asynchronously .
 * @ return The Updated UserNotification .
 * @ see com . fluidbpm . program . api . vo . user . User
 * @ see UserNotification */
public UserNotification markUserNotificationAsRead ( UserNotification userNotificationParam , boolean asyncParam ) { } }

implementation: if ( userNotificationParam != null && this . serviceTicket != null ) { userNotificationParam . setServiceTicket ( this . serviceTicket ) ; } return new UserNotification ( this . postJson ( userNotificationParam , WS . Path . UserNotification . Version1 . userNotificationMarkAsRead ( asyncParam ) ) ) ;


signature:
public class UserNotificationClient { /** * Deletes the { @ code UserNotification } provided .
 * Id must be set on the { @ code UserNotification } .
 * @ param userNotificationToDeleteParam The User Notification to Delete .
 * @ return The deleted User Notification . */
public UserNotification deleteUserNotification ( UserNotification userNotificationToDeleteParam ) { } }

implementation: if ( userNotificationToDeleteParam != null && this . serviceTicket != null ) { userNotificationToDeleteParam . setServiceTicket ( this . serviceTicket ) ; } return new UserNotification ( this . postJson ( userNotificationToDeleteParam , WS . Path . UserNotification . Version1 . userNotificationDelete ( ) ) ) ;


signature:
public class UserNotificationClient { /** * Deletes the { @ code UserNotification } provided .
 * Id must be set on the { @ code UserNotification } .
 * @ param userNotificationPkParam The Id of the User Notification to fetch .
 * @ return The User Notification by PK . */
public UserNotification getUserNotificationById ( Long userNotificationPkParam ) { } }

implementation:
UserNotification userNoti = new UserNotification ( ) ; userNoti . setId ( userNotificationPkParam ) ; if ( this . serviceTicket != null ) { userNoti . setServiceTicket ( this . serviceTicket ) ; } try { return new UserNotification ( this . postJson ( userNoti , WS . Path . UserNotification . Version1 . getById ( ) ) ) ; } // Json format issues . . .
catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class UserNotificationClient { /** * Retrieves all { @ code READ } User Notification items for the logged in user .
 * @ param queryLimitParam The query limit .
 * @ param offsetParam The query offset .
 * @ return The User Notification items for the logged in { @ code User } . */
public List < UserNotification > getAllReadByLoggedInUser ( int queryLimitParam , int offsetParam ) { } }

implementation:
User loggedInUser = new User ( ) ; if ( this . serviceTicket != null ) { loggedInUser . setServiceTicket ( this . serviceTicket ) ; } try { return new UserNotificationListing ( this . postJson ( loggedInUser , WS . Path . UserNotification . Version1 . getAllReadByUser ( queryLimitParam , offsetParam ) ) ) . getListing ( ) ; } catch ( JSONException jsonExcept ) { // rethrow as a Fluid Client exception .
throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class UserNotificationClient { /** * Retrieves all User Notification items for user { @ code userParam }
 * between date { @ code fromDateParam } and { @ code toDateParam } .
 * @ param userParam The user to retrieve notifications for .
 * @ param fromDateParam The notification from date .
 * @ param toDateParam The notification to date .
 * @ return The User Notification items for the logged in { @ code User } . */
public List < UserNotification > getAllByUserAndDateBetween ( User userParam , Date fromDateParam , Date toDateParam ) { } }

implementation: return this . getAllByUserAndDateBetween ( userParam , - 1 , - 1 , fromDateParam , toDateParam ) ;


signature:
public class UserNotificationClient { /** * Retrieves all User Notification items for user { @ code userParam }
 * between date { @ code fromDateParam } and { @ code toDateParam } .
 * @ param userParam The user to retrieve notifications for .
 * @ param queryLimitParam The query limit .
 * @ param offsetParam The query offset .
 * @ param fromDateParam The notification from date .
 * @ param toDateParam The notification to date .
 * @ return The User Notification items for the logged in { @ code User } . */
public List < UserNotification > getAllByUserAndDateBetween ( User userParam , int queryLimitParam , int offsetParam , Date fromDateParam , Date toDateParam ) { } }

implementation:
if ( this . serviceTicket != null && userParam != null ) { userParam . setServiceTicket ( this . serviceTicket ) ; } long fromDate = ( fromDateParam == null ) ? System . currentTimeMillis ( ) - TimeUnit . DAYS . toMillis ( 7 ) : fromDateParam . getTime ( ) ; long toDate = ( toDateParam == null ) ? System . currentTimeMillis ( ) : toDateParam . getTime ( ) ; try { return new UserNotificationListing ( this . postJson ( userParam , WS . Path . UserNotification . Version1 . getAllByUserAndDate ( queryLimitParam , offsetParam , fromDate , toDate ) ) ) . getListing ( ) ; } catch ( JSONException jsonExcept ) { // rethrow as a Fluid Client exception .
throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class AES256Local { /** * Generate a new initialization vector with a { @ code seedParam } byte
 * count .
 * @ param seedParam Size of the random bytes .
 * @ return The software randomly generated bytes . */
public static byte [ ] generateRandom ( int seedParam ) { } }

implementation: if ( AES256Local . secureRandom == null ) { AES256Local . secureRandom = new SecureRandom ( ) ; } return new IvParameterSpec ( AES256Local . secureRandom . generateSeed ( seedParam ) ) . getIV ( ) ;


signature:
public class AES256Local { /** * Generates an HMAC from { @ code encryptedDataParam } .
 * @ param hMacKeyParam The symmetric key to use .
 * @ param encryptedDataParam The encrypted data .
 * @ return The HMAC result . */
public static byte [ ] hmacSha256 ( byte [ ] hMacKeyParam , byte [ ] encryptedDataParam ) { } }

implementation:
try { // hmac
Mac hmac = Mac . getInstance ( HMAC_ALGO ) ; hmac . init ( new SecretKeySpec ( hMacKeyParam , HMAC_ALGO ) ) ; return hmac . doFinal ( encryptedDataParam ) ; } // Changed for Java 1.6 compatibility . . .
catch ( NoSuchAlgorithmException except ) { throw new FluidClientException ( "Unable to create HMAC from key. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . AES_256 ) ; } catch ( InvalidKeyException except ) { throw new FluidClientException ( "Unable to create HMAC from key. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . AES_256 ) ; }


signature:
public class AES256Local { /** * Generate a derived HMAC from { @ code encryptedDataParam } using
 * other params .
 * @ param encryptedDataParam The encrypted data to generate HMAC from .
 * @ param passwordParam Password ( clear text ) used to derive the key from .
 * @ param saltParam The password salt as passed by the Init request .
 * @ param seedParam Seed to be poisoned
 * @ return Derived HMAC . */
public static byte [ ] generateLocalHMAC ( byte [ ] encryptedDataParam , String passwordParam , String saltParam , byte [ ] seedParam ) { } }

implementation:
byte [ ] poisonedSeed = poisonBytes ( seedParam ) ; byte [ ] passwordSha256 = sha256 ( passwordParam . concat ( saltParam ) . getBytes ( ) ) ; // Add the seed to the password and SHA - 256 . . .
byte [ ] derivedKey = sha256 ( UtilGlobal . addAll ( passwordSha256 , poisonedSeed ) ) ; return hmacSha256 ( derivedKey , encryptedDataParam ) ;


signature:
public class AES256Local { /** * Generate a derived HMAC from { @ code encryptedDataParam } using { @ code keyParam } .
 * @ param encryptedDataParam The encrypted data to generate HMAC from .
 * @ param keyParam Key used to derive the key from .
 * @ param seedParam Seed to be poisoned
 * @ return The HMAC for { @ code encryptedDataParam } . */
public static byte [ ] generateLocalHMACForReqToken ( byte [ ] encryptedDataParam , byte [ ] keyParam , byte [ ] seedParam ) { } }

implementation:
byte [ ] poisonedSeed = poisonBytes ( seedParam ) ; // Add the seed to the password and SHA - 256 . . .
byte [ ] derivedKey = sha256 ( UtilGlobal . addAll ( keyParam , poisonedSeed ) ) ; return hmacSha256 ( derivedKey , encryptedDataParam ) ;


signature:
public class AES256Local { /** * Creates a derived version of { @ code bytesToPoisonParam } .
 * @ param bytesToPoisonParam The bytes to poison .
 * @ return The poisoned bytes . */
private static byte [ ] poisonBytes ( byte [ ] bytesToPoisonParam ) { } }

implementation: if ( bytesToPoisonParam == null ) { return null ; } byte [ ] returnVal = new byte [ bytesToPoisonParam . length ] ; for ( int index = 0 ; index < bytesToPoisonParam . length ; index ++ ) { byte poisoned = ( byte ) ( bytesToPoisonParam [ index ] ^ 222 ) ; returnVal [ index ] = poisoned ; } return returnVal ;


signature:
public class AES256Local { /** * Decrypts the encrypted data .
 * @ param encryptedDataParam The Base64 data to decrypt .
 * @ param passwordParam Password in the clear .
 * @ param saltParam The password salt as passed by the Init request .
 * @ param ivParam IV value used during packet encryption
 * @ param seedParam The random seed .
 * @ return Decrypted bytes / Clear text . */
public static byte [ ] decryptInitPacket ( byte [ ] encryptedDataParam , String passwordParam , String saltParam , byte [ ] ivParam , byte [ ] seedParam ) { } }

implementation:
// Stored like this in the database , so we have to get the password as stored in the database so that the
// SHa256 and SALT combination will be valid . . .
byte [ ] passwordSha256 = sha256 ( passwordParam . concat ( saltParam ) . getBytes ( ) ) ; // Add the seed to the password and SHA - 256 . . .
byte [ ] derivedKey = sha256 ( UtilGlobal . addAll ( passwordSha256 , seedParam ) ) ; // Decrypt with the derived key .
return decrypt ( derivedKey , encryptedDataParam , ivParam ) ;


signature:
public class AES256Local { /** * Decrypt { @ code dataToDecryptParam } using the { @ code keyParam } key .
 * @ param keyParam The symmetric key .
 * @ param dataToDecryptParam The encrypted data to decrypt .
 * @ param ivParam The random IV .
 * @ return Clear text . */
public static byte [ ] decrypt ( byte [ ] keyParam , byte [ ] dataToDecryptParam , byte [ ] ivParam ) { } }

implementation:
Key key = new SecretKeySpec ( keyParam , KEY_ALGO ) ; try { Cipher cipher = Cipher . getInstance ( ALGO_CBC ) ; cipher . init ( Cipher . DECRYPT_MODE , key , new IvParameterSpec ( ivParam ) ) ; return cipher . doFinal ( dataToDecryptParam ) ; } // Changed for Java 1.6 compatibility . . .
catch ( InvalidKeyException except ) { throw new FluidClientException ( "Key: Unable to decrypt data. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . AES_256 ) ; } catch ( InvalidAlgorithmParameterException except ) { throw new FluidClientException ( "Algo: Unable to decrypt data. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . AES_256 ) ; } catch ( IllegalBlockSizeException except ) { throw new FluidClientException ( "Block: Unable to decrypt data. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . AES_256 ) ; } catch ( NoSuchPaddingException except ) { throw new FluidClientException ( "NoPadding: Unable to decrypt data. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . AES_256 ) ; } catch ( NoSuchAlgorithmException except ) { throw new FluidClientException ( "NoAlgo: Unable to decrypt data. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . AES_256 ) ; } catch ( BadPaddingException except ) { throw new FluidClientException ( "BadPadding: Unable to decrypt data. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . AES_256 ) ; }


signature:
public class AES256Local { /** * Encrypts the { @ code dataToEncryptParam } data using key { @ code keyParam } .
 * @ param keyParam Key to encrypt with .
 * @ param dataToEncryptParam Data to encrypt .
 * @ param ivParam - 16 bytes for AES - 256.
 * @ return Cipher text . */
public static byte [ ] encrypt ( byte [ ] keyParam , byte [ ] dataToEncryptParam , byte [ ] ivParam ) { } }

implementation:
if ( dataToEncryptParam == null ) { throw new FluidClientException ( "No data to encrypt provided. " , FluidClientException . ErrorCode . AES_256 ) ; } Key key = new SecretKeySpec ( keyParam , KEY_ALGO ) ; try { Cipher cipher = Cipher . getInstance ( ALGO_CBC ) ; cipher . init ( Cipher . ENCRYPT_MODE , key , new IvParameterSpec ( ivParam ) ) ; return cipher . doFinal ( dataToEncryptParam ) ; } // Changed for Java 1.6 compatibility . . .
catch ( InvalidKeyException except ) { throw new FluidClientException ( "Key: Unable to encrypt data. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . AES_256 ) ; } catch ( InvalidAlgorithmParameterException except ) { throw new FluidClientException ( "Algo: Unable to encrypt data. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . AES_256 ) ; } catch ( IllegalBlockSizeException except ) { throw new FluidClientException ( "Block: Unable to encrypt data. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . AES_256 ) ; } catch ( NoSuchPaddingException except ) { throw new FluidClientException ( "NoPadding: Unable to encrypt data. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . AES_256 ) ; } catch ( NoSuchAlgorithmException except ) { throw new FluidClientException ( "NoAlgo: Unable to encrypt data. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . AES_256 ) ; } catch ( BadPaddingException except ) { throw new FluidClientException ( "BadPadding: Unable to encrypt data. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . AES_256 ) ; }


signature:
public class AES256Local { /** * Compute SHA256 digest from { @ code dataParam } .
 * @ param dataParam The data to SHA - 256.
 * @ return SHA256 digest . */
public static byte [ ] sha256 ( final byte [ ] dataParam ) { } }

implementation: if ( dataParam == null || dataParam . length == 0 ) { return new byte [ ] { } ; } try { final MessageDigest digest = MessageDigest . getInstance ( "SHA-256" ) ; return digest . digest ( dataParam ) ; } catch ( final NoSuchAlgorithmException e ) { throw new IllegalStateException ( e ) ; }


signature:
public class ABaseClientWebSocket { /** * Send the { @ code baseFluidJSONObjectParam } via Web Socket .
 * @ param baseFluidJSONObjectParam The JSONObject to send .
 * @ param requestIdParam The unique request id .
 * @ see org . json . JSONObject */
public void sendMessage ( ABaseFluidJSONObject baseFluidJSONObjectParam , String requestIdParam ) { } }

implementation:
if ( baseFluidJSONObjectParam != null ) { baseFluidJSONObjectParam . setServiceTicket ( this . serviceTicket ) ; // Add the echo to the listing if [ GenericListMessageHandler ] .
if ( this . getHandler ( requestIdParam ) instanceof AGenericListMessageHandler ) { AGenericListMessageHandler listHandler = ( AGenericListMessageHandler ) this . getHandler ( requestIdParam ) ; listHandler . addExpectedMessage ( baseFluidJSONObjectParam . getEcho ( ) ) ; } } this . webSocketClient . sendMessage ( baseFluidJSONObjectParam ) ;


signature:
public class ABaseClientWebSocket { /** * If the HTTP Client is set , this will
 * close and clean any connections that needs to be closed .
 * @ since v1.1 */
@ Override public void closeAndClean ( ) { } }

implementation: CloseConnectionRunnable closeConnectionRunnable = new CloseConnectionRunnable ( this ) ; Thread closeConnThread = new Thread ( closeConnectionRunnable , "Close ABaseClientWebSocket Connection" ) ; closeConnThread . start ( ) ;


signature:
public class ABaseClientWebSocket { /** * Initiate a new request process .
 * Synchronized .
 * @ return A randomly generated identifier for the request . */
public synchronized String initNewRequest ( ) { } }

implementation: String returnVal = UUID . randomUUID ( ) . toString ( ) ; this . messageHandler . put ( returnVal , this . getNewHandlerInstance ( ) ) ; return returnVal ;


signature:
public class ABaseClientWebSocket { /** * Retrieves the Web Service URL from { @ code webServiceURLParam } .
 * @ param webServiceURLParam The Web Service URL to convert .
 * @ return The Web Socket URL version of { @ code webServiceURLParam } . */
private String getWebSocketBaseURIFrom ( String webServiceURLParam ) { } }

implementation:
if ( webServiceURLParam == null ) { return null ; } if ( webServiceURLParam . trim ( ) . length ( ) == 0 ) { return UtilGlobal . EMPTY ; } URI uri = URI . create ( webServiceURLParam ) ; StringBuilder returnBuffer = new StringBuilder ( ) ; String scheme = uri . getScheme ( ) ; if ( scheme == null ) { throw new FluidClientException ( "Unable to get scheme from '" + webServiceURLParam + "' URL." , FluidClientException . ErrorCode . ILLEGAL_STATE_ERROR ) ; } scheme = scheme . trim ( ) . toLowerCase ( ) ; // https : / / localhost : 8443 / fluid - ws /
// Scheme . . .
if ( Constant . HTTP . equals ( scheme ) ) { returnBuffer . append ( Constant . WS ) ; } else if ( Constant . HTTPS . equals ( scheme ) ) { returnBuffer . append ( Constant . WSS ) ; } else { returnBuffer . append ( uri . getScheme ( ) ) ; } returnBuffer . append ( Constant . SCHEME_SEP ) ; returnBuffer . append ( uri . getHost ( ) ) ; // 80 / 443
if ( uri . getPort ( ) > 0 ) { returnBuffer . append ( Constant . COLON ) ; returnBuffer . append ( uri . getPort ( ) ) ; } // / fluid - ws /
returnBuffer . append ( uri . getPath ( ) ) ; return returnBuffer . toString ( ) ;


signature:
public class ABaseClientWebSocket { /** * Set the { @ code echo } value if not set .
 * @ param baseToSetEchoOnIfNotSetParam The value object to set { @ code echo } on . */
protected void setEchoIfNotSet ( ABaseFluidVO baseToSetEchoOnIfNotSetParam ) { } }

implementation: if ( baseToSetEchoOnIfNotSetParam == null ) { throw new FluidClientException ( "Cannot provide 'null' for value object / pojo." , FluidClientException . ErrorCode . ILLEGAL_STATE_ERROR ) ; } else if ( baseToSetEchoOnIfNotSetParam . getEcho ( ) == null || baseToSetEchoOnIfNotSetParam . getEcho ( ) . trim ( ) . isEmpty ( ) ) { baseToSetEchoOnIfNotSetParam . setEcho ( UUID . randomUUID ( ) . toString ( ) ) ; }


signature:
public class ABaseClientWebSocket { /** * Generate a verbose Exception message .
 * @ param prefixParam The component prefix .
 * @ param uniqueReqIdParam The unique request reference .
 * @ param numberOfSentItemsParam The number of items already sent .
 * @ return Verbose error message . */
protected String getExceptionMessageVerbose ( String prefixParam , String uniqueReqIdParam , int numberOfSentItemsParam ) { } }

implementation: StringBuilder formFieldsCombined = new StringBuilder ( ) ; int returnValSize = - 1 ; RespHandler respHandler = this . getHandler ( uniqueReqIdParam ) ; if ( respHandler instanceof AGenericListMessageHandler ) { List < ? extends ABaseFluidJSONObject > returnValue = ( ( AGenericListMessageHandler ) respHandler ) . getReturnValue ( ) ; if ( returnValue != null ) { returnValSize = returnValue . size ( ) ; returnValue . forEach ( listingItm -> { if ( listingItm instanceof ABaseListing ) { ABaseListing castedToListing = ( ABaseListing ) listingItm ; if ( castedToListing != null ) { castedToListing . getListing ( ) . forEach ( formItm -> { formFieldsCombined . append ( formItm . toString ( ) ) ; } ) ; } } else { formFieldsCombined . append ( listingItm . toString ( ) ) ; } } ) ; } } return ( prefixParam + ": " + "Timeout while waiting for all return data. There were '" + returnValSize + "' items after a Timeout of " + ( TimeUnit . MILLISECONDS . toSeconds ( this . getTimeoutInMillis ( ) ) ) + " seconds on req-ref-nr '" + uniqueReqIdParam + "'. Expected a total of '" + numberOfSentItemsParam + "' forms. Returned-Data '" + formFieldsCombined . toString ( ) + "'." ) ;


signature:
public class AdminUserCreateClient { /** * Create a new administrator user for Fluid .
 * This function only works if there are no pre - existing admin user .
 * @ param passwordParam The { @ code admin } users password .
 * @ return The newly created admin user .
 * @ see User */
public User createAdminUser ( String passwordParam ) { } }

implementation: User adminUserCreate = new User ( ) ; adminUserCreate . setPasswordClear ( passwordParam ) ; return new User ( this . putJson ( adminUserCreate , WS . Path . User . Version1 . userCreateAdmin ( ) ) ) ;


signature:
public class UserNotification { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code UserNotification }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // User . . .
if ( this . getUser ( ) != null ) { returnVal . put ( JSONMapping . USER , this . getUser ( ) . toJsonObject ( ) ) ; } // Date Created . . .
if ( this . getDateCreated ( ) != null ) { returnVal . put ( JSONMapping . DATE_CREATED , this . getDateAsLongFromJson ( this . getDateCreated ( ) ) ) ; } // Date Read . . .
if ( this . getDateRead ( ) != null ) { returnVal . put ( JSONMapping . DATE_READ , this . getDateAsLongFromJson ( this . getDateRead ( ) ) ) ; } // Expiring Link . . .
if ( this . getExpiringLink ( ) != null ) { returnVal . put ( JSONMapping . EXPIRING_LINK , this . getExpiringLink ( ) ) ; } // Message . . .
if ( this . getMessage ( ) != null ) { returnVal . put ( JSONMapping . MESSAGE , this . getMessage ( ) ) ; } // User Notification Type . . .
returnVal . put ( JSONMapping . USER_NOTIFICATION_TYPE , this . getUserNotificationType ( ) ) ; return returnVal ;


signature:
public class Collaboration { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code Field }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Form Container . . .
if ( this . getFormContainer ( ) != null ) { returnVal . put ( JSONMapping . FORM_CONTAINER , this . getFormContainer ( ) . toJsonObject ( ) ) ; } // Message . . .
if ( this . getMessage ( ) != null ) { returnVal . put ( JSONMapping . MESSAGE , this . getMessage ( ) ) ; } // Date Read . . .
if ( this . getDateRead ( ) != null ) { returnVal . put ( JSONMapping . DATE_READ , this . getDateAsLongFromJson ( this . getDateRead ( ) ) ) ; } // Date Sent . . .
if ( this . getDateSent ( ) != null ) { returnVal . put ( JSONMapping . DATE_SENT , this . getDateAsLongFromJson ( this . getDateSent ( ) ) ) ; } // From User . . .
if ( this . getFromUser ( ) != null ) { returnVal . put ( JSONMapping . FROM_USER , this . getFromUser ( ) . toJsonObject ( ) ) ; } // To User . . .
if ( this . getToUser ( ) != null ) { returnVal . put ( JSONMapping . TO_USER , this . getToUser ( ) . toJsonObject ( ) ) ; } return returnVal ;


signature:
public class Auth0Client { /** * Gets a Access Token from Auth0.
 * @ param clientIdParam The client id .
 * @ param clientSecretParam The client secret .
 * @ param codeParam The code .
 * @ param redirectUrlParam The redirect URL after successful authentication .
 * @ return Access Token .
 * @ see AccessToken */
public AccessToken getAccessToken ( String clientIdParam , String clientSecretParam , String codeParam , String redirectUrlParam ) { } }

implementation: if ( clientIdParam == null || clientIdParam . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "Client Id must be provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } if ( clientSecretParam == null || clientSecretParam . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "Client Secret must be provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } if ( codeParam == null || codeParam . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "Code must be provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } AccessTokenRequest tokenRequest = new AccessTokenRequest ( ) ; tokenRequest . setClientId ( clientIdParam ) ; tokenRequest . setClientSecret ( clientSecretParam ) ; tokenRequest . setGrantType ( AUTHORIZATION_CODE ) ; tokenRequest . setCode ( codeParam ) ; tokenRequest . setRedirectUri ( redirectUrlParam ) ; return new AccessToken ( this . postJson ( false , tokenRequest , WS . Path . Auth0 . Version1 . userToken ( ) ) ) ;


signature:
public class Auth0Client { /** * Gets Auth0 Normalized User Profile info .
 * @ param accessTokenParam The access token used to get
 * user profile info from .
 * @ return User Profile .
 * @ see NormalizedUserProfile
 * @ see AccessToken */
public NormalizedUserProfile getUserProfileInfo ( AccessToken accessTokenParam ) { } }

implementation: if ( accessTokenParam == null || ( accessTokenParam . getAccessToken ( ) == null || accessTokenParam . getAccessToken ( ) . trim ( ) . isEmpty ( ) ) ) { throw new FluidClientException ( "Code must be provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } try { String accessToken = accessTokenParam . getAccessToken ( ) ; List < HeaderNameValue > headerListing = new ArrayList < HeaderNameValue > ( ) ; headerListing . add ( new HeaderNameValue ( NormalizedUserProfile . HeaderMapping . AUTHORIZATION , "Bearer " + accessToken ) ) ; return new NormalizedUserProfile ( this . getJson ( true , WS . Path . Auth0 . Version1 . userInfo ( ) , headerListing ) ) ; } catch ( UnsupportedEncodingException e ) { throw new FluidClientException ( "Unable to Encode (Not Supported). " + e . getMessage ( ) , FluidClientException . ErrorCode . ILLEGAL_STATE_ERROR ) ; }


signature:
public class ESFormFieldUtil { /** * Retrieves the Form Fields { @ code VALUES } for the Electronic Form with id
 * { @ code electronicFormIdParam } .
 * @ param electronicFormIdParam The Electronic Form to fetch fields for .
 * @ param includeTableFieldsParam Whether to populate the table fields .
 * @ return The Form Fields for Electronic Form
 * { @ code electronicFormIdParam } . */
public Form getFormFields ( Long electronicFormIdParam , boolean includeTableFieldsParam ) { } }

implementation:
if ( electronicFormIdParam == null ) { return null ; } // Query using the descendantId directly . . .
StringBuffer primaryQuery = new StringBuffer ( ABaseFluidJSONObject . JSONMapping . ID ) ; primaryQuery . append ( ":\"" ) ; primaryQuery . append ( electronicFormIdParam ) ; primaryQuery . append ( "\"" ) ; // Search for the primary . . .
List < Form > formsWithId = this . searchAndConvertHitsToFormWithAllFields ( QueryBuilders . queryStringQuery ( primaryQuery . toString ( ) ) , Index . DOCUMENT , DEFAULT_OFFSET , 1 , new Long [ ] { } ) ; Form returnVal = null ; if ( formsWithId != null && ! formsWithId . isEmpty ( ) ) { returnVal = formsWithId . get ( 0 ) ; } // No result . . .
if ( returnVal == null ) { return null ; } // Skip Table fields . . .
if ( ! includeTableFieldsParam ) { return returnVal ; } // Populate the Table Fields . . .
this . populateTableFields ( false , true , returnVal . getFormFields ( ) ) ; return returnVal ;


signature:
public class ThirdPartyLibrary { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code Field }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override @ XmlTransient public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Filename . . .
if ( this . getFilename ( ) != null ) { returnVal . put ( JSONMapping . FILENAME , this . getFilename ( ) ) ; } // Description . . .
if ( this . getDescription ( ) != null ) { returnVal . put ( JSONMapping . DESCRIPTION , this . getDescription ( ) ) ; } // Sha - 256 SUM . . .
if ( this . getSha256sum ( ) != null ) { returnVal . put ( JSONMapping . SHA_256_SUM , this . getSha256sum ( ) ) ; } // Add Tools to Classpath . . .
if ( this . isAddToolsToClassPath ( ) != null ) { returnVal . put ( JSONMapping . ADD_TOOLS_TO_CLASS_PATH , this . isAddToolsToClassPath ( ) ) ; } // Library Data in Base - 64 . . .
if ( this . getLibraryDataBase64 ( ) != null ) { returnVal . put ( JSONMapping . LIBRARY_DATA_BASE64 , this . getLibraryDataBase64 ( ) ) ; } // Date Created . . .
if ( this . getDateCreated ( ) != null ) { returnVal . put ( JSONMapping . DATE_CREATED , this . getDateAsLongFromJson ( this . getDateCreated ( ) ) ) ; } // Date Last Updated . . .
if ( this . getDateLastUpdated ( ) != null ) { returnVal . put ( JSONMapping . DATE_LAST_UPDATED , this . getDateAsLongFromJson ( this . getDateLastUpdated ( ) ) ) ; } return returnVal ;


signature:
public class ABaseClientWS { /** * Performs an HTTP request with { @ code postfixUrlParam } on { @ code httpClientParam } .
 * @ param httpClientParam The Apache Http Client to use .
 * @ param httpUriRequestParam The Apache URI Request .
 * @ param responseHandlerParam The response from the request handler .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ return Return body as JSON .
 * @ see HttpClient
 * @ see HttpUriRequest
 * @ see ResponseHandler */
private String executeHttp ( HttpClient httpClientParam , HttpUriRequest httpUriRequestParam , ResponseHandler responseHandlerParam , String postfixUrlParam ) { } }

implementation:
try { Object returnedObj = httpClientParam . execute ( httpUriRequestParam , responseHandlerParam ) ; // String text came back . . .
if ( returnedObj instanceof String ) { return ( String ) returnedObj ; } else if ( returnedObj == null ) { // [ null ] - came back . . .
throw new FluidClientException ( "No results, [null] response." , FluidClientException . ErrorCode . NO_RESULT ) ; } throw new FluidClientException ( "Expected 'String' got '" + ( ( returnedObj == null ) ? null : returnedObj . getClass ( ) . getName ( ) ) + "'." , FluidClientException . ErrorCode . ILLEGAL_STATE_ERROR ) ; } catch ( IOException except ) { // IO Problem . . .
if ( except instanceof UnknownHostException ) { throw new FluidClientException ( "Unable to reach host '" + this . endpointUrl . concat ( postfixUrlParam ) + "'. " + except . getMessage ( ) , except , FluidClientException . ErrorCode . CONNECT_ERROR ) ; } if ( except instanceof ConnectException ) { throw new FluidClientException ( except . getMessage ( ) , except , FluidClientException . ErrorCode . CONNECT_ERROR ) ; } throw new FluidClientException ( except . getMessage ( ) , except , FluidClientException . ErrorCode . IO_ERROR ) ; }


signature:
public class ABaseClientWS { /** * Performs an HTTP - GET request with { @ code postfixUrlParam } .
 * Does not perform a connection test .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ param headerNameValuesParam The HTTP Headers to include .
 * @ return Return body as JSON .
 * @ see JSONObject */
public JSONObject getJson ( String postfixUrlParam , List < HeaderNameValue > headerNameValuesParam ) { } }

implementation: return this . getJson ( false , postfixUrlParam , headerNameValuesParam ) ;


signature:
public class ABaseClientWS { /** * Performs an HTTP - GET request with { @ code postfixUrlParam } .
 * @ param checkConnectionValidParam Check if connection to
 * base endpoint is valid .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ param headerNameValuesParam The HTTP Headers to include .
 * @ return Return body as JSON .
 * @ see JSONObject */
public JSONObject getJson ( boolean checkConnectionValidParam , String postfixUrlParam , List < HeaderNameValue > headerNameValuesParam ) { } }

implementation:
// Connection is not valid . . . throw error . . .
if ( checkConnectionValidParam && ! this . isConnectionValid ( ) ) { throw new FluidClientException ( "Unable to reach service at '" + this . endpointUrl . concat ( postfixUrlParam ) + "'." , FluidClientException . ErrorCode . CONNECT_ERROR ) ; } CloseableHttpClient httpclient = this . getClient ( ) ; try { HttpGet httpGet = new HttpGet ( this . endpointUrl . concat ( postfixUrlParam ) ) ; if ( headerNameValuesParam != null && ! headerNameValuesParam . isEmpty ( ) ) { for ( HeaderNameValue headerNameVal : headerNameValuesParam ) { if ( headerNameVal . getName ( ) == null || headerNameVal . getName ( ) . trim ( ) . isEmpty ( ) ) { continue ; } if ( headerNameVal . getValue ( ) == null ) { continue ; } httpGet . setHeader ( headerNameVal . getName ( ) , headerNameVal . getValue ( ) ) ; } } // Create a custom response handler
ResponseHandler < String > responseHandler = this . getJsonResponseHandler ( this . endpointUrl . concat ( postfixUrlParam ) ) ; String responseBody = this . executeHttp ( httpclient , httpGet , responseHandler , postfixUrlParam ) ; if ( responseBody == null || responseBody . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "No response data from '" + this . endpointUrl . concat ( postfixUrlParam ) + "'." , FluidClientException . ErrorCode . IO_ERROR ) ; } JSONObject jsonOjb = new JSONObject ( responseBody ) ; if ( jsonOjb . isNull ( Error . JSONMapping . ERROR_CODE ) ) { return jsonOjb ; } int errorCode = jsonOjb . getInt ( Error . JSONMapping . ERROR_CODE ) ; if ( errorCode > 0 ) { String errorMessage = ( jsonOjb . isNull ( Error . JSONMapping . ERROR_MESSAGE ) ? "Not set" : jsonOjb . getString ( Error . JSONMapping . ERROR_MESSAGE ) ) ; throw new FluidClientException ( errorMessage , errorCode ) ; } return jsonOjb ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class ABaseClientWS { /** * Performs an HTTP - POST request with { @ code postfixUrlParam } .
 * @ param baseDomainParam The base domain to convert to JSON and POST
 * to { @ code this } endpoint .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ return Return body as JSON .
 * @ see JSONObject
 * @ see ABaseFluidJSONObject */
protected JSONObject postJson ( ABaseFluidJSONObject baseDomainParam , String postfixUrlParam ) { } }

implementation:
// No need to check connection . . .
return this . postJson ( false , baseDomainParam , postfixUrlParam ) ;


signature:
public class ABaseClientWS { /** * Performs an HTTP - POST request with { @ code postfixUrlParam } .
 * @ param headerNameValuesParam The additional HTTP headers .
 * @ param checkConnectionValidParam Check if connection to base endpoint is valid .
 * @ param baseDomainParam The base domain to convert to JSON and POST
 * to { @ code this } endpoint .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ return Return body as JSON .
 * @ see JSONObject
 * @ see ABaseFluidJSONObject */
protected JSONObject postJson ( List < HeaderNameValue > headerNameValuesParam , boolean checkConnectionValidParam , ABaseFluidJSONObject baseDomainParam , String postfixUrlParam ) { } }

implementation: return this . executeJson ( HttpMethod . POST , headerNameValuesParam , checkConnectionValidParam , baseDomainParam , ContentType . APPLICATION_JSON , postfixUrlParam ) ;


signature:
public class ABaseClientWS { /** * Performs an HTTP - POST request with { @ code postfixUrlParam } .
 * @ param checkConnectionValidParam Check if connection to base endpoint is valid .
 * @ param baseDomainParam The base domain to convert to JSON and POST
 * to { @ code this } endpoint .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ return Return body as JSON .
 * @ see JSONObject
 * @ see ABaseFluidJSONObject */
protected JSONObject postJson ( boolean checkConnectionValidParam , ABaseFluidJSONObject baseDomainParam , String postfixUrlParam ) { } }

implementation: return this . executeJson ( HttpMethod . POST , null , checkConnectionValidParam , baseDomainParam , ContentType . APPLICATION_JSON , postfixUrlParam ) ;


signature:
public class ABaseClientWS { /** * Performs an HTTP - DELETE request with { @ code postfixUrlParam } .
 * @ param baseDomainParam The base domain to convert to JSON and DELETE
 * to { @ code this } endpoint .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ return Return body as JSON .
 * @ see JSONObject */
protected JSONObject deleteJson ( ABaseFluidJSONObject baseDomainParam , String postfixUrlParam ) { } }

implementation:
// No need to check connection . . .
return this . deleteJson ( false , baseDomainParam , postfixUrlParam ) ;


signature:
public class ABaseClientWS { /** * Performs an HTTP - DELETE request with { @ code postfixUrlParam } .
 * @ param checkConnectionValidParam Check if connection to base endpoint is valid .
 * @ param baseDomainParam The base domain to convert to JSON and DELETE
 * to { @ code this } endpoint .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ return Return body as JSON .
 * @ see JSONObject */
protected JSONObject deleteJson ( boolean checkConnectionValidParam , ABaseFluidJSONObject baseDomainParam , String postfixUrlParam ) { } }

implementation: return this . executeJson ( HttpMethod . DELETE , null , checkConnectionValidParam , baseDomainParam , ContentType . APPLICATION_JSON , postfixUrlParam ) ;


signature:
public class ABaseClientWS { /** * Performs an HTTP - POST request with { @ code postfixUrlParam } making use of
 * form params as { @ code formNameValuesParam } .
 * @ param checkConnectionValidParam Check if connection to base endpoint is valid .
 * @ param formNameValuesParam The name and value pairs of form data .
 * @ param postfixUrlParam URL mapping after the Base endpoint .
 * @ return Return body as JSON . */
protected JSONObject postForm ( boolean checkConnectionValidParam , List < FormNameValue > formNameValuesParam , String postfixUrlParam ) { } }

implementation: return this . executeForm ( HttpMethod . POST , null , checkConnectionValidParam , formNameValuesParam , ContentType . APPLICATION_FORM_URLENCODED , postfixUrlParam ) ;