LimeWire Consolidated API

org.limewire.net.address
Interface AddressSerializer

All Known Implementing Classes:
ConnectableSerializer, FirewalledAddressSerializer, PushEndpointSerializer, XMPPAddressSerializer

public interface AddressSerializer

Used to (de)serialize Addresses over a network connection


Method Summary
 Address deserialize(byte[] serializedAddress)
          deserialize a byte [] representation of an Address, typically as read from a network message, into an Address.
 Address deserialize(String address)
          Turns a user-input String into an Address
 Class<? extends Address> getAddressClass()
           
 String getAddressType()
           
 void register(AddressFactory factory)
          Register this AddressSerializer with an AddressFactory
 byte[] serialize(Address address)
          serialize an Address into a byte [], typically to include in a network message
 

Method Detail

register

@Inject
void register(AddressFactory factory)
Register this AddressSerializer with an AddressFactory

Parameters:
factory -

getAddressType

String getAddressType()
Returns:
a non-null String representing a human readable short description of the kind of Address this serializer handles.

getAddressClass

Class<? extends Address> getAddressClass()
Returns:
The Address class that this serializer handles

deserialize

Address deserialize(byte[] serializedAddress)
                    throws IOException
deserialize a byte [] representation of an Address, typically as read from a network message, into an Address.

Parameters:
serializedAddress -
Returns:
a non-null Address
Throws:
IOException - if the input cannot be deserialized into an Address

serialize

byte[] serialize(Address address)
                 throws IOException
serialize an Address into a byte [], typically to include in a network message

Parameters:
address - a non-null address
Returns:
a non-null byte []
Throws:
IOException - if an error occurs serializing the Address

deserialize

Address deserialize(String address)
                    throws IOException
Turns a user-input String into an Address

Parameters:
address -
Returns:
an address representing the String parameter; never null
Throws:
IOException - if the input cannot be converted into an Address

LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.