use of com.icthh.xm.ms.entity.domain.kafka.SystemEvent in project xm-ms-entity by xm-online.
the class SystemEventMapperUnitTest method createEventWithoutDates.
private SystemEvent createEventWithoutDates() {
SystemEvent event = new SystemEvent();
Map<String, Object> data = new HashMap<>();
event.setData(data);
data.put(Constants.ID, DEFAULT_ID);
data.put(Constants.FIRST_NAME, DEFAULT_FIRST_NAME);
data.put(Constants.LAST_NAME, DEFAULT_LAST_NAME);
data.put(Constants.IMAGE_URL, DEFAULT_IMAGE_URL);
data.put(Constants.ACTIVATED, DEFAULT_ACTIVATED);
data.put(Constants.CREATED_DATE, "");
data.put(Constants.LAST_MODIFIED_DATE, "");
data.put(Constants.USER_KEY, DEFAULT_USER_KEY);
return event;
}
use of com.icthh.xm.ms.entity.domain.kafka.SystemEvent in project xm-ms-entity by xm-online.
the class ProfileEventProducer method createEventJson.
public String createEventJson(Object data, String eventType) {
SystemEvent event = null;
try {
event = buildSystemEvent(eventType);
event.setData(data);
return mapper.writeValueAsString(event);
} catch (JsonProcessingException e) {
log.warn("Event creation error, eventType = {}, data = {}", eventType, event.getData(), e);
}
return null;
}
use of com.icthh.xm.ms.entity.domain.kafka.SystemEvent in project xm-ms-entity by xm-online.
the class SystemQueueConsumerLepKeyResolver method getAppendSegments.
/**
* LEP extension key specification:<br>
* {@code ChangeState$$<xm-entity-type-key>$$<next-state-key>}
* <p>
* Add to method name {@code <xm-entity-type-key} and {@code <state-key>} to the end.
*
* @param baseKey base LEP key (prefix), can be {@code null}
* @param method method data on what LEP call occurs
* @param managerService LEP manager service
* @return dynamic value of LEP base key
*/
@Override
protected String[] getAppendSegments(SeparatorSegmentedLepKey baseKey, LepMethod method, LepManagerService managerService) {
SystemEvent event = getRequiredParam(method, PARAM_EVENT, SystemEvent.class);
String translatedEventType = translateToLepConvention(event.getEventType());
return new String[] { translatedEventType };
}
Aggregations