package com.megatim.fdxconsultation.service.impl.camel.consumer;
|
|
import org.apache.camel.Handler;
|
import com.fdx.messaging.common.StandaloneServerState;
|
import com.megatim.fdxconsultation.core.ifaces.supervision.StandaloneServerStateEntityManager;
|
import com.megatim.fdxconsultation.model.supervision.StandaloneServerStateEntity;
|
import com.megatim.fdxconsultation.service.impl.sockets.helpers.StandaloneServerStateSessionHandler;
|
import javax.inject.Inject;
|
import javax.transaction.Transactional;
|
|
/**
|
*
|
* @author ASUS
|
*/
|
public class StandaloneServerStateConsumer {
|
|
@Inject
|
StandaloneServerStateEntityManager serverStateManager;
|
|
@Inject
|
private StandaloneServerStateSessionHandler standaloneServerStateSessionHandler;
|
|
@Handler
|
@Transactional
|
public void consume(StandaloneServerState serverState) {
|
StandaloneServerStateEntity standaloneServerStateEntity = serverStateManager.persistStandaloneConfigurationStateEntity(serverState);
|
if(standaloneServerStateEntity != null) {
|
standaloneServerStateSessionHandler.publishMessage(standaloneServerStateEntity);
|
}
|
}
|
}
|