Class SFDCServiceImpl
- java.lang.Object
-
- org.apache.unomi.sfdc.services.internal.SFDCServiceImpl
-
- All Implemented Interfaces:
SFDCService
public class SFDCServiceImpl extends Object implements SFDCService
Implementation of the Salesforce connector interface
-
-
Constructor Summary
Constructors Constructor Description SFDCServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createOrUpdateLead(Profile profile)
Create or update a lead based on a Unomi profile.boolean
deleteLead(String leadId)
Set<String>
findLeadIdsByIdentifierValue(String identifierFieldValue)
Map<String,Object>
getLead(String leadId)
Set<String>
getLeadMandatoryFields()
Map<String,Object>
getLimits()
Set<String>
getRecentLeadIds()
SFDCSession
getSFDCSession()
Map<String,Object>
getSObject(String sobjectName, String objectId)
Map<String,Object>
getSObjectDescribe(String sobjectName)
boolean
isConfigured()
boolean
isConnected()
SFDCConfiguration
loadConfiguration()
Load the configuration from the persistence service (if it exists)boolean
login(SFDCConfiguration sfdcConfiguration)
Login into Salesforce using the configuration passed in the methods arguments.void
logout()
Map<String,Object>
query(String query)
boolean
saveConfiguration(SFDCConfiguration sfdcConfiguration)
Save a Salesforce configuration into the persistence servicevoid
setDefaultSFDCConfiguration(SFDCConfiguration defaultSFDCConfiguration)
void
setPersistenceService(PersistenceService persistenceService)
void
setupPushListener(String channelName, org.cometd.bayeux.client.ClientSessionChannel.MessageListener messageListener)
void
start()
void
stop()
boolean
updateProfileFromLead(Profile profile)
Updates a Unomi profile from a Salesforce lead
-
-
-
Method Detail
-
setPersistenceService
public void setPersistenceService(PersistenceService persistenceService)
-
setDefaultSFDCConfiguration
public void setDefaultSFDCConfiguration(SFDCConfiguration defaultSFDCConfiguration)
-
getSFDCSession
public SFDCSession getSFDCSession()
- Specified by:
getSFDCSession
in interfaceSFDCService
-
loadConfiguration
public SFDCConfiguration loadConfiguration()
Description copied from interface:SFDCService
Load the configuration from the persistence service (if it exists)- Specified by:
loadConfiguration
in interfaceSFDCService
- Returns:
- an instance of the configuration if it was found, null otherwise
-
saveConfiguration
public boolean saveConfiguration(SFDCConfiguration sfdcConfiguration)
Description copied from interface:SFDCService
Save a Salesforce configuration into the persistence service- Specified by:
saveConfiguration
in interfaceSFDCService
- Parameters:
sfdcConfiguration
- the configuration to persist- Returns:
- a boolean indicating if the save was successful or not
-
start
public void start()
-
stop
public void stop()
-
getRecentLeadIds
public Set<String> getRecentLeadIds()
- Specified by:
getRecentLeadIds
in interfaceSFDCService
-
getLead
public Map<String,Object> getLead(String leadId)
- Specified by:
getLead
in interfaceSFDCService
-
deleteLead
public boolean deleteLead(String leadId)
-
findLeadIdsByIdentifierValue
public Set<String> findLeadIdsByIdentifierValue(String identifierFieldValue)
- Specified by:
findLeadIdsByIdentifierValue
in interfaceSFDCService
-
createOrUpdateLead
public String createOrUpdateLead(Profile profile)
Description copied from interface:SFDCService
Create or update a lead based on a Unomi profile.- Specified by:
createOrUpdateLead
in interfaceSFDCService
- Parameters:
profile
- the Unomi profile to use to update leads- Returns:
- a String containing the identifier of the corresponding SFDC lead
-
updateProfileFromLead
public boolean updateProfileFromLead(Profile profile)
Description copied from interface:SFDCService
Updates a Unomi profile from a Salesforce lead- Specified by:
updateProfileFromLead
in interfaceSFDCService
- Parameters:
profile
- the profile to update with the data coming from the lead- Returns:
- true if the profile was updated, false otherwise.
-
getLimits
public Map<String,Object> getLimits()
- Specified by:
getLimits
in interfaceSFDCService
-
setupPushListener
public void setupPushListener(String channelName, org.cometd.bayeux.client.ClientSessionChannel.MessageListener messageListener) throws Exception
- Throws:
Exception
-
login
public boolean login(SFDCConfiguration sfdcConfiguration) throws org.apache.http.HttpException, IOException
Description copied from interface:SFDCService
Login into Salesforce using the configuration passed in the methods arguments.- Specified by:
login
in interfaceSFDCService
- Parameters:
sfdcConfiguration
- the configuration to use for the login- Returns:
- true if the login was successful, false otherwise
- Throws:
org.apache.http.HttpException
- thrown if there was an error communicating with the Salesforce serverIOException
- thrown if there was an error communicating with the Salesforce server
-
logout
public void logout()
- Specified by:
logout
in interfaceSFDCService
-
isConfigured
public boolean isConfigured()
-
isConnected
public boolean isConnected()
-
-