Class PostRequestEvent

java.lang.Object
de.craftsblock.craftscore.event.Event
de.craftsblock.craftsnet.events.requests.PostRequestEvent
All Implemented Interfaces:
GenericRequestEventBase

public class PostRequestEvent extends de.craftsblock.craftscore.event.Event implements GenericRequestEventBase
This event is triggered after an HTTP request has been processed. It contains information about the request, whether the requested resource was found, and whether the resource was shared.
Since:
3.1.0-SNAPSHOT
See Also:
  • Constructor Details

    • PostRequestEvent

      public PostRequestEvent(Exchange exchange, boolean found, boolean shared)
      Constructs a new PostRequestEvent.
      Parameters:
      exchange - The Exchange object containing the details of the HTTP request and response.
      found - A boolean flag indicating whether the requested resource was found.
      shared - A boolean flag indicating whether the resource was shared successfully.
  • Method Details

    • getExchange

      @NotNull public @NotNull Exchange getExchange()
      Gets the Exchange which stores the involved request, response and some other data.
      Specified by:
      getExchange in interface GenericRequestEventBase
      Returns:
      The Exchange.
    • wasFound

      public boolean wasFound()
      Checks whether the requested resource was found.
      Returns:
      true if the resource was found, false otherwise.
    • wasShared

      public boolean wasShared()
      Checks whether the requested resource was shared successfully. This method returns true only if the resource was found and shared.
      Returns:
      true if the resource was found and shared, false otherwise.