public class ContactsServiceImpl extends java.lang.Object implements ContactsService
Modifier and Type | Field and Description |
---|---|
private SageoneConfig |
config |
private OrderDataExtractor |
orderExtractor |
private SageoneRequestExecutor |
requestExecutor |
private ResponseDeserializer |
responseDeserializer |
private SageFormUrlEncodedMarshaller |
sageFormUrlEncodedMarshaller |
private SagePagingService |
sagePagingService |
Constructor and Description |
---|
ContactsServiceImpl(SageoneRequestExecutor requestExecutor,
ResponseDeserializer responseDeserializer,
SagePagingService sagePagingService,
SageoneConfig config,
SageFormUrlEncodedMarshaller sageFormUrlEncodedMarshaller,
OrderDataExtractor orderExtractor) |
Modifier and Type | Method and Description |
---|---|
SageContactResponse |
createContact(GUID shopGuid,
DetailedOrder order)
Creates a new contact in the sageone account associated with the
specified shop.
|
SageContactResponse |
deleteContact(GUID shopGuid,
java.lang.String contactId)
Deletes a specific contact from the sageone account associated with the
specified shop.
|
java.util.List<SageContactResponse> |
findContacts(GUID shopGuid,
java.lang.String email)
Finds contacts with the specified email address in the sageone account
that is associated with the given shop.
|
java.util.List<SageContactResponse> |
findContacts(GUID shopGuid,
java.lang.String email,
java.lang.String search)
Finds contacts that are matching the given email address and search term
in their contact name (not case sensitive), in the sageone account that
is associated with the given shop.
|
SageContactResponse |
getContact(GUID shopGuid,
java.lang.String contactId)
Gets a specific contact from the sageone account associated with the
specified shop.
|
private void |
translateToWebserviceException(javax.ws.rs.core.Response response) |
private SageoneRequestExecutor requestExecutor
private ResponseDeserializer responseDeserializer
private SagePagingService sagePagingService
private OrderDataExtractor orderExtractor
private SageoneConfig config
private SageFormUrlEncodedMarshaller sageFormUrlEncodedMarshaller
@Inject public ContactsServiceImpl(SageoneRequestExecutor requestExecutor, ResponseDeserializer responseDeserializer, SagePagingService sagePagingService, SageoneConfig config, SageFormUrlEncodedMarshaller sageFormUrlEncodedMarshaller, OrderDataExtractor orderExtractor)
public SageContactResponse createContact(GUID shopGuid, DetailedOrder order) throws WebserviceException, javax.validation.ValidationException, DeserializationException
ContactsService
createContact
in interface ContactsService
shopGuid
- GUID of the shop.order
- Order to obtain the contact information from.WebserviceException
- in case there was a error with the remote API.javax.validation.ValidationException
- in case there was an error while validating the sage
response.DeserializationException
- in case there was an error while deserializing the sage
response.public SageContactResponse getContact(GUID shopGuid, java.lang.String contactId) throws WebserviceException
ContactsService
getContact
in interface ContactsService
shopGuid
- GUID of the shop.contactId
- Identifier of the desired contact.WebserviceException
- in case there was a error with the remote API.public java.util.List<SageContactResponse> findContacts(GUID shopGuid, java.lang.String email) throws WebserviceException
ContactsService
findContacts
in interface ContactsService
shopGuid
- GUID of the shop.email
- Email to search for.WebserviceException
- in case there was a error with the remote API.public java.util.List<SageContactResponse> findContacts(GUID shopGuid, java.lang.String email, java.lang.String search) throws WebserviceException
ContactsService
findContacts
in interface ContactsService
shopGuid
- GUID of the shop.email
- Email to search for.search
- Term to match in the contact name.WebserviceException
- in case there was a error with the remote API.public SageContactResponse deleteContact(GUID shopGuid, java.lang.String contactId) throws WebserviceException, javax.validation.ValidationException, DeserializationException
ContactsService
deleteContact
in interface ContactsService
shopGuid
- GUID of the shop.contactId
- Identifier of the contact to delete.WebserviceException
- in case there was a error with the remote API.javax.validation.ValidationException
- in case there was an error while validating the sage
response.DeserializationException
- in case there was an error while deserializing the sage
response.private void translateToWebserviceException(javax.ws.rs.core.Response response) throws WebserviceException
WebserviceException