Class PacketRejectedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.jivesoftware.openfire.interceptor.PacketRejectedException
- All Implemented Interfaces:
Serializable
Thrown by a PacketInterceptor when a stanza is prevented from being processed.
If the stanza was received then it will not be processed. For IQ and Presence stanzas, an error will be sent back to
the sender. When the PacketRejectedException contains a rejection message, a Message stanza will be sent back to the
sender (for IQ and Presence stanzas, this is sent in addition to the IQ or Presence stanza containing the error).
If the stanza was going to be sent then the sending will be aborted.
- Author:
- Gaston Dombiak
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPacketRejectedException
(String msg, Throwable nestedThrowable) PacketRejectedException
(Throwable nestedThrowable) -
Method Summary
Modifier and TypeMethodDescriptionorg.xmpp.packet.PacketError
Gets the error that will be sent to the sender of the inbound stanza that got rejected.Returns the text to include in a message that will be sent to the sender of the packet that got rejected ornull
if none was defined.void
void
void
void
setRejectionError
(org.xmpp.packet.PacketError rejectionError) Adds an error that will be sent to the sender of the inbound stanza that got rejected.void
setRejectionMessage
(String rejectionMessage) Sets the text to include in a message that will be sent to the sender of the packet that got rejected ornull
if no message will be sent to the sender of the rejected packet.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
-
Constructor Details
-
PacketRejectedException
public PacketRejectedException() -
PacketRejectedException
-
PacketRejectedException
-
PacketRejectedException
-
-
Method Details
-
printStackTrace
public void printStackTrace()- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
- Overrides:
printStackTrace
in classThrowable
-
getRejectionMessage
Returns the text to include in a message that will be sent to the sender of the packet that got rejected ornull
if none was defined. If no text was specified then no message will be sent to the sender of the rejected packet.- Returns:
- the text to include in a message that will be sent to the sender of the packet
that got rejected or
null
if none was defined.
-
setRejectionMessage
Sets the text to include in a message that will be sent to the sender of the packet that got rejected ornull
if no message will be sent to the sender of the rejected packet. By default, no message will be sent.- Parameters:
rejectionMessage
- the text to include in the notification message for the rejection.
-
getRejectionError
public org.xmpp.packet.PacketError getRejectionError()Gets the error that will be sent to the sender of the inbound stanza that got rejected. When the rejected stanza was a message, this error is added to a message that is sent (possibly also including the message body as specified bysetRejectionMessage(String)
). When the rejected stanza was an IQ or Presence stanza, then the error is used in the error response. For these stanzas, this is a different stanza than the optional Message stanza that is sent whensetRejectionMessage(String)
) is (also) used.- Returns:
- An optional error to be included in an error response in reaction to the rejection.
-
setRejectionError
public void setRejectionError(org.xmpp.packet.PacketError rejectionError) Adds an error that will be sent to the sender of the inbound stanza that got rejected. When the rejected stanza was a message, this error is added to a message that is sent (possibly also including the message body as specified bysetRejectionMessage(String)
). When the rejected stanza was an IQ or Presence stanza, then the error is used in the error response. For these stanzas, this is a different stanza than the optional Message stanza that is sent whensetRejectionMessage(String)
) is (also) used.- Parameters:
rejectionError
- An optional error.
-