-
- All Implemented Interfaces:
public class AttributeFactoryThis class provides factory methods to allow an application to create STUN / TURN / ICE Attributes from a particular implementation.
-
-
Method Summary
Modifier and Type Method Description static ChangeRequestAttributecreateChangeRequestAttribute()Creates a ChangeRequestAttribute with "false" values for the changeIP and changePort flags. static ChangeRequestAttributecreateChangeRequestAttribute(boolean changeIP, boolean changePort)Creates a ChangeRequestAttribute with the specified flag values. static ChangedAddressAttributecreateChangedAddressAttribute(TransportAddress address)Creates a changedAddressAttribute of the specified type and with the specified address and port static ErrorCodeAttributecreateErrorCodeAttribute(byte errorClass, byte errorNumber)Creates an ErrorCodeAttribute with the specified error class and number and a default reason phrase. static ErrorCodeAttributecreateErrorCodeAttribute(byte errorClass, byte errorNumber, String reasonPhrase)Creates an ErrorCodeAttribute with the specified error class, number and reason phrase. static ErrorCodeAttributecreateErrorCodeAttribute(char errorCode)Creates an ErrorCodeAttribute with the specified error code and a default reason phrase. static ErrorCodeAttributecreateErrorCodeAttribute(char errorCode, String reasonPhrase)Creates an ErrorCodeAttribute with the specified error code and reason phrase. static MappedAddressAttributecreateMappedAddressAttribute(TransportAddress address)Creates a MappedAddressAttribute of the specified type and with the specified address and port static ReflectedFromAttributecreateReflectedFromAttribute(TransportAddress address)Creates a ReflectedFromAddressAttribute of the specified type and with the specified address and port static ResponseAddressAttributecreateResponseAddressAttribute(TransportAddress address)Creates a ResponseFromAddressAttribute of the specified type and with the specified address and port static SourceAddressAttributecreateSourceAddressAttribute(TransportAddress address)Creates a SourceFromAddressAttribute of the specified type and with the specified address and port static UnknownAttributesAttributecreateUnknownAttributesAttribute()Creates an empty UnknownAttributesAttribute. static XorRelayedAddressAttributecreateXorRelayedAddressAttribute(TransportAddress address, Array<byte> tranID)Creates a XorRelayedAddressAttribute of the specified type and with the specified address and port. static XorPeerAddressAttributecreateXorPeerAddressAttribute(TransportAddress address, Array<byte> tranID)Creates a XorPeerAddressAttribute of the specified type and with the specified address and port static XorMappedAddressAttributecreateXorMappedAddressAttribute(TransportAddress address, Array<byte> tranID)Creates a XorMappedAddressAttribute for the specified address. static UsernameAttributecreateUsernameAttribute(Array<byte> username)Create a UsernameAttribute. static UsernameAttributecreateUsernameAttribute(String username)Creates a new UsernameAttribute instance. static MessageIntegrityAttributecreateMessageIntegrityAttribute(String username)Creates an empty MessageIntegrityAttribute. static FingerprintAttributecreateFingerprintAttribute()Creates an empty FingerprintAttribute with a 0 check sum. static ChannelNumberAttributecreateChannelNumberAttribute(char channelNumber)Create a ChannelNumberAttribute. static RealmAttributecreateRealmAttribute(Array<byte> realm)Create a RealmAttribute. static NonceAttributecreateNonceAttribute(Array<byte> nonce)Create a NonceAttribute. static SoftwareAttributecreateSoftwareAttribute(Array<byte> software)Create a SoftwareAttribute. static EvenPortAttributecreateEvenPortAttribute(boolean rFlag)Create a EventAttribute. static LifetimeAttributecreateLifetimeAttribute(int lifetime)Create a LifetimeAttribute. static RequestedTransportAttributecreateRequestedTransportAttribute(byte protocol)Create a RequestedTransportAttribute. static ReservationTokenAttributecreateReservationTokenAttribute(Array<byte> token)Create a ReservationTokenAttribute. static DataAttributecreateDataAttribute(Array<byte> data)Create a DataAtttribute. static DataAttributecreateDataAttributeWithoutPadding(Array<byte> data)Create a DataAtttribute. static IceControlledAttributecreateIceControlledAttribute(long tieBreaker)Creates an IceControlledAttribute object with the specified tie-breaker value static PriorityAttributecreatePriorityAttribute(long priority)Creates a Priority attribute with the specified priority value static UseCandidateAttributecreateUseCandidateAttribute()Creates a UseCandidateAttribute static IceControllingAttributecreateIceControllingAttribute(long tieBreaker)Creates an IceControllingAttribute with the specified tie-breaker value static MagicCookieAttributecreateMagicCookieAttribute()Creates a MagicCookieAttribute. static DestinationAddressAttributecreateDestinationAddressAttribute(TransportAddress address)Creates a DestinationFromAddressAttribute of the specified type and with the specified address and port static RequestedAddressFamilyAttributecreateRequestedAddressFamilyAttribute(char family)Creates a new RequestedAddressFamilyAttribute of the specified family static ConnectionIdAttributecreateConnectionIdAttribute(int connectionIdValue)Creates a new ConnectionIdAttribute of the specified connectionIdValue static ConnectionIdAttributecreateConnectionIdAttribute()Creates a new ConnectionIdAttribute. -
-
Method Detail
-
createChangeRequestAttribute
static ChangeRequestAttribute createChangeRequestAttribute()
Creates a ChangeRequestAttribute with "false" values for the changeIP and changePort flags.
-
createChangeRequestAttribute
static ChangeRequestAttribute createChangeRequestAttribute(boolean changeIP, boolean changePort)
Creates a ChangeRequestAttribute with the specified flag values.
- Parameters:
changeIP- the value of the changeIP flag.changePort- the value of the changePort flag.
-
createChangedAddressAttribute
static ChangedAddressAttribute createChangedAddressAttribute(TransportAddress address)
Creates a changedAddressAttribute of the specified type and with the specified address and port
- Parameters:
address- the address value of the address attribute
-
createErrorCodeAttribute
static ErrorCodeAttribute createErrorCodeAttribute(byte errorClass, byte errorNumber)
Creates an ErrorCodeAttribute with the specified error class and number and a default reason phrase.
- Parameters:
errorClass- a valid error class.errorNumber- a valid error number.
-
createErrorCodeAttribute
static ErrorCodeAttribute createErrorCodeAttribute(byte errorClass, byte errorNumber, String reasonPhrase)
Creates an ErrorCodeAttribute with the specified error class, number and reason phrase.
- Parameters:
errorClass- a valid error class.errorNumber- a valid error number.reasonPhrase- a human readable reason phrase.
-
createErrorCodeAttribute
static ErrorCodeAttribute createErrorCodeAttribute(char errorCode)
Creates an ErrorCodeAttribute with the specified error code and a default reason phrase.
- Parameters:
errorCode- a valid error code.
-
createErrorCodeAttribute
static ErrorCodeAttribute createErrorCodeAttribute(char errorCode, String reasonPhrase)
Creates an ErrorCodeAttribute with the specified error code and reason phrase.
- Parameters:
errorCode- a valid error code.reasonPhrase- a human readable reason phrase.
-
createMappedAddressAttribute
static MappedAddressAttribute createMappedAddressAttribute(TransportAddress address)
Creates a MappedAddressAttribute of the specified type and with the specified address and port
- Parameters:
address- the address value of the address attribute
-
createReflectedFromAttribute
static ReflectedFromAttribute createReflectedFromAttribute(TransportAddress address)
Creates a ReflectedFromAddressAttribute of the specified type and with the specified address and port
- Parameters:
address- the address value of the address attribute
-
createResponseAddressAttribute
static ResponseAddressAttribute createResponseAddressAttribute(TransportAddress address)
Creates a ResponseFromAddressAttribute of the specified type and with the specified address and port
- Parameters:
address- the address value of the address attribute
-
createSourceAddressAttribute
static SourceAddressAttribute createSourceAddressAttribute(TransportAddress address)
Creates a SourceFromAddressAttribute of the specified type and with the specified address and port
- Parameters:
address- the address value of the address attribute
-
createUnknownAttributesAttribute
static UnknownAttributesAttribute createUnknownAttributesAttribute()
Creates an empty UnknownAttributesAttribute.
-
createXorRelayedAddressAttribute
static XorRelayedAddressAttribute createXorRelayedAddressAttribute(TransportAddress address, Array<byte> tranID)
Creates a XorRelayedAddressAttribute of the specified type and with the specified address and port.
- Parameters:
address- the address value of the address attributetranID- the ID of the transaction that we will be using for the XOR mask.
-
createXorPeerAddressAttribute
static XorPeerAddressAttribute createXorPeerAddressAttribute(TransportAddress address, Array<byte> tranID)
Creates a XorPeerAddressAttribute of the specified type and with the specified address and port
- Parameters:
address- the address value of the address attributetranID- the ID of the transaction that we will be using for the XOR mask.
-
createXorMappedAddressAttribute
static XorMappedAddressAttribute createXorMappedAddressAttribute(TransportAddress address, Array<byte> tranID)
Creates a XorMappedAddressAttribute for the specified address.
- Parameters:
address- the address value of the address attributetranID- the ID of the transaction that we will be using for the XOR mask.
-
createUsernameAttribute
static UsernameAttribute createUsernameAttribute(Array<byte> username)
Create a UsernameAttribute.
- Parameters:
username- username value
-
createUsernameAttribute
static UsernameAttribute createUsernameAttribute(String username)
Creates a new UsernameAttribute instance.
- Parameters:
username- the String value of the username
-
createMessageIntegrityAttribute
static MessageIntegrityAttribute createMessageIntegrityAttribute(String username)
Creates an empty MessageIntegrityAttribute. When included in a message the stack would set the body of this attribute so that the the HMAC-SHA1 (RFC 2104) would correspond to the actual message that's transporting the attribute.
- Parameters:
username- the username that we should use to obtain an encryption key (password) that the encode method should use when creating the content of this message.
-
createFingerprintAttribute
static FingerprintAttribute createFingerprintAttribute()
Creates an empty FingerprintAttribute with a 0 check sum. Once included in a message, the value of this attribute will be calculated by the stack just before sending it.
-
createChannelNumberAttribute
static ChannelNumberAttribute createChannelNumberAttribute(char channelNumber)
Create a ChannelNumberAttribute.
- Parameters:
channelNumber- channel number
-
createRealmAttribute
static RealmAttribute createRealmAttribute(Array<byte> realm)
Create a RealmAttribute.
- Parameters:
realm- realm value
-
createNonceAttribute
static NonceAttribute createNonceAttribute(Array<byte> nonce)
Create a NonceAttribute.
- Parameters:
nonce- nonce value
-
createSoftwareAttribute
static SoftwareAttribute createSoftwareAttribute(Array<byte> software)
Create a SoftwareAttribute.
- Parameters:
software- software value
-
createEvenPortAttribute
static EvenPortAttribute createEvenPortAttribute(boolean rFlag)
Create a EventAttribute.
- Parameters:
rFlag- R flag
-
createLifetimeAttribute
static LifetimeAttribute createLifetimeAttribute(int lifetime)
Create a LifetimeAttribute.
- Parameters:
lifetime- lifetime value
-
createRequestedTransportAttribute
static RequestedTransportAttribute createRequestedTransportAttribute(byte protocol)
Create a RequestedTransportAttribute.
- Parameters:
protocol- transport protocol requested
-
createReservationTokenAttribute
static ReservationTokenAttribute createReservationTokenAttribute(Array<byte> token)
Create a ReservationTokenAttribute.
- Parameters:
token- the token
-
createDataAttribute
static DataAttribute createDataAttribute(Array<byte> data)
Create a DataAtttribute.
- Parameters:
data- the data
-
createDataAttributeWithoutPadding
static DataAttribute createDataAttributeWithoutPadding(Array<byte> data)
Create a DataAtttribute.
- Parameters:
data- the data
-
createIceControlledAttribute
static IceControlledAttribute createIceControlledAttribute(long tieBreaker)
Creates an IceControlledAttribute object with the specified tie-breaker value
- Parameters:
tieBreaker- the tie-breaker value to be used
-
createPriorityAttribute
static PriorityAttribute createPriorityAttribute(long priority)
Creates a Priority attribute with the specified priority value
- Parameters:
priority- the priority value
-
createUseCandidateAttribute
static UseCandidateAttribute createUseCandidateAttribute()
Creates a UseCandidateAttribute
-
createIceControllingAttribute
static IceControllingAttribute createIceControllingAttribute(long tieBreaker)
Creates an IceControllingAttribute with the specified tie-breaker value
- Parameters:
tieBreaker- the tie-breaker value to be used
-
createMagicCookieAttribute
static MagicCookieAttribute createMagicCookieAttribute()
Creates a MagicCookieAttribute.
-
createDestinationAddressAttribute
static DestinationAddressAttribute createDestinationAddressAttribute(TransportAddress address)
Creates a DestinationFromAddressAttribute of the specified type and with the specified address and port
- Parameters:
address- the address value of the address attribute
-
createRequestedAddressFamilyAttribute
static RequestedAddressFamilyAttribute createRequestedAddressFamilyAttribute(char family)
Creates a new RequestedAddressFamilyAttribute of the specified family
- Parameters:
family- address family value as specified in the RFC
-
createConnectionIdAttribute
static ConnectionIdAttribute createConnectionIdAttribute(int connectionIdValue)
Creates a new ConnectionIdAttribute of the specified connectionIdValue
- Parameters:
connectionIdValue- the connection ID value.
-
createConnectionIdAttribute
static ConnectionIdAttribute createConnectionIdAttribute()
Creates a new ConnectionIdAttribute. The connectionId value is set as the hashcode value of the object.
-
-
-
-