Interface FastMetaApi<T,​R extends RemoteApi>

  • Type Parameters:
    T - The type of the local API interface.
    R - The type of the remote API interface (proxy).

    public interface FastMetaApi<T,​R extends RemoteApi>
    Interface defining the metadata and factory methods for a specific API pair (Local/Remote).
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isValidCommand​(int commandId)
      Validates whether the specified command ID exists in this API.
      void makeLocal​(MetaContext ctx, io.aether.utils.dataio.DataIn in)
      Reads binary data from DataIn and deserializes it into method calls on the provided localApi implementation.
      R makeRemote​(MetaContext ctx)
      Creates an implementation (proxy) of the remote interface R.
    • Method Detail

      • makeRemote

        R makeRemote​(MetaContext ctx)
        Creates an implementation (proxy) of the remote interface R.

        Method calls performed on this implementation result in data serialization and writing to the provided context ctx.

        Parameters:
        ctx - The context used for serialization and network transmission.
        Returns:
        The remote API implementation.
      • makeLocal

        void makeLocal​(MetaContext ctx,
                       io.aether.utils.dataio.DataIn in)
        Reads binary data from DataIn and deserializes it into method calls on the provided localApi implementation.
        Parameters:
        ctx - The context used for deserialization and future management.
        in - The input stream containing binary command data.
      • isValidCommand

        boolean isValidCommand​(int commandId)
        Validates whether the specified command ID exists in this API.

        This is used for early filtering of incoming connections or packets to reject invalid commands before resource-intensive deserialization occurs.

        Parameters:
        commandId - The command identifier (typically the first byte of the packet).
        Returns:
        true if the command is supported, false otherwise.