public class PushServerClient extends Object
| Constructor and Description |
|---|
PushServerClient()
Default constructor.
|
PushServerClient(String serviceBaseUrl)
Constructor with a push server base URL.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addUsersToCampaign(Long campaignId,
List<String> users)
Add a list of users to a specific campaign
|
io.getlime.core.rest.model.base.response.ObjectResponse<CreateApplicationResponse> |
createApplication(Long appId)
Create application credentials entity.
|
io.getlime.core.rest.model.base.response.ObjectResponse<CreateCampaignResponse> |
createCampaign(Long appId,
PushMessageBody message)
Create a campaign.
|
boolean |
createDevice(Long appId,
String token,
MobilePlatform platform)
Register anonymous device to the push server.
|
boolean |
createDevice(Long appId,
String token,
MobilePlatform platform,
String activationId)
Register device associated with activation ID to the push server.
|
boolean |
deleteCampaign(Long campaignId)
Delete a campaign specified with campaignId.
|
boolean |
deleteDevice(Long appId,
String token)
Remove device from the push server
|
boolean |
deleteUsersFromCampaign(Long campaignId,
List<String> users)
Delete a list of users from specific campaign.
|
io.getlime.core.rest.model.base.response.ObjectResponse<GetApplicationDetailResponse> |
getApplicationDetail(Long id,
boolean includeIos,
boolean includeAndroid)
Get detail for an application credentials entity.
|
io.getlime.core.rest.model.base.response.ObjectResponse<GetApplicationListResponse> |
getApplicationList()
Get list of application credentials entities.
|
io.getlime.core.rest.model.base.response.ObjectResponse<CampaignResponse> |
getCampaign(Long campaignId)
Get a campaign specified with campaignID.
|
io.getlime.core.rest.model.base.response.ObjectResponse<ListOfCampaignsResponse> |
getListOfCampaigns(boolean all)
Get list of campaigns, dependent on all param
|
PagedResponse<ListOfUsersFromCampaignResponse> |
getListOfUsersFromCampaign(Long campaignId,
int page,
int size)
Get a list of users in paged format from specific campaign
|
io.getlime.core.rest.model.base.response.ObjectResponse<ServiceStatusResponse> |
getServiceStatus()
Returns service information
|
io.getlime.core.rest.model.base.response.ObjectResponse<GetApplicationListResponse> |
getUnconfiguredApplicationList()
Get list of applications which are not yet configured in Push Server but exist in PowerAuth server.
|
io.getlime.core.rest.model.base.response.Response |
removeAndroid(Long id)
Remove Android record from an application credentials entity.
|
io.getlime.core.rest.model.base.response.Response |
removeIos(Long id)
Remove iOS record from an application credentials entity.
|
boolean |
sendCampaign(Long campaignId)
Send a specific campaign to users carrying this campaignID in PushCampaignUser model, but only once per device identified by token.
|
io.getlime.core.rest.model.base.response.ObjectResponse<PushMessageSendResult> |
sendPushMessage(Long appId,
PushMessage pushMessage)
Send a single push message to application with given ID.
|
io.getlime.core.rest.model.base.response.ObjectResponse<PushMessageSendResult> |
sendPushMessageBatch(Long appId,
List<PushMessage> batch)
Send a push message batch to application with given ID.
|
boolean |
sendTestCampaign(Long campaignId,
String userId)
Send a campaign on test user for trying its correctness.
|
void |
setServiceBaseUrl(String serviceBaseUrl)
Set the service base URL.
|
io.getlime.core.rest.model.base.response.Response |
updateAndroid(Long id,
String projectId,
byte[] privateKey)
Update Android details for an application credentials entity.
|
boolean |
updateDeviceStatus(String activationId)
Update activation status for given device registration.
|
io.getlime.core.rest.model.base.response.Response |
updateIos(Long id,
String bundle,
String keyId,
String teamId,
byte[] privateKey)
Update iOS details for an application credentials entity.
|
public PushServerClient()
public PushServerClient(String serviceBaseUrl)
serviceBaseUrl - URL pointing to the running push server instance, for example "http://localhost:8080/powerauth-push-server".public void setServiceBaseUrl(String serviceBaseUrl)
serviceBaseUrl - Base URL.public io.getlime.core.rest.model.base.response.ObjectResponse<ServiceStatusResponse> getServiceStatus() throws PushServerClientException
PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean createDevice(Long appId, String token, MobilePlatform platform) throws PushServerClientException
appId - PowerAuth 2.0 application app ID.token - Token received from the push service provider (APNs, FCM).platform - Mobile platform (iOS, Android).PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean createDevice(Long appId, String token, MobilePlatform platform, String activationId) throws PushServerClientException
appId - PowerAuth 2.0 application app ID.token - Token received from the push service provider (APNs, FCM).platform - Mobile platform (iOS, Android).activationId - PowerAuth 2.0 activation ID.PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean deleteDevice(Long appId, String token) throws PushServerClientException
appId - PowerAuth 2.0 application app ID.token - Token received from the push service provider.PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean updateDeviceStatus(String activationId) throws PushServerClientException
activationId - Identifier of activationPushServerClientException - In case of network, response / JSON processing, or other IO error.public io.getlime.core.rest.model.base.response.ObjectResponse<PushMessageSendResult> sendPushMessage(Long appId, PushMessage pushMessage) throws PushServerClientException
appId - PowerAuth 2.0 application app ID.pushMessage - Push message to be sent.PushServerClientException - In case of network, response / JSON processing, or other IO error.public io.getlime.core.rest.model.base.response.ObjectResponse<PushMessageSendResult> sendPushMessageBatch(Long appId, List<PushMessage> batch) throws PushServerClientException
appId - PowerAuth 2.0 application app ID.batch - Push message batch to be sent.PushServerClientException - In case of network, response / JSON processing, or other IO error.public io.getlime.core.rest.model.base.response.ObjectResponse<CreateCampaignResponse> createCampaign(Long appId, PushMessageBody message) throws PushServerClientException
appId - Application ID.message - Message which attributes are defined in PushMessageBody.PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean deleteCampaign(Long campaignId) throws PushServerClientException
campaignId - Campaign ID.PushServerClientException - In case of network, response / JSON processing, or other IO error.public io.getlime.core.rest.model.base.response.ObjectResponse<ListOfCampaignsResponse> getListOfCampaigns(boolean all) throws PushServerClientException
all - true to get whole list, false to get campaigns that are only sentPushServerClientException - In case of network, response / JSON processing, or other IO error.public io.getlime.core.rest.model.base.response.ObjectResponse<CampaignResponse> getCampaign(Long campaignId) throws PushServerClientException
campaignId - ID of campaign to get.PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean addUsersToCampaign(Long campaignId, List<String> users) throws PushServerClientException
campaignId - Identifier of campaign.users - List of users to add.PushServerClientException - In case of network, response / JSON processing, or other IO error.public PagedResponse<ListOfUsersFromCampaignResponse> getListOfUsersFromCampaign(Long campaignId, int page, int size) throws PushServerClientException
campaignId - Identifier of campaign.page - Page number.size - Size of elements per page.PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean deleteUsersFromCampaign(Long campaignId, List<String> users) throws PushServerClientException
campaignId - Identifier of campaign.users - List of users' Identifiers to delete.PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean sendTestCampaign(Long campaignId, String userId) throws PushServerClientException
campaignId - Identifier of campaign.userId - Identifier of test user.PushServerClientException - In case of network, response / JSON processing, or other IO error.public boolean sendCampaign(Long campaignId) throws PushServerClientException
campaignId - Identifier of campaign.PushServerClientException - In case of network, response / JSON processing, or other IO error.public io.getlime.core.rest.model.base.response.ObjectResponse<GetApplicationListResponse> getApplicationList() throws PushServerClientException
PushServerClientException - Thrown when communication with Push Server fails.public io.getlime.core.rest.model.base.response.ObjectResponse<GetApplicationListResponse> getUnconfiguredApplicationList() throws PushServerClientException
PushServerClientException - Thrown when communication with Push Server fails.public io.getlime.core.rest.model.base.response.ObjectResponse<GetApplicationDetailResponse> getApplicationDetail(Long id, boolean includeIos, boolean includeAndroid) throws PushServerClientException
id - Application credentials entity ID.includeIos - Whether to include iOS details.includeAndroid - Whether to include Android details.PushServerClientException - Thrown when communication with Push Server fails.public io.getlime.core.rest.model.base.response.ObjectResponse<CreateApplicationResponse> createApplication(Long appId) throws PushServerClientException
appId - PowerAuth application ID.PushServerClientException - Thrown when communication with Push Server fails.public io.getlime.core.rest.model.base.response.Response updateIos(Long id, String bundle, String keyId, String teamId, byte[] privateKey) throws PushServerClientException
id - ID of application credentials entity.bundle - The iOS bundle record.keyId - The iOS key record.teamId - The iOS team ID record.privateKey - The iOS private key bytes.PushServerClientException - Thrown when communication with Push Server fails.public io.getlime.core.rest.model.base.response.Response removeIos(Long id) throws PushServerClientException
id - Application credentials entity ID.PushServerClientException - Thrown when communication with Push Server fails.public io.getlime.core.rest.model.base.response.Response updateAndroid(Long id, String projectId, byte[] privateKey) throws PushServerClientException
id - Application credentials entity ID.projectId - The Android project ID record.privateKey - The Android private key bytes.PushServerClientException - Thrown when communication with Push Server fails.public io.getlime.core.rest.model.base.response.Response removeAndroid(Long id) throws PushServerClientException
id - Application credentials entity ID.PushServerClientException - Thrown when communication with Push Server fails.Copyright © 2016–2019 Wultra s.r.o.. All rights reserved.