public final class HeaderSet extends Object
Modifier and Type | Field and Description |
---|---|
static int |
APPLICATION_PARAMETER
Represents the OBEX Application Parameter header.
|
static int |
AUTH_CHALLENGE
Represents the OBEX authentication digest-challenge.
|
static int |
AUTH_RESPONSE
Represents the OBEX authentication digest-response.
|
static int |
BODY
Represents the OBEX BODY header.
|
static int |
CONNECTION_ID
Represents the OBEX Connection ID header.
|
static int |
COUNT
Represents the OBEX Count header.
|
static int |
DESCRIPTION
Represents the OBEX Description header.
|
static int |
END_OF_BODY
Represents the OBEX End of BODY header.
|
static int |
HTTP
Represents the OBEX HTTP header.
|
static int |
LENGTH
Represents the OBEX Length header.
|
byte[] |
mAuthChall |
byte[] |
mAuthResp |
byte[] |
mConnectionID |
static int |
NAME
Represents the OBEX Name header.
|
static int |
OBJECT_CLASS
Represents the OBEX Object Class header.
|
int |
responseCode |
static int |
TARGET
Represents the OBEX Target header.
|
static int |
TIME_4_BYTE
Represents the OBEX Time header using the 4 byte representation.
|
static int |
TIME_ISO_8601
Represents the OBEX Time header using the ISO 8601 standards.
|
static int |
TYPE
Represents the OBEX Type header.
|
static int |
WHO
Represents the OBEX Who header.
|
Constructor and Description |
---|
HeaderSet()
Creates new
HeaderSet object. |
Modifier and Type | Method and Description |
---|---|
void |
createAuthenticationChallenge(String realm,
boolean userID,
boolean access)
Sets the authentication challenge header.
|
Object |
getHeader(int headerID)
Retrieves the value of the header identifier provided.
|
int[] |
getHeaderList()
Retrieves the list of headers that may be retrieved via the
getHeader method that will not return null . |
int |
getResponseCode()
Returns the response code received from the server.
|
void |
setHeader(int headerID,
Object headerValue)
Sets the value of the header identifier to the value provided.
|
public static final int COUNT
The value of COUNT
is 0xC0 (192).
public static final int NAME
The value of NAME
is 0x01 (1).
public static final int TYPE
The value of TYPE
is 0x42 (66).
public static final int LENGTH
The value of LENGTH
is 0xC3 (195).
public static final int TIME_ISO_8601
The value of TIME_ISO_8601
is 0x44 (68).
public static final int TIME_4_BYTE
The value of TIME_4_BYTE
is 0xC4 (196).
public static final int DESCRIPTION
The value of DESCRIPTION
is 0x05 (5).
public static final int TARGET
The value of TARGET
is 0x46 (70).
public static final int HTTP
The value of HTTP
is 0x47 (71).
public static final int BODY
The value of BODY
is 0x48 (72).
public static final int END_OF_BODY
The value of BODY
is 0x49 (73).
public static final int WHO
The value of WHO
is 0x4A (74).
public static final int CONNECTION_ID
The value of CONNECTION_ID
is 0xCB (203).
public static final int APPLICATION_PARAMETER
The value of APPLICATION_PARAMETER
is 0x4C (76).
public static final int AUTH_CHALLENGE
The value of AUTH_CHALLENGE
is 0x4D (77).
public static final int AUTH_RESPONSE
The value of AUTH_RESPONSE
is 0x4E (78).
public static final int OBJECT_CLASS
The value of OBJECT_CLASS
is 0x4F (79).
public byte[] mAuthChall
public byte[] mAuthResp
public byte[] mConnectionID
public int responseCode
public HeaderSet()
HeaderSet
object.size
- the max packet size for this connectionpublic void setHeader(int headerID, Object headerValue)
null
is passed as the
headerValue
then the header will be removed from the set of
headers to include in the next request.headerID
- the identifier to include in the messageheaderValue
- the value of the header identifierIllegalArgumentException
- if the header identifier provided is not
one defined in this interface or a user-defined header; if the
type of headerValue
is not the correct Java type as
defined in the description of this interface\public Object getHeader(int headerID) throws IOException
headerID
- the header identifier whose value is to be returnednull
if the
header identifier specified is not part of this
HeaderSet
objectIllegalArgumentException
- if the headerID
is not one
defined in this interface or any of the user-defined headersIOException
- if an error occurred in the transport layer during
the operation or if the connection has been closedpublic int[] getHeaderList() throws IOException
getHeader
method that will not return null
. In
other words, this method returns all the headers that are available in
this object.null
if no headers are availableIOException
- if an error occurred in the transport layer during
the operation or the connection has been closedgetHeader(int)
public void createAuthenticationChallenge(String realm, boolean userID, boolean access) throws IOException
realm
will be
encoded based upon the default encoding scheme used by the implementation
to encode strings. Therefore, the encoding scheme used to encode the
realm
is application dependent.realm
- a short description that describes what password to use; if
null
no realm will be sent in the authentication
challenge headeruserID
- if true
, a user ID is required in the reply;
if false
, no user ID is requiredaccess
- if true
then full access will be granted if
successful; if false
then read-only access will be
granted if successfulIOException
public int getResponseCode() throws IOException
ResponseCodes
class.IOException
- if an error occurred in the transport layer during
the transaction; if this method is called on a
HeaderSet
object created by calling
createHeaderSet()
in a ClientSession
object; if this object was created by an OBEX serverResponseCodes