ie.omk.smpp
Class ErrorAddress

java.lang.Object
  extended by ie.omk.smpp.Address
      extended by ie.omk.smpp.ErrorAddress
All Implemented Interfaces:
Serializable

public class ErrorAddress
extends Address

An address that message submission was unsuccessfully submitted to. This class is used in the SubmitMultiResp packet type to return a list of SME addresses that message submission failed for along with an error code for each address indicating the reason for the failure.

Author:
Oran Kelly <orank@users.sf.net>
See Also:
Serialized Form

Constructor Summary
ErrorAddress()
          Create a new ErrorAddress object.
ErrorAddress(int ton, int npi, String addr)
          Create a new ErrorAddress object.
ErrorAddress(int ton, int npi, String addr, int error)
          Create a new ErrorAddress object.
 
Method Summary
 int getError()
          Get the error code associated with this ErrorAddress.
 int getLength()
          Get the number of bytes this object would encode to.
 void readFrom(byte[] ea, int offset)
          Decode this address from a byte array.
 void setError(int error)
          Set the error code associated with this ErrorAddress.
 void writeTo(OutputStream out)
          Encode this object as bytes to the output stream.
 
Methods inherited from class ie.omk.smpp.Address
equals, getAddress, getNPI, getTON, hashCode, setAddress, setNPI, setTON, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ErrorAddress

public ErrorAddress()
Create a new ErrorAddress object.


ErrorAddress

public ErrorAddress(int ton,
                    int npi,
                    String addr)
Create a new ErrorAddress object.

Parameters:
ton - The Type Of Number.
npi - The Numbering Plan Indicator.
addr - The address.

ErrorAddress

public ErrorAddress(int ton,
                    int npi,
                    String addr,
                    int error)
Create a new ErrorAddress object.

Parameters:
ton - The Type Of Number.
npi - The Numbering Plan Indicator.
addr - The address.
error - The error code indicating why message submission failed.
Method Detail

getError

public int getError()
Get the error code associated with this ErrorAddress.


setError

public void setError(int error)
Set the error code associated with this ErrorAddress.


getLength

public int getLength()
Description copied from class: Address
Get the number of bytes this object would encode to.

Overrides:
getLength in class Address

writeTo

public void writeTo(OutputStream out)
             throws IOException
Description copied from class: Address
Encode this object as bytes to the output stream. An address encodes as a single byte for the TON, a single byte for the NPI and a nul-terminated ASCII character string.

Overrides:
writeTo in class Address
Parameters:
out - The output stream to encode the address to.
Throws:
IOException - If an I/O error occurs while writing to the output stream.

readFrom

public void readFrom(byte[] ea,
                     int offset)
Description copied from class: Address
Decode this address from a byte array.

Overrides:
readFrom in class Address
Parameters:
ea - The byte array to read the address from.
offset - The offset within the byte array to begin decoding from.


Copyright © 2011 smppapi at Sourceforge. All Rights Reserved.