public class IppResponse extends AbstractIpp
----------------------------------------------- | version-number | 2 bytes - required ----------------------------------------------- | operation-id (request) | | or | 2 bytes - required | status-code (response) | ----------------------------------------------- | request-id | 4 bytes - required ----------------------------------------------- | attribute-group | n bytes - 0 or more ----------------------------------------------- | end-of-attributes-tag | 1 byte - required ----------------------------------------------- | data | q bytes - optional -----------------------------------------------
AbstractIpp.VersionDEFAULT_VERSION| Constructor and Description |
|---|
IppResponse()
This constructor is needed for the
Externalizable
interface. |
IppResponse(byte[] bytes)
Instantiates a new IPP response from the given bytes.
|
IppResponse(IppRequest request)
The IppResponse is the response to a IppRequest.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
getOpCodeAsString()
Returns the 2nd part (byte 2-3) with the status-code as string.
|
StatusCode |
getStatusCode()
Returns the 2nd part (byte 2-3) with the status-code.
|
java.lang.String |
getStatusMessage()
Gets the content of the attribute 'status-message'.
|
void |
setStatusCode(StatusCode code)
Set the 2nd part (byte 2-3) with the new status-code.
|
void |
setStatusMessage(java.lang.String message)
In case of a bad request or other error status you can set the
message for this status with this function.
|
addAttributeGroup, equals, getAttribute, getAttributeGroup, getAttributeGroups, getAttributes, getData, getJobId, getJobState, getJobStateMessage, getJobStateReasons, getJobURI, getLength, getOpCode, getOperationAttributes, getPrinterURI, getRequestId, getVersion, hasAttribute, hasData, hashCode, readExternal, recordTo, recordTo, setAttribute, setAttribute, setAttributesCharset, setAttributesNaturalLanguage, setData, setJobAttribute, setJobId, setJobState, setJobStateMessage, setJobStateReasons, setJobURI, setOpCode, setOperationAttribute, setPrinterURI, setRequestId, setRequestingUserName, toByteArray, toLongString, toShortString, toString, validate, writeExternalpublic IppResponse()
Externalizable
interface.public IppResponse(byte[] bytes)
bytes - the bytes of the IPP requestpublic IppResponse(IppRequest request)
request - the request for this responsepublic void setStatusCode(StatusCode code)
code - the new status codepublic StatusCode getStatusCode()
StatusCode.SUCCESSFUL_OKpublic void setStatusMessage(java.lang.String message)
message - the status messagepublic java.lang.String getStatusMessage()
protected java.lang.String getOpCodeAsString()
getOpCodeAsString in class AbstractIppCopyright © 2018–2020. All rights reserved.