loanfund
Class RegisterFault

java.lang.Object
  extended by loanfund.RegisterFault

public class RegisterFault
extends java.lang.Object

This method is used when a ServiceResponse cannot be created. This message sends an error to alert the mobile application of what went wrong.

Author:
Gunn Olaussen & Kirsti N. Torgersen

Field Summary
private  javax.xml.soap.SOAPEnvelope env
           
private  ServiceRequestException fault
           
private  java.lang.String inResponseTo
           
static java.lang.String INTERNAL_ERROR
           
private static java.lang.String INTERNAL_ERROR_MESSAGE_GB
           
private static java.lang.String INTERNAL_ERROR_MESSAGE_NB
           
private  java.lang.String lang
           
private  javax.xml.soap.SOAPMessage message
           
static java.lang.String NOT_AUTHORIZED
           
private static java.lang.String NOT_AUTHORIZED_MESSAGE_GB
           
private static java.lang.String NOT_AUTHORIZED_MESSAGE_NB
           
private static java.lang.String ns
           
private static java.lang.String sb
           
static java.lang.String SERVICE_UNAVAILABLE
           
private static java.lang.String SERVICE_UNAVAILABLE_MESSAGE_GB
           
private static java.lang.String SERVICE_UNAVAILABLE_MESSAGE_NB
           
static java.lang.String TIMED_OUT
           
private static java.lang.String TIMED_OUT_MESSAGE_GB
           
private static java.lang.String TIMED_OUT_MESSAGE_NB
           
static java.lang.String UNKNOWN_ID
           
private static java.lang.String UNKNOWN_ID_MESSAGE_GB
           
private static java.lang.String UNKNOWN_ID_MESSAGE_NB
           
 
Constructor Summary
RegisterFault(ServiceRequestException fault, java.lang.String inResponseTo, java.lang.String lang)
          The constructor receives the Exception that occured, an inResponseTo String which is used to relate the error to something and the language to use.
 
Method Summary
private  void createBody()
          This method creates the message body which contains an error code and description.
private  void createHeader()
          This creates the message header in which it tries to set the correlation, timestamp and messageID.
 java.lang.String toString()
          Returns a string representation of this request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN_ID

public static final java.lang.String UNKNOWN_ID
See Also:
Constant Field Values

TIMED_OUT

public static final java.lang.String TIMED_OUT
See Also:
Constant Field Values

SERVICE_UNAVAILABLE

public static final java.lang.String SERVICE_UNAVAILABLE
See Also:
Constant Field Values

NOT_AUTHORIZED

public static final java.lang.String NOT_AUTHORIZED
See Also:
Constant Field Values

INTERNAL_ERROR

public static final java.lang.String INTERNAL_ERROR
See Also:
Constant Field Values

UNKNOWN_ID_MESSAGE_GB

private static final java.lang.String UNKNOWN_ID_MESSAGE_GB
See Also:
Constant Field Values

TIMED_OUT_MESSAGE_GB

private static final java.lang.String TIMED_OUT_MESSAGE_GB
See Also:
Constant Field Values

SERVICE_UNAVAILABLE_MESSAGE_GB

private static final java.lang.String SERVICE_UNAVAILABLE_MESSAGE_GB
See Also:
Constant Field Values

NOT_AUTHORIZED_MESSAGE_GB

private static final java.lang.String NOT_AUTHORIZED_MESSAGE_GB
See Also:
Constant Field Values

INTERNAL_ERROR_MESSAGE_GB

private static final java.lang.String INTERNAL_ERROR_MESSAGE_GB
See Also:
Constant Field Values

UNKNOWN_ID_MESSAGE_NB

private static final java.lang.String UNKNOWN_ID_MESSAGE_NB
See Also:
Constant Field Values

TIMED_OUT_MESSAGE_NB

private static final java.lang.String TIMED_OUT_MESSAGE_NB
See Also:
Constant Field Values

SERVICE_UNAVAILABLE_MESSAGE_NB

private static final java.lang.String SERVICE_UNAVAILABLE_MESSAGE_NB
See Also:
Constant Field Values

NOT_AUTHORIZED_MESSAGE_NB

private static final java.lang.String NOT_AUTHORIZED_MESSAGE_NB
See Also:
Constant Field Values

INTERNAL_ERROR_MESSAGE_NB

private static final java.lang.String INTERNAL_ERROR_MESSAGE_NB
See Also:
Constant Field Values

ns

private static final java.lang.String ns
See Also:
Constant Field Values

sb

private static final java.lang.String sb
See Also:
Constant Field Values

fault

private ServiceRequestException fault

lang

private java.lang.String lang

inResponseTo

private java.lang.String inResponseTo

message

private javax.xml.soap.SOAPMessage message

env

private javax.xml.soap.SOAPEnvelope env
Constructor Detail

RegisterFault

public RegisterFault(ServiceRequestException fault,
                     java.lang.String inResponseTo,
                     java.lang.String lang)
The constructor receives the Exception that occured, an inResponseTo String which is used to relate the error to something and the language to use. The Exception is the reason why a fault message is created instead of the ordinary response.

Parameters:
fault - ServiceRequestException The exeception that occured
inResponseTo - String The messageId of the request
lang - String The langugage we want the fault to use for the error
Method Detail

createHeader

private void createHeader()
                   throws javax.xml.soap.SOAPException
This creates the message header in which it tries to set the correlation, timestamp and messageID. Otherwise an SOAPException is thrown.

Throws:
javax.xml.soap.SOAPException

createBody

private void createBody()
                 throws javax.xml.soap.SOAPException
This method creates the message body which contains an error code and description.

Throws:
javax.xml.soap.SOAPException

toString

public java.lang.String toString()
Returns a string representation of this request.

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()