########################### SourceAdapterForSObjectPush ########################### This interface allows your :ref:`Adapter ` to be the source Adapter to be part of a Link run that starts out by being given SObject instances. It is also required if you are using the **LOCATOR** :doc:`/classes/fetch-strategy`. Valence's LocalSalesforceAdapter already implements this interface and covers both of the above scenarios, so you would only ever need to implement this if you were writing your own Adapter to interact with the local org for some reason. ********** Definition ********** .. code-block:: java /** * Implement this interface if your Adapter can be used to turn SObject records into RecordInFlight records. In other words, * if your Adapter can be used to pick up standard or custom objects (or platform events) from the local org and prepare * them to be sent elsewhere. Use this interface if your Adapter is handed data (sometimes called a Push model). */ global interface SourceAdapterForSObjectPush extends SourceAdapter { /** * Given a collection of sObject records, produce a collection of RecordInFlight records that are ready for further * processing by the Valence engine. * * @param context Information about this Link and the current execution of it. * @param records Source data, in the form of sObject records. Could be standard/custom objects, or platform events. * * @return The passed source data converted into RecordInFlight records. */ List buildRecords(LinkContext context, List records); } ************* Example Usage ************* .. code-block:: java public class MyAdapter implements valence.SourceAdapterForSObjectPush { public List buildRecords(valence.LinkContext context, List sObjects) { List records = new List(); for(SObject obj : sObjects) { Map propertiesMap = obj.getPopulatedFieldsAsMap(); valence.RecordInFlight record = new valence.RecordInFlight(propertiesMap); records.add(record); } return records; } }