![JAR search and dependency download from the Maven repository](/logo.png)
com.windowsazure.messaging.GcmRegistration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Notification-Hubs-java-sdk Show documentation
Show all versions of Notification-Hubs-java-sdk Show documentation
Azure Notification Hubs Java SDK for interacting with the data and management plane operations.
The newest version!
//----------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------------
package com.windowsazure.messaging;
import java.util.Objects;
/**
* Class representing a native registration for devices using GCM.
*
* @deprecated use {@link com.windowsazure.messaging.FcmV1Registration#FcmV1Registration()} instead.
*/
@Deprecated
public class GcmRegistration extends Registration {
private static final String GCM_NATIVE_REGISTRATION1 = "";
private static final String GCM_NATIVE_REGISTRATION2 = "";
private static final String GCM_NATIVE_REGISTRATION3 = " ";
protected String gcmRegistrationId;
/**
* Creates a new instance of the GcmRegistration class.
*/
public GcmRegistration() {
super();
}
/**
* Creates a new instance of the GcmRegistration class.
* @param registrationId The Azure Notification Hubs registration ID.
* @param gcmRegistrationId The Google Cloud Messaging registration ID.
*/
public GcmRegistration(String registrationId, String gcmRegistrationId) {
super(registrationId);
this.gcmRegistrationId = gcmRegistrationId;
}
/**
* Creates a new instance of the GcmRegistration class.
* @param gcmRegistrationId The Google Cloud Messaging registration ID.
*/
public GcmRegistration(String gcmRegistrationId) {
super();
this.gcmRegistrationId = gcmRegistrationId;
}
/**
* Gets the Google Cloud Messaging registration ID.
* @return The Google Cloud Messaging registration ID.
*/
public String getGcmRegistrationId() { return gcmRegistrationId; }
/**
* Sets the Google Cloud Messaging registration ID.
* @param value The Google Cloud Messaging registration ID to set.
*/
public void setGcmRegistrationId(String value) { gcmRegistrationId = value; }
/**
* Gets the PNS handle for getting devices by channel.
* @return The PNS handle for getting devices by channel.
*/
@Override
public String getPnsHandle() { return gcmRegistrationId; }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
GcmRegistration that = (GcmRegistration) o;
return Objects.equals(getGcmRegistrationId(), that.getGcmRegistrationId());
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), getGcmRegistrationId());
}
@Override
public String getXml() {
return GCM_NATIVE_REGISTRATION1 +
getTagsXml() +
GCM_NATIVE_REGISTRATION2 +
gcmRegistrationId +
GCM_NATIVE_REGISTRATION3;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy