org.whispersystems.signalservice.internal.push.UnsupportedDataMessageException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of signal-service-java Show documentation
Show all versions of signal-service-java Show documentation
Signal Service communication library for Java
The newest version!
package org.whispersystems.signalservice.internal.push;
import org.whispersystems.libsignal.util.guava.Optional;
import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage;
import org.whispersystems.signalservice.api.messages.SignalServiceGroup;
/**
* Exception that indicates that the data message has a higher required protocol version than the
* current client is capable of interpreting.
*/
public class UnsupportedDataMessageException extends Exception {
private final int requiredVersion;
private final String sender;
private final int senderDevice;
private final Optional group;
public UnsupportedDataMessageException(int currentVersion,
int requiredVersion,
String sender,
int senderDevice,
Optional group)
{
super("Required version: " + requiredVersion + ", Our version: " + currentVersion);
this.requiredVersion = requiredVersion;
this.sender = sender;
this.senderDevice = senderDevice;
this.group = group;
}
public int getRequiredVersion() {
return requiredVersion;
}
public String getSender() {
return sender;
}
public int getSenderDevice() {
return senderDevice;
}
public Optional getGroup() {
return group;
}
}