use of org.apache.camel.component.apns.model.MessageType in project camel by apache.
the class ApnsProducer method notify.
private void notify(Exchange exchange) throws ApnsException {
MessageType messageType = getHeaderMessageType(exchange, MessageType.STRING);
if (messageType == MessageType.APNS_NOTIFICATION) {
ApnsNotification apnsNotification = exchange.getIn().getBody(ApnsNotification.class);
getEndpoint().getApnsService().push(apnsNotification);
} else {
constructNotificationAndNotify(exchange, messageType);
}
}
use of org.apache.camel.component.apns.model.MessageType in project camel by apache.
the class ApnsProducer method getHeaderMessageType.
public MessageType getHeaderMessageType(Exchange exchange, MessageType defaultMessageType) {
String messageTypeStr = (String) exchange.getIn().getHeader(ApnsConstants.HEADER_MESSAGE_TYPE);
if (messageTypeStr == null) {
return defaultMessageType;
}
MessageType messageType = MessageType.valueOf(messageTypeStr);
return messageType;
}
Aggregations