Class FileQueryChannelMessageListener

java.lang.Object
eu.cloudnetservice.driver.network.chunk.event.FileQueryChannelMessageListener

public final class FileQueryChannelMessageListener extends Object
A listener for channel messages that request a query transfer of a file.
Since:
4.0
  • Field Details

  • Constructor Details

    • FileQueryChannelMessageListener

      @Inject public FileQueryChannelMessageListener(@NonNull @NonNull EventManager eventManager)
      Constructs a new query channel message listener instance.
      Parameters:
      eventManager - the event handler to use for posting request events.
      Throws:
      NullPointerException - if the given event manager is null.
  • Method Details

    • constructRequestResponse

      @NonNull private static @NonNull DataBuf constructRequestResponse(boolean transferStarted)
      Constructs the response data for a request. The information contains the single information if the transfer started.
      Parameters:
      transferStarted - true if a handler was found and the transfer was started, false otherwise.
      Returns:
      the response data for the remote network component.
    • handleFileQueryRequest

      @EventListener public void handleFileQueryRequest(@NonNull @NonNull ChannelMessageReceiveEvent event)
      Handles chunked file query requests that come in via channel message.
      Parameters:
      event - the channel message receive event for any channel message.
      Throws:
      NullPointerException - if the given event is null.