org.gudy.azureus2.plugins.messaging.bittorrent
Class BTMessageManager

java.lang.Object
  extended by org.gudy.azureus2.plugins.messaging.bittorrent.BTMessageManager

public class BTMessageManager
extends Object


Field Summary
static String ID_BTMESSAGE_CANCEL
           
static String ID_BTMESSAGE_PIECE
           
static String ID_BTMESSAGE_REQUEST
           
static String ID_BTMESSAGE_UNCHOKE
           
 
Constructor Summary
BTMessageManager()
           
 
Method Summary
static Message createCoreBTCancel(int piece_number, int piece_offset, int length)
          Create a core BT Cancel message instance.
static BTMessageCancel createCoreBTCancelAdaptation(Message core_made_message)
          Translate the given core-made BT Cancel message into a specific plugin message adaptation.
static Message createCoreBTPiece(int piece_number, int piece_offset, ByteBuffer data)
          Create a core BT Piece message instance.
static BTMessagePiece createCoreBTPieceAdaptation(Message core_made_message)
          Translate the given core-made BT Piece message into a specific plugin message adaptation.
static Message createCoreBTRequest(int piece_number, int piece_offset, int length)
          Create a core BT Request message instance.
static BTMessageRequest createCoreBTRequestAdaptation(Message core_made_message)
          Translate the given core-made BT Request message into a specific plugin message adaptation.
static MessageAdapter wrapCoreMessage(BTMessage core_msg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID_BTMESSAGE_REQUEST

public static final String ID_BTMESSAGE_REQUEST
See Also:
Constant Field Values

ID_BTMESSAGE_CANCEL

public static final String ID_BTMESSAGE_CANCEL
See Also:
Constant Field Values

ID_BTMESSAGE_PIECE

public static final String ID_BTMESSAGE_PIECE
See Also:
Constant Field Values

ID_BTMESSAGE_UNCHOKE

public static final String ID_BTMESSAGE_UNCHOKE
See Also:
Constant Field Values
Constructor Detail

BTMessageManager

public BTMessageManager()
Method Detail

createCoreBTRequestAdaptation

public static BTMessageRequest createCoreBTRequestAdaptation(Message core_made_message)
Translate the given core-made BT Request message into a specific plugin message adaptation.

Parameters:
core_made_message - to translate
Returns:
adapted plugin message

createCoreBTCancelAdaptation

public static BTMessageCancel createCoreBTCancelAdaptation(Message core_made_message)
Translate the given core-made BT Cancel message into a specific plugin message adaptation.

Parameters:
core_made_message - to translate
Returns:
adapted plugin message

createCoreBTPieceAdaptation

public static BTMessagePiece createCoreBTPieceAdaptation(Message core_made_message)
Translate the given core-made BT Piece message into a specific plugin message adaptation.

Parameters:
core_made_message - to translate
Returns:
adapted plugin message

wrapCoreMessage

public static MessageAdapter wrapCoreMessage(BTMessage core_msg)

createCoreBTRequest

public static Message createCoreBTRequest(int piece_number,
                                          int piece_offset,
                                          int length)
Create a core BT Request message instance.

Parameters:
piece_number -
piece_offset -
length -
Returns:
core message wrapped in an adapter

createCoreBTCancel

public static Message createCoreBTCancel(int piece_number,
                                         int piece_offset,
                                         int length)
Create a core BT Cancel message instance.

Parameters:
piece_number -
piece_offset -
length -
Returns:
core message wrapped in an adapter

createCoreBTPiece

public static Message createCoreBTPiece(int piece_number,
                                        int piece_offset,
                                        ByteBuffer data)
Create a core BT Piece message instance.

Parameters:
piece_number -
piece_offset -
data -
Returns:
core message wrapped in an adapter