Atavism Version 2018.1AGIS API

atavism.server.events
Class FragmentedMessage

java.lang.Object
  extended by atavism.server.engine.Event
      extended by atavism.server.events.FragmentedMessage
All Implemented Interfaces:
EventParser

public class FragmentedMessage
extends Event

fragmented message sometimes the an event is split up into seperate subevents, stored in this fragmentedmessage. this is done because large packets may be dropped by network routers


Field Summary
 byte[] data
           
protected static Logger log
           
 
Constructor Summary
FragmentedMessage()
           
FragmentedMessage(AOByteBuffer buf, ClientConnection con)
           
FragmentedMessage(byte[] data, int start, int end, int msgId, int seqNum)
          start starts with 0 index is its relative pos in the list of fragmented messages which make up the whole message (starting with 0)
 
Method Summary
static java.util.List<FragmentedMessage> fragment(AOByteBuffer byteBuf, int maxBytes)
           
static java.util.List<FragmentedMessage> fragment(byte[] buf, int maxBytes)
          fragments the event - each fragment should not exceed more than maxBytes of DATA (does not care about networking headers
static int fragmentCount(int bufLen, int maxBytes)
          provide an entry point that returns the count of fragments for a message, so we can know ahead of time if adding the fragments will exceed the number of unacked packets.
 java.lang.String getName()
           
static int getNextId()
           
static void main(java.lang.String[] args)
           
 void parseBytes(AOByteBuffer buf)
          load this event from the passed in buffer called by the constructor
 AOByteBuffer toBytes()
           
 java.lang.String toString()
           
 
Methods inherited from class atavism.server.engine.Event
getBuffer, getConnection, getEnqueueTime, getObjectOid, setBuffer, setConnection, setEnqueueTime, setEntity, setObject, setObjectOid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

public byte[] data

log

protected static final Logger log
Constructor Detail

FragmentedMessage

public FragmentedMessage()

FragmentedMessage

public FragmentedMessage(AOByteBuffer buf,
                         ClientConnection con)

FragmentedMessage

public FragmentedMessage(byte[] data,
                         int start,
                         int end,
                         int msgId,
                         int seqNum)
start starts with 0 index is its relative pos in the list of fragmented messages which make up the whole message (starting with 0)

Method Detail

getName

public java.lang.String getName()
Specified by:
getName in class Event

toString

public java.lang.String toString()
Overrides:
toString in class Event

fragmentCount

public static int fragmentCount(int bufLen,
                                int maxBytes)
provide an entry point that returns the count of fragments for a message, so we can know ahead of time if adding the fragments will exceed the number of unacked packets.


fragment

public static java.util.List<FragmentedMessage> fragment(AOByteBuffer byteBuf,
                                                         int maxBytes)

fragment

public static java.util.List<FragmentedMessage> fragment(byte[] buf,
                                                         int maxBytes)
fragments the event - each fragment should not exceed more than maxBytes of DATA (does not care about networking headers


parseBytes

public void parseBytes(AOByteBuffer buf)
Description copied from class: Event
load this event from the passed in buffer called by the constructor

Specified by:
parseBytes in interface EventParser
Specified by:
parseBytes in class Event

toBytes

public AOByteBuffer toBytes()
Specified by:
toBytes in class Event

getNextId

public static int getNextId()

main

public static void main(java.lang.String[] args)


Copyright © 2018 Dragonsan Studios Sp. z o.o.