package org.wso2.carbon.device.mgt.ios.apns.service.impl;

import org.wso2.carbon.device.mgt.ios.apns.exception.APNSException;
import org.wso2.carbon.device.mgt.ios.apns.service.PushNotificationService;

import java.io.InputStream;

public class PushNotificationServiceImpl implements PushNotificationService {

    public void sendNotification(InputStream inputStream, String certPassword, boolean isProductionMode,
                                 String token, String title, String message) throws APNSException {

        PushNotificationSenderService pushNotificationSenderService = PushNotificationSenderService.getInstance();
        pushNotificationSenderService.sendNotification(inputStream, certPassword, isProductionMode, token,
                title, message);

    }

    public void sendSilentNotification(InputStream inputStream, String certPassword, boolean isProductionMode,
                                       String token, String operationCode, int operationId) throws APNSException {

        PushNotificationSenderService pushNotificationSenderService = PushNotificationSenderService.getInstance();
        pushNotificationSenderService.sendSilentNotification(inputStream, certPassword, isProductionMode,
                token, operationCode, operationId);

    }

    public void sendMDMNotification(InputStream inputStream, String certPassword, boolean isProductionMode,
                                 String deviceToken, String magicToken) throws APNSException {

        MDMPushNotificationSenderService mdmPushNotificationSenderService = MDMPushNotificationSenderService.
                getInstance();
        mdmPushNotificationSenderService.sendNotification(inputStream, certPassword, isProductionMode,
                deviceToken, magicToken);
    }
}
