All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javapns.notification.management.APNPayload Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package javapns.notification.management;

import java.util.*;

import org.json.*;

/**
 * An MDM payload for APN (Access Point Name).
 * 
 * @author Sylvain Pedneault
 */
public class APNPayload extends MobileConfigPayload {

	public APNPayload(int payloadVersion, String payloadOrganization, String payloadIdentifier, String payloadDisplayName, Map defaultsData, String defaultsDomainName, Map[] apns, String apn, String username) throws JSONException {
		super(payloadVersion, "com.apple.apn.managed", payloadOrganization, payloadIdentifier, payloadDisplayName);
		JSONObject payload = getPayload();
		payload.put("DefaultsData", defaultsData);
		payload.put("defaultsDomainName", defaultsDomainName);
		for (Map apnsEntry : apns)
			payload.put("apns", apnsEntry);
		payload.put("apn", apn);
		payload.put("username", username);
	}


	public void setPassword(APNPayload value) throws JSONException {
		getPayload().put("password", value);
	}


	public void setProxy(String value) throws JSONException {
		getPayload().put("proxy", value);
	}


	public void setProxyPort(int value) throws JSONException {
		getPayload().put("proxyPort", value);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy