public class Operation
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
|
Operation(IppOperations id)
Instantiates an operation with the given id.
|
protected |
Operation(IppOperations id,
IppRequest ippRequest)
Instantiates an operation with the given id and the given IPP request.
|
| Modifier and Type | Method and Description |
|---|---|
protected static IppRequest |
createIppRequest(IppOperations ippOp) |
Attribute |
getAttribute(java.lang.String name)
Returns the attribute of the give name.
|
IppRequest |
getIppRequest()
Gets the IPP request which belongs to this operation.
|
IppResponse |
getIppResponse()
Gets the IPP response for the stored IPP request.
|
java.lang.String |
getPrinterName()
The printer name is the last part of the printer-uri.
|
java.net.URI |
getPrinterURI()
Gets printer uri.
|
protected void |
initPrinterAttributes(AttributeGroup group)
Initialiazes printer-attributes with default values.
|
void |
setCupsURI(java.net.URI cupsURI)
Sets the CUPS URI.
|
void |
setIppRequestId(int id)
Sets the ID of the IPP request.
|
void |
setJobAttribute(Attribute attribute)
Sets the given job attribute in the generated IPP request.
|
void |
setJobId(int jobId)
Sets job id.
|
void |
setJobState(JobState state)
Sets job state.
|
void |
setJobStateReasons(JobStateReasons reason)
Sets job state reason.
|
void |
setOperationAttribute(Attribute attribute)
Sets the given operation attribute in the generated IPP request.
|
void |
setPrinterURI(java.net.URI printerURI)
Sets the printer-uri.
|
protected static java.net.URI |
toIPP(java.net.URI uri)
Converts the given URI into an URI beginning with "ipp://...".
|
void |
validateRequest()
Looks if the stored request is valid.
|
void |
validateRequest(byte[] bytes)
Looks if the given bytes represents a valid request.
|
void |
validateRequest(IppRequest request)
Looks if the given request is valid.
|
public Operation(IppOperations id)
id - a positiv number between 0x0000 and 0x0031protected Operation(IppOperations id, IppRequest ippRequest)
id - a positiv number between 0x0000 and 0x0031ippRequest - the ipp requestprotected static IppRequest createIppRequest(IppOperations ippOp)
public IppRequest getIppRequest()
public IppResponse getIppResponse()
public void setIppRequestId(int id)
id - the new IDpublic Attribute getAttribute(java.lang.String name)
name - attribute namepublic void setPrinterURI(java.net.URI printerURI)
printerURI - the printer uripublic java.net.URI getPrinterURI()
public java.lang.String getPrinterName()
public void setCupsURI(java.net.URI cupsURI)
cupsURI - the printer uripublic void setJobId(int jobId)
jobId - the job idpublic void setJobState(JobState state)
state - the statepublic void setJobStateReasons(JobStateReasons reason)
reason - the job-state-reasonpublic void setOperationAttribute(Attribute attribute)
attribute - operation attributepublic void setJobAttribute(Attribute attribute)
attribute - operation attributeprotected void initPrinterAttributes(AttributeGroup group)
group - attribute group where the printer attributes belong topublic void validateRequest(byte[] bytes)
ValidationException will be thrownbytes - which represents an requestpublic void validateRequest(IppRequest request)
ValidationException will be thrownrequest - IPP reqeustpublic void validateRequest()
ValidationException will be thrownprotected static java.net.URI toIPP(java.net.URI uri)
uri - the uriCopyright © 2018–2020. All rights reserved.