public class RegistrationStateChangeEvent
extends java.beans.PropertyChangeEvent
Keep in mind that reasons are not localized and services such as the user interface should only show them in a "details box". In the rest of the time, such services should consult the error code and provide corresponding, localized, reason phrases.
Note, that we have tried to provide a maximum number of error codes in order to enumerate all possible reason codes that may be returned from servers in the various protocols. Each protocol would only return a subset of these.
Modifier and Type | Field and Description |
---|---|
static int |
REASON_AUTHENTICATION_FAILED
Indicates that the server has refused registration due to a problem with
the authentication (most probably a wrong password).
|
static int |
REASON_CLIENT_LIMIT_REACHED_FOR_IP
Indicates that we have too many existing registrations from the local
IP address and the server won't allow us to open any more of them.
|
static int |
REASON_INTERNAL_ERROR
Indicates that an internal application error has occurred and it resulted
in the state transition indicated by this event.
|
static int |
REASON_MULTIPLE_LOGINS
Indicates that the same user identifier has logged somewhere else.
|
static int |
REASON_NON_EXISTING_USER_ID
Indicates that the server does not recognize the used identifier that
we tried to register with.
|
static int |
REASON_NOT_SPECIFIED
Indicates that no reason is specified for this event transition.
|
static int |
REASON_RECONNECTION_RATE_LIMIT_EXCEEDED
Indicates that we have been disconnecting and reconnecting to the server
at a rate that ha become too fast.
|
static int |
REASON_SERVER_NOT_FOUND
Indicates that the specified server was not found (i.e.
|
static int |
REASON_SERVER_RETURNED_ERRONEOUS_INPUT
Indicates that the specified server returned an error input.
|
static int |
REASON_TLS_REQUIRED
Indicates that the specified server does not support TLS and the has
required TLS use.
|
static int |
REASON_USER_REQUEST
Indicates that the change in the registration state that has just
occurred has been requested by the user.
|
Constructor and Description |
---|
RegistrationStateChangeEvent(ProtocolProviderService source,
RegistrationState oldValue,
RegistrationState newValue,
int reasonCode,
java.lang.String reason)
Creates an event instance indicating a change of the provider state
from oldValue to newValue.
|
Modifier and Type | Method and Description |
---|---|
RegistrationState |
getNewState()
Returns the status of the provider after this event took place.
|
RegistrationState |
getOldState()
Returns the status of the provider before this event took place.
|
ProtocolProviderService |
getProvider()
Returns the provider that has generated this event
|
java.lang.String |
getReason()
Returns a (non localized) String containing information further
explaining the reason code, or null if no particular reason has been
specified.
|
int |
getReasonCode()
One of the REASON_XXX fields, indicating the reason code returned by the
server in order to explain the state transition.
|
boolean |
isUserRequest()
Whether this event is after user request.
|
void |
setUserRequest(boolean userRequest)
Changes the event to indicate that is created after use request.
|
java.lang.String |
toString()
Returns a string representation of this event.
|
public static final int REASON_NOT_SPECIFIED
public static final int REASON_USER_REQUEST
public static final int REASON_AUTHENTICATION_FAILED
public static final int REASON_MULTIPLE_LOGINS
public static final int REASON_NON_EXISTING_USER_ID
public static final int REASON_CLIENT_LIMIT_REACHED_FOR_IP
public static final int REASON_RECONNECTION_RATE_LIMIT_EXCEEDED
public static final int REASON_INTERNAL_ERROR
public static final int REASON_SERVER_NOT_FOUND
public static final int REASON_TLS_REQUIRED
public static final int REASON_SERVER_RETURNED_ERRONEOUS_INPUT
public RegistrationStateChangeEvent(ProtocolProviderService source, RegistrationState oldValue, RegistrationState newValue, int reasonCode, java.lang.String reason)
source
- the provider that generated the eventoldValue
- the status the source provider was in before entering
the new state.newValue
- the status the source provider is currently in.reasonCode
- a value corresponding to one of the REASON_XXX fields
of this class, indicating the reason for this state transition.reason
- a String further explaining the reason code or null if
no such explanation is necessary.public ProtocolProviderService getProvider()
public RegistrationState getOldState()
public RegistrationState getNewState()
public java.lang.String toString()
toString
in class java.beans.PropertyChangeEvent
public int getReasonCode()
public java.lang.String getReason()
public boolean isUserRequest()
public void setUserRequest(boolean userRequest)
userRequest
-
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.