com.funambol.syncml.protocol
Class SyncMLStatus

java.lang.Object
  extended by com.funambol.syncml.protocol.SyncMLStatus

public class SyncMLStatus
extends java.lang.Object

This class is a container for SyncML status command. It can be filled from an incominig SyncML fragment using the static method parse, or can be filled with all the info and then used to format an outgoing Status command.


Field Summary
static int ALREADY_EXISTS
           
static int AUTHENTICATION_ACCEPTED
           
static int BACKEND_AUTH_ERROR
           
static int CHUNKED_ITEM_ACCEPTED
           
static int DEVICE_FULL
           
static int FORBIDDEN
           
static int GENERIC_ERROR
           
static int INVALID_CREDENTIALS
           
static int NOT_FOUND
           
static int PROCESSING_ERROR
           
static int REFRESH_REQUIRED
           
static int SERVER_BUSY
           
static int SUCCESS
           
 
Constructor Summary
SyncMLStatus()
           
SyncMLStatus(java.lang.String cmdId, java.lang.String msgref, java.lang.String cmdref, java.lang.String cmd, java.lang.String[] items, int status)
           
SyncMLStatus(java.lang.String cmdId, java.lang.String msgref, java.lang.String cmdref, java.lang.String cmd, java.lang.String src, java.lang.String tgt, int status)
           
 
Method Summary
 java.lang.String getChalFormat()
           
 java.lang.String getChalNextNonce()
           
 java.lang.String getChalType()
           
 java.lang.String getCmd()
          Get the command name
 java.lang.String getCmdId()
          Get the command id
 java.lang.String getCmdRef()
          Get the command reference
 java.lang.String[] getItemKeys()
          Get the keys of the items acknowledged by this status.
 java.lang.String getMsgRef()
          Get the message reference
 java.lang.String getRef()
          Get target reference if set, or source reference otherwise
 java.lang.String getSrcRef()
          Get the source reference
 int getStatus()
          Get the status code
 java.lang.String getStatusDataMessage()
           
 java.lang.String getTgtRef()
          Get the target reference
 boolean isSuccess()
          Return true is the status code of this instance is the range 200-299.
static boolean isSuccess(int status)
          Return true is the given status code is in the range 200-299.
static SyncMLStatus parse(ChunkedString xmlCommand)
          Parse a SyncML fragment and return the first status command found, or null in case of error.
 void setCmd(java.lang.String cmd)
          Set the command name
 void setCmdId(java.lang.String cmdId)
          Set the command id
 void setCmdRef(java.lang.String cmdRef)
          Set the command reference
 void setItemKeys(java.lang.String[] items)
          Set the keys of the items acknowledged by this status.
 void setMsgRef(java.lang.String msgRef)
          Set the message reference
 void setSrcRef(java.lang.String srcRef)
          Set the source reference
 void setStatus(int status)
          Set the status code
 void setStatusDataMessage(ChunkedString statusDataMessage)
           
 void setTgtRef(java.lang.String tgtRef)
          Set the target reference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUCCESS

public static final int SUCCESS
See Also:
Constant Field Values

AUTHENTICATION_ACCEPTED

public static final int AUTHENTICATION_ACCEPTED
See Also:
Constant Field Values

CHUNKED_ITEM_ACCEPTED

public static final int CHUNKED_ITEM_ACCEPTED
See Also:
Constant Field Values

INVALID_CREDENTIALS

public static final int INVALID_CREDENTIALS
See Also:
Constant Field Values

FORBIDDEN

public static final int FORBIDDEN
See Also:
Constant Field Values

NOT_FOUND

public static final int NOT_FOUND
See Also:
Constant Field Values

ALREADY_EXISTS

public static final int ALREADY_EXISTS
See Also:
Constant Field Values

DEVICE_FULL

public static final int DEVICE_FULL
See Also:
Constant Field Values

GENERIC_ERROR

public static final int GENERIC_ERROR
See Also:
Constant Field Values

SERVER_BUSY

public static final int SERVER_BUSY
See Also:
Constant Field Values

PROCESSING_ERROR

public static final int PROCESSING_ERROR
See Also:
Constant Field Values

REFRESH_REQUIRED

public static final int REFRESH_REQUIRED
See Also:
Constant Field Values

BACKEND_AUTH_ERROR

public static final int BACKEND_AUTH_ERROR
See Also:
Constant Field Values
Constructor Detail

SyncMLStatus

public SyncMLStatus()

SyncMLStatus

public SyncMLStatus(java.lang.String cmdId,
                    java.lang.String msgref,
                    java.lang.String cmdref,
                    java.lang.String cmd,
                    java.lang.String src,
                    java.lang.String tgt,
                    int status)

SyncMLStatus

public SyncMLStatus(java.lang.String cmdId,
                    java.lang.String msgref,
                    java.lang.String cmdref,
                    java.lang.String cmd,
                    java.lang.String[] items,
                    int status)
Method Detail

getCmdId

public java.lang.String getCmdId()
Get the command id


setCmdId

public void setCmdId(java.lang.String cmdId)
Set the command id


getMsgRef

public java.lang.String getMsgRef()
Get the message reference


setMsgRef

public void setMsgRef(java.lang.String msgRef)
Set the message reference


getCmdRef

public java.lang.String getCmdRef()
Get the command reference


setCmdRef

public void setCmdRef(java.lang.String cmdRef)
Set the command reference


getCmd

public java.lang.String getCmd()
Get the command name


setCmd

public void setCmd(java.lang.String cmd)
Set the command name


getSrcRef

public java.lang.String getSrcRef()
Get the source reference


setSrcRef

public void setSrcRef(java.lang.String srcRef)
Set the source reference


getTgtRef

public java.lang.String getTgtRef()
Get the target reference


setTgtRef

public void setTgtRef(java.lang.String tgtRef)
Set the target reference


getRef

public java.lang.String getRef()
Get target reference if set, or source reference otherwise


getItemKeys

public java.lang.String[] getItemKeys()
Get the keys of the items acknowledged by this status.


setItemKeys

public void setItemKeys(java.lang.String[] items)
Set the keys of the items acknowledged by this status.


getStatus

public int getStatus()
Get the status code


setStatus

public void setStatus(int status)
Set the status code


getChalType

public java.lang.String getChalType()

getChalFormat

public java.lang.String getChalFormat()

getChalNextNonce

public java.lang.String getChalNextNonce()

parse

public static SyncMLStatus parse(ChunkedString xmlCommand)
Parse a SyncML fragment and return the first status command found, or null in case of error.


isSuccess

public boolean isSuccess()
Return true is the status code of this instance is the range 200-299.


isSuccess

public static boolean isSuccess(int status)
Return true is the given status code is in the range 200-299.


setStatusDataMessage

public void setStatusDataMessage(ChunkedString statusDataMessage)

getStatusDataMessage

public java.lang.String getStatusDataMessage()


Copyright © 2001-2009 Funambol.