Class PreRequestEvent
java.lang.Object
de.craftsblock.craftscore.event.Event
de.craftsblock.craftscore.event.CancellableEvent
de.craftsblock.craftsnet.events.requests.PreRequestEvent
- All Implemented Interfaces:
de.craftsblock.craftscore.event.Cancellable,GenericRequestEventBase
public class PreRequestEvent
extends de.craftsblock.craftscore.event.CancellableEvent
implements GenericRequestEventBase
This event is triggered before a http request is processed as route or share.
It allows for pre-processing of the request, including the ability to cancel it before it is handled.
The event holds an
Exchange object that contains the details of the request.
By extending CancellableEvent, this event can be cancelled, stopping further processing.- Since:
- 3.1.0-SNAPSHOT
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPreRequestEvent(Exchange exchange) Constructs a newPreRequestEventwith the providedExchangeobject. -
Method Summary
Methods inherited from class de.craftsblock.craftscore.event.CancellableEvent
isCancelled, setCancelledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.craftsblock.craftsnet.events.requests.GenericRequestEventBase
getRequest, getResponse
-
Constructor Details
-
Method Details
-
getExchange
Gets theExchangewhich stores the involved request, response and some other data.- Specified by:
getExchangein interfaceGenericRequestEventBase- Returns:
- The
Exchange.
-