Class SubDataProtocol

java.lang.Object
net.ME1312.SubData.Server.DataProtocol
net.ME1312.SubData.Server.SubDataProtocol

public class SubDataProtocol extends DataProtocol
SubData Protocol Class
  • Field Details

  • Constructor Details

    • SubDataProtocol

      public SubDataProtocol()
      Create a new Protocol
  • Method Details

    • open

      public SubDataServer open(Consumer<Runnable> scheduler, Logger logger, InetAddress address, int port, String cipher) throws IOException
      SubData Server Instance
      Parameters:
      scheduler - Event Scheduler
      logger - Network Logger
      address - Bind Address (or null for all)
      port - Port Number
      cipher - Cipher (or null for none)
      Throws:
      IOException
    • open

      public SubDataServer open(Logger logger, InetAddress address, int port, String cipher) throws IOException
      SubData Server Instance
      Parameters:
      logger - Network Logger
      address - Bind Address (or null for all)
      port - Port Number
      cipher - Cipher (or null for none)
      Throws:
      IOException
    • setName

      public void setName(String name)
      Set the Network Protocol Name (may only be called once)
      Parameters:
      name - Protocol Name
    • getName

      public String getName()
      Description copied from class: DataProtocol
      Get the Network Protocol Name
      Specified by:
      getName in class DataProtocol
      Returns:
      Protocol Name
    • setVersion

      public void setVersion(Version version)
      Set the Network Protocol Version (may only be called once)
      Parameters:
      version - Protocol Version
    • getVersion

      public Version getVersion()
      Description copied from class: DataProtocol
      Get the Network Protocol Version
      Specified by:
      getVersion in class DataProtocol
      Returns:
      Protocol Version
    • setAuthService

      public void setAuthService(AuthService<?> service)
      Set the Network Protocol Authorization Service (may only be called once)
      Parameters:
      service - Protocol Authorization Service
    • getAuthService

      public AuthService<?> getAuthService()
      Get the Network Protocol Authorization Service
      Returns:
      Protocol Authorization Service
    • registerCipher

      public void registerCipher(String handle, Cipher cipher)
      Register a Cipher to SubData
      Parameters:
      cipher - Cipher to Add
      handle - Handle to Bind
    • unregisterCipher

      public void unregisterCipher(String handle)
      Unregister a Cipher from SubData
      Parameters:
      handle - Handle
    • getBlockSize

      public int getBlockSize()
      Get SubData's Block Size
      Returns:
      Block Size
    • setBlockSize

      public void setBlockSize(int size)
      Set SubData's Block Size
      Parameters:
      size - Block Size
    • getTimeout

      public long getTimeout()
      Get SubData's Initialization Timer
      Returns:
      Timeout Time
    • setTimeout

      public void setTimeout(long time)
      Set SubData's Initialization Timer
      Parameters:
      time - Timeout Time
    • registerPacket

      public void registerPacket(int id, PacketIn packet)
      Register PacketIn to the Network
      Parameters:
      id - Packet ID (as an unsigned 16-bit value)
      packet - PacketIn to register
    • unregisterPacket

      public void unregisterPacket(PacketIn packet)
      Unregister PacketIn from the Network
      Parameters:
      packet - PacketIn to unregister
    • registerPacket

      public void registerPacket(int id, Class<? extends PacketOut> packet)
      Register PacketOut to the Network
      Parameters:
      id - Packet ID (as an unsigned 16-bit value)
      packet - PacketOut to register
    • unregisterPacket

      public void unregisterPacket(Class<? extends PacketOut> packet)
      Unregister PacketOut to the Network
      Parameters:
      packet - PacketOut to unregister
    • getPacket

      public PacketIn getPacket(int id)
      Grab PacketIn Instance via ID
      Parameters:
      id - Packet ID (as an unsigned 16-bit value)
      Returns:
      PacketIn