Skip to content

Commit

Permalink
deprecated operations Print-URI and Send-URI (issue #24)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuth committed Jun 4, 2024
1 parent 331f71e commit 9c23be0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ val job = ippPrinter.printJob(
)
job.subscription?.pollAndHandleNotifications { println(it) }

// Print remote file, make printer pull document from remote server
val remoteFile = URI.create("http://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf")
ippPrinter.printUri(remoteFile)

// Create job and send document
val job = ippPrinter.createJob(jobName(file.name))
job.sendDocument(FileInputStream(file))
Expand Down
9 changes: 5 additions & 4 deletions src/main/kotlin/de/gmuth/ipp/client/IppJob.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.gmuth.ipp.client

/**
* Copyright (c) 2020-2023 Gerhard Muth
* Copyright (c) 2020-2024 Gerhard Muth
*/

import de.gmuth.ipp.attributes.JobState
Expand Down Expand Up @@ -229,10 +229,11 @@ class IppJob(
documentNaturalLanguage: String? = null
) = sendDocument(FileInputStream(file), lastDocument, documentName, documentNaturalLanguage)

//---------
// Send-URI
//---------
//----------------------
// Send-URI (depreacted)
//----------------------

@Deprecated(message = "see https://ftp.pwg.org/pub/pwg/ipp/registrations/reg-ippdepuri10-20211215.pdf")
@JvmOverloads
fun sendUri(
documentUri: URI,
Expand Down
7 changes: 4 additions & 3 deletions src/main/kotlin/de/gmuth/ipp/client/IppPrinter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,11 @@ class IppPrinter(
fun printJob(file: File, vararg attributeBuilders: IppAttributeBuilder, notifyEvents: List<String>? = null) =
printJob(FileInputStream(file), attributeBuilders.toList(), notifyEvents)

//----------
// Print-URI
//----------
//-----------------------
// Print-URI (deprecated)
//-----------------------

@Deprecated(message = "see https://ftp.pwg.org/pub/pwg/ipp/registrations/reg-ippdepuri10-20211215.pdf")
fun printUri(documentUri: URI, vararg attributeBuilders: IppAttributeBuilder): IppJob {
val request = attributeBuildersRequest(PrintURI, attributeBuilders.toList()).apply {
operationGroup.attribute("document-uri", Uri, documentUri)
Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/de/gmuth/ipp/core/IppOperation.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.gmuth.ipp.core

/**
* Copyright (c) 2020-2023 Gerhard Muth
* Copyright (c) 2020-2024 Gerhard Muth
*/

// https://www.iana.org/assignments/ipp-registrations/ipp-registrations.xml#ipp-registrations-6
Expand All @@ -10,11 +10,11 @@ enum class IppOperation(val code: Int) {

// RFC 8011
PrintJob(0x0002),
PrintURI(0x0003),
PrintURI(0x0003), // https://ftp.pwg.org/pub/pwg/ipp/registrations/reg-ippdepuri10-20211215.pdf
ValidateJob(0x0004),
CreateJob(0x0005),
SendDocument(0x0006),
SendURI(0x0007),
SendURI(0x0007), // https://ftp.pwg.org/pub/pwg/ipp/registrations/reg-ippdepuri10-20211215.pdf
CancelJob(0x0008),
GetJobAttributes(0x0009),
GetJobs(0x000A),
Expand Down

0 comments on commit 9c23be0

Please sign in to comment.