FileDocCategorySizeDatePackage
RawMessageImpl.javaAPI DocAzureus 3.0.3.44057Sun Mar 04 21:08:16 GMT 2007com.aelitis.azureus.core.networkmanager.impl

RawMessageImpl

public class RawMessageImpl extends Object implements com.aelitis.azureus.core.networkmanager.RawMessage
Basic raw message implementation used internally for Message-->RawMessage conversions.

Fields Summary
private final com.aelitis.azureus.core.peermanager.messaging.Message
message
private final org.gudy.azureus2.core3.util.DirectByteBuffer[]
payload
private final int
priority
private final boolean
is_no_delay
private final com.aelitis.azureus.core.peermanager.messaging.Message[]
to_remove
Constructors Summary
public RawMessageImpl(com.aelitis.azureus.core.peermanager.messaging.Message source, org.gudy.azureus2.core3.util.DirectByteBuffer[] raw_payload, int _priority, boolean _is_no_delay, com.aelitis.azureus.core.peermanager.messaging.Message[] _to_remove)
Create a new raw message using the given parameters.

param
source original message
param
raw_payload headers + original message data
param
priority in queue
param
is_no_delay is an urgent message
param
to_remove message types to auto-remove upon queue

    this.message = source;
    this.payload = raw_payload;
    this.priority = _priority;
    this.is_no_delay = _is_no_delay;
    this.to_remove = _to_remove;
  
Methods Summary
public com.aelitis.azureus.core.peermanager.messaging.Messagedeserialize(org.gudy.azureus2.core3.util.DirectByteBuffer data, byte version)

    return message.deserialize( data, version );
  
public voiddestroy()

    //NOTE: Assumes that the raw payload is made up of the original
    //      message data buffers plus some header data, so returning
    //      the raw buffers will therefore also take care of the data
    //      buffers return.
    for( int i=0; i < payload.length; i++ ) {
      payload[i].returnToPool();
    }
  
public com.aelitis.azureus.core.peermanager.messaging.MessagegetBaseMessage()

  return message;  
public org.gudy.azureus2.core3.util.DirectByteBuffer[]getData()

  return message.getData();  
public java.lang.StringgetDescription()

  return message.getDescription();  
public java.lang.StringgetFeatureID()

  return message.getFeatureID();  
public intgetFeatureSubID()

  return message.getFeatureSubID();  
public java.lang.StringgetID()

  return message.getID();  
public byte[]getIDBytes()

  return message.getIDBytes();  
public intgetPriority()

  return priority;  
public org.gudy.azureus2.core3.util.DirectByteBuffer[]getRawData()

  return payload;  
public intgetType()

  return message.getType();  
public bytegetVersion()

 return message.getVersion(); 
public booleanisNoDelay()

  return is_no_delay;  
public com.aelitis.azureus.core.peermanager.messaging.Message[]messagesToRemove()

  return to_remove;