Class FileQueryRequestEvent

java.lang.Object
eu.cloudnetservice.driver.event.Event
eu.cloudnetservice.driver.network.chunk.event.FileQueryRequestEvent

public final class FileQueryRequestEvent extends Event
An event called when a request for a chunked file transmission is received to determine the handler for the chunked transmission. If no handler gets set by the register event listeners, the request gets rejected.
Since:
4.0
  • Field Details

  • Constructor Details

    • FileQueryRequestEvent

      public FileQueryRequestEvent(@NonNull @NonNull String dataId, @NonNull @NonNull DataBuf requestData)
      Constructs a new file query request event.
      Parameters:
      dataId - the id of the data that is requested by the remote.
      requestData - the full request data, possibly containing further information about the requested data.
      Throws:
      NullPointerException - if the given data id or request data is null.
  • Method Details

    • dataId

      @NonNull public @NonNull String dataId()
      Get the id of the requested data.
      Returns:
      the id of the requested data.
    • requestData

      @NonNull public @NonNull DataBuf requestData()
      Get the full request content, possibly containing further information about the requested data.
      Returns:
      the full request content.
    • responseHandler

      @Nullable public ChunkedPacketSender.Builder responseHandler()
      Get the response handler builder that is responsible for responding with the requested data. Can be null if no event listener set a response handler yet.
      Returns:
      the response handler builder that is responsible for responding with the requested data.
    • responseHandler

      public void responseHandler(@Nullable ChunkedPacketSender.Builder responseHandler)
      Sets the response handler to use for the request.
      Parameters:
      responseHandler - the response handler to use for the request.