@Service public class BusRepository extends java.lang.Object implements BusInterface
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
createBus |
private java.lang.String |
deleteFromBus |
private java.lang.String |
idBus |
private JacksonMapper |
mapper |
private java.lang.String |
originAdressBus |
private java.lang.String |
phaseBus |
private java.lang.String |
readFromBus |
private java.lang.String |
resolvedAdressBus |
private java.lang.String |
rollbackBus |
private java.lang.String |
tagBus |
private java.lang.String |
updateToBus |
private java.lang.String |
urlBus |
Constructor and Description |
---|
BusRepository() |
Modifier and Type | Method and Description |
---|---|
java.util.ArrayList<java.lang.String> |
create(RichPointerBus pointerBus)
this method permits to interact with the bus through a create request.
|
java.util.ArrayList<java.lang.String> |
delete(PointerBus pointerBus)
this method permits to interact with the bus through a delete request.
|
private java.util.ArrayList<java.lang.String> |
fillContent(java.lang.String field1,
PointerBus field2)
Simple function to create and fill the content array.
|
private java.lang.String |
phaseOfPointerPayload(PointerBus pointerBus)
this method is used to grab the phase of the requested or sended element.
|
private java.util.ArrayList<java.lang.String> |
rawPost(java.util.ArrayList<java.lang.String> content)
lowest level method to interact with bus, it requires only the type of request and the content. there's no "null check"
|
java.util.ArrayList<java.lang.String> |
read(PointerBus pointerBus)
this method permits to interact with the bus through a read request.
|
java.util.ArrayList<java.lang.String> |
rollback(PointerBus pointerBus)
this method permits to interact with the bus through a rollback request.
|
java.util.ArrayList<java.lang.String> |
update(RichPointerBus pointerBus)
this method permits to interact with the bus through a update request.
|
@Value(value="${bus.url}") private java.lang.String urlBus
@Value(value="${bus.tag}") private java.lang.String tagBus
@Value(value="${bus.originAdress}") private java.lang.String originAdressBus
@Value(value="${bus.resolvedAdress}") private java.lang.String resolvedAdressBus
@Value(value="${bus.id}") private java.lang.String idBus
@Value(value="${bus.phase}") private java.lang.String phaseBus
@Value(value="${bus.readFromBus}") private java.lang.String readFromBus
@Value(value="${bus.updateToBus}") private java.lang.String updateToBus
@Value(value="${bus.createBus}") private java.lang.String createBus
@Value(value="${bus.deleteFromBus}") private java.lang.String deleteFromBus
@Value(value="${bus.rollbackBus}") private java.lang.String rollbackBus
@Autowired private JacksonMapper mapper
private java.util.ArrayList<java.lang.String> rawPost(java.util.ArrayList<java.lang.String> content) throws BusException
content
- Array with 3 elements, it contains the phase number, the request (read, update, delete, rollback) and the content stringBusException
private java.util.ArrayList<java.lang.String> fillContent(java.lang.String field1, PointerBus field2) throws com.fasterxml.jackson.core.JsonProcessingException
field1
- identifies the kind of the requestfield2
- identifies the requestcom.fasterxml.jackson.core.JsonProcessingException
JacksonMapper
public java.util.ArrayList<java.lang.String> read(PointerBus pointerBus) throws BusException, com.fasterxml.jackson.core.JsonProcessingException
read
in interface BusInterface
pointerBus
- BusException
- if available append the previous exception to the last onecom.fasterxml.jackson.core.JsonProcessingException
- if the dto is not printable like jsonpublic java.util.ArrayList<java.lang.String> update(RichPointerBus pointerBus) throws BusException, com.fasterxml.jackson.core.JsonProcessingException
update
in interface BusInterface
pointerBus
- BusException
- if available append the previous exception to the last onecom.fasterxml.jackson.core.JsonProcessingException
- if the dto is not printable like jsonpublic java.util.ArrayList<java.lang.String> create(RichPointerBus pointerBus) throws BusException, com.fasterxml.jackson.core.JsonProcessingException
create
in interface BusInterface
pointerBus,
- of type RichPointerBus, it contains the payload tooBusException
- if available append the previous exception to the last onecom.fasterxml.jackson.core.JsonProcessingException
- if the dto is not printable like jsonpublic java.util.ArrayList<java.lang.String> rollback(PointerBus pointerBus) throws BusException, com.fasterxml.jackson.core.JsonProcessingException
rollback
in interface BusInterface
pointerBus,
- of type RichPointerBus, it contains the payload tooBusException
- if available append the previous exception to the last onecom.fasterxml.jackson.core.JsonProcessingException
- if the dto is not printable like jsonpublic java.util.ArrayList<java.lang.String> delete(PointerBus pointerBus) throws BusException, com.fasterxml.jackson.core.JsonProcessingException
delete
in interface BusInterface
pointerBus
- BusException
- if available append the previous exception to the last onecom.fasterxml.jackson.core.JsonProcessingException
- if the dto is not printable like jsonprivate java.lang.String phaseOfPointerPayload(PointerBus pointerBus)
pointerBus
-