com.opencloud.slee.resources.mm7
Class MM7Address

java.lang.Object
  extended by com.opencloud.slee.resources.mm7.MM7Address
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
Recipient, UserAgentInfo

public class MM7Address
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Represents MM7 addresses. Consists of a Address plus a 'display-only' flag that indicates whether an address is display-only or routable.

The address plan of the Address determines the mapping to MM7 address types:

Use of other address plans will be rejected at construction time with an IllegalArgumentException.

See Also:
Serialized Form

Nested Class Summary
static class MM7Address.AddressCoding
          Typesafe enum for Address Coding
 
Constructor Summary
MM7Address(javax.slee.Address address)
          Construct a new MM7 address from a SLEE address.
MM7Address(javax.slee.Address address, boolean displayOnly)
          Construct a new MM7 address from a SLEE address.
MM7Address(javax.slee.Address address, boolean displayOnly, MM7Address.AddressCoding addressCoding)
          Construct a new MM7 address from a SLEE address.
MM7Address(javax.slee.Address address, boolean displayOnly, MM7Address.AddressCoding addressCoding, java.lang.String id)
          Construct a new MM7 address from a SLEE address.
MM7Address(java.io.DataInput in)
          Construct a MM7 address from a stream.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
           
 void fromStream(java.io.DataInput in)
           
 javax.slee.Address getAddress()
          Get the underlying SLEE address of this address.
 MM7Address.AddressCoding getAddressCoding()
          Get the AddressCoding of this address.
 java.lang.String getID()
          Get the id of this address.
 int hashCode()
           
 boolean isDisplayOnly()
          Get the display-only flag of this address.
 void toStream(java.io.DataOutput out)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MM7Address

public MM7Address(javax.slee.Address address)
           throws java.lang.IllegalArgumentException
Construct a new MM7 address from a SLEE address. The resulting object is not display-only. With no addressCoding and no id set.

Parameters:
address - the underlying SLEE address
Throws:
java.lang.IllegalArgumentException - if the address plan of address is not a supported plan for MM7 addresses

MM7Address

public MM7Address(javax.slee.Address address,
                  boolean displayOnly)
           throws java.lang.IllegalArgumentException
Construct a new MM7 address from a SLEE address. With no addressCoding and no id set.

Parameters:
address - the underlying SLEE address
displayOnly - the value of the display-only flag
Throws:
java.lang.IllegalArgumentException - if the address plan of address is not a supported plan for MM7 addresses

MM7Address

public MM7Address(javax.slee.Address address,
                  boolean displayOnly,
                  MM7Address.AddressCoding addressCoding)
           throws java.lang.IllegalArgumentException
Construct a new MM7 address from a SLEE address. With no id set.

Parameters:
address - the underlying SLEE address
displayOnly - the value of the display-only flag
addressCoding - the value of the address coding, or null if inapplicable
Throws:
java.lang.IllegalArgumentException - if the address plan of address is not a supported plan for MM7 addresses

MM7Address

public MM7Address(javax.slee.Address address,
                  boolean displayOnly,
                  MM7Address.AddressCoding addressCoding,
                  java.lang.String id)
           throws java.lang.IllegalArgumentException
Construct a new MM7 address from a SLEE address.

Parameters:
address - the underlying SLEE address
displayOnly - the value of the display-only flag
addressCoding - the value of the address coding, or null if inapplicable
id - the value of id of the address, or null if inapplicable
Throws:
java.lang.IllegalArgumentException - if the address plan of address is not a supported plan for MM7 addresses

MM7Address

public MM7Address(java.io.DataInput in)
           throws java.io.IOException
Construct a MM7 address from a stream.

Parameters:
in - the stream to read from
Throws:
java.io.IOException - if the stream is badly formatted
Method Detail

getAddress

public final javax.slee.Address getAddress()
Get the underlying SLEE address of this address.

Returns:
the underlying address object

isDisplayOnly

public final boolean isDisplayOnly()
Get the display-only flag of this address.

Returns:
true if the display-only flag is set.

getAddressCoding

public final MM7Address.AddressCoding getAddressCoding()
Get the AddressCoding of this address.

Returns:
the AddressCoding, or null if not set

getID

public final java.lang.String getID()
Get the id of this address.

Returns:
the id, or null if not set

toStream

public void toStream(java.io.DataOutput out)
              throws java.io.IOException
Throws:
java.io.IOException

fromStream

public void fromStream(java.io.DataInput in)
                throws java.io.IOException
Throws:
java.io.IOException

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

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

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException