Changeset 8d89b3d for server


Ignore:
Timestamp:
Jan 21, 2012, 3:13:33 PM (12 years ago)
Author:
Daniel Cooper <danny@…>
Branches:
no-cups
Children:
8de3c81
Parents:
a9eb577e
git-author:
Daniel Cooper <danny@…> (01/21/12 15:13:33)
git-committer:
Daniel Cooper <danny@…> (01/21/12 15:13:33)
Message:

added comments from the RFC to several functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/lib/gutenbach/server/requests.py

    rd994f15 r8d89b3d  
    268268    @handler_for(ipp.OperationCodes.PRINT_URI)
    269269    def print_uri(self, request, response):
     270        """3.2.2 Print-URI Operation
     271
     272        This OPTIONAL operation is identical to the Print-Job operation
     273        (section 3.2.1) except that a client supplies a URI reference to the
     274        document data using the 'document-uri' (uri) operation attribute (in
     275        Group 1) rather than including the document data itself.  Before
     276        returning the response, the Printer MUST validate that the Printer
     277        supports the retrieval method (e.g., http, ftp, etc.) implied by the
     278        URI, and MUST check for valid URI syntax.  If the client-supplied URI
     279        scheme is not supported, i.e. the value is not in the Printer
     280        object's 'referenced-uri-scheme-supported' attribute, the Printer
     281        object MUST reject the request and return the 'client-error-uri-
     282        scheme-not-supported' status code.
     283
     284        The IPP Printer MAY validate the accessibility of the document as
     285        part of the operation or subsequently.  If the Printer determines an
     286        accessibility problem before returning an operation response, it
     287        rejects the request and returns the 'client-error-document-access-
     288        error' status code.  The Printer MAY also return a specific document
     289        access error code using the 'document-access-error' operation
     290        attribute (see section 3.1.6.4).
     291
     292        If the Printer determines this document accessibility problem after
     293        accepting the request and returning an operation response with one of
     294        the successful status codes, the Printer adds the 'document-access-
     295        error' value to the job's 'job-state-reasons' attribute and MAY                                                 populate the job's 'job-document-access-errors' Job Description
     296        attribute (see section 4.3.11).  See The Implementer's Guide [IPP-
     297        IIG] for suggested additional checks.
     298                                                                             
     299        If the Printer object supports this operation, it MUST support the
     300        'reference-uri-schemes-supported' Printer attribute (see section 4.4.27).
     301
     302        It is up to the IPP object to interpret the URI and subsequently
     303        'pull' the document from the source referenced by the URI string."""
    270304        raise ipp.errors.ServerErrorOperationNotSupported
    271305
     
    364398    @handler_for(ipp.OperationCodes.PAUSE_PRINTER)
    365399    def pause_printer(self, request, response):
     400        """
     401            3.2.7 Pause-Printer Operation
     402
     403            This OPTIONAL operation allows a client to stop the Printer object
     404            from scheduling jobs on all its devices.  Depending on
     405            implementation, the Pause-Printer operation MAY also stop the Printer
     406            from processing the current job or jobs.  Any job that is currently
     407            being printed is either stopped as soon as the implementation permits
     408            or is completed, depending on implementation.  The Printer object
     409            MUST still accept create operations to create new jobs, but MUST
     410            prevent any jobs from entering the 'processing' state.
     411
     412            If the Pause-Printer operation is supported, then the Resume-Printer
     413            operation MUST be supported, and vice-versa.
     414
     415            The IPP Printer stops the current job(s) on its device(s) that were
     416            in the 'processing' or 'processing-stopped' states as soon as the
     417            implementation permits.  If the implementation will take appreciable
     418            time to stop, the IPP Printer adds the 'moving-to-paused' value to
     419            the Printer object's 'printer-state-reasons' attribute (see section
     420            4.4.12).  When the device(s) have all stopped, the IPP Printer
     421            transitions the Printer object to the 'stopped' state, removes the
     422            'moving-to-paused' value, if present, and adds the 'paused' value to
     423            the Printer object's 'printer-state-reasons' attribute.
     424
     425            When the current job(s) complete that were in the 'processing' state,
     426            the IPP Printer transitions them to the 'completed' state.  When the
     427            current job(s) stop in mid processing that were in the 'processing'
     428            state, the IPP Printer transitions them to the 'processing-stopped'
     429            state and adds the 'printer-stopped' value to the job's 'job-state-
     430            reasons' attribute.
     431
     432            For any jobs that are 'pending' or 'pending-held', the 'printer-
     433            stopped' value of the jobs' 'job-state-reasons' attribute also
     434            applies.  However, the IPP Printer NEED NOT update those jobs' 'job-
     435            state-reasons' attributes and only need return the 'printer-stopped'
     436            value when those jobs are queried (so-called 'lazy evaluation').
     437
     438            Whether the Pause-Printer operation affects jobs that were submitted
     439            to the device from other sources than the IPP Printer object in the
     440            same way that the Pause-Printer operation affects jobs that were
     441            submitted to the IPP Printer object using IPP, depends on
     442            implementation, i.e., on whether the IPP protocol is being used as a
     443            universal management protocol or just to manage IPP jobs,
     444            respectively.
     445
     446            The IPP Printer MUST accept the request in any state and transition
     447            the Printer to the indicated new 'printer-state' before returning as
     448            follows:
     449
     450            Current        New      'printer   IPP Printer's response status
     451            'printer-    'printer-   -state-          code and action:
     452            state'       state'    reasons'
     453
     454            'idle'       'stopped'    'paused'  'successful-ok'
     455            'processing' 'processing' 'moving-  OPTION 1: 'successful-ok';
     456                                                      to-       Later, when all output has
     457                                                      paused'   stopped, the 'printer-state'
     458                                                                            becomes 'stopped', and the
     459                                                                            'paused' value replaces the
     460                                                                            'moving-to-paused' value in the
     461                                                                            'printer-state-reasons'
     462                                                                            attribute
     463            'processing' 'stopped'    'paused'  OPTION 2: 'successful-ok';
     464                                                                            all device output stopped
     465                                                                            immediately
     466            'stopped'    'stopped'    'paused'  'successful-ok'
     467
     468            Access Rights: The authenticated user (see section 8.3) performing
     469            this operation must be an operator or administrator of the Printer
     470            object (see Sections 1 and 8.5).   Otherwise, the IPP Printer MUST
     471            reject the operation and return:  'client-error-forbidden', 'client-
     472            error-not-authenticated', or 'client-error-not-authorized' as
     473            appropriate.
     474
     475            3.2.7.1 Pause-Printer Request
     476
     477            The following groups of attributes are part of the Pause-Printer
     478            Request:
     479
     480            Group 1: Operation Attributes
     481
     482            Natural Language and Character Set:
     483            The 'attributes-charset' and 'attributes-natural-language'
     484            attributes as described in section 3.1.4.1.
     485
     486            Target:
     487            The 'printer-uri' (uri) operation attribute which is the target
     488            for this operation as described in section 3.1.5.
     489
     490            Requesting User Name:
     491            The 'requesting-user-name' (name(MAX)) attribute SHOULD be
     492            supplied by the client as described in section 8.3.
     493
     494            3.2.7.2 Pause-Printer Response
     495
     496            The following groups of attributes are part of the Pause-Printer
     497            Response:
     498
     499            Group 1: Operation Attributes
     500
     501            Status Message:
     502            In addition to the REQUIRED status code returned in every
     503            response, the response OPTIONALLY includes a 'status-message'
     504            (text(255)) and/or a 'detailed-status-message' (text(MAX))
     505            operation attribute as described in sections 13 and  3.1.6.
     506
     507            Natural Language and Character Set:
     508            The 'attributes-charset' and 'attributes-natural-language'
     509            attributes as described in section 3.1.4.2.
     510
     511            Group 2: Unsupported Attributes
     512
     513            See section 3.1.7 for details on returning Unsupported Attributes.
     514
     515   
     516    """
    366517        raise ipp.errors.ServerErrorOperationNotSupported
    367518
    368519    @handler_for(ipp.OperationCodes.RESUME_PRINTER)
    369520    def resume_printer(self, request, response):
     521        """
     522        3.2.8 Resume-Printer Operation
     523
     524        This operation allows a client to resume the Printer object
     525        scheduling jobs on all its devices.  The Printer object MUST remove
     526        the 'paused' and 'moving-to-paused' values from the Printer object's
     527        'printer-state-reasons' attribute, if present.  If there are no other
     528        reasons to keep a device paused (such as media-jam), the IPP Printer
     529        is free to transition itself to the 'processing' or 'idle' states,
     530        depending on whether there are jobs to be processed or not,
     531        respectively, and the device(s) resume processing jobs.
     532
     533        If the Pause-Printer operation is supported, then the Resume-Printer
     534        operation MUST be supported, and vice-versa.
     535
     536        The IPP Printer removes the 'printer-stopped' value from any job's
     537        'job-state-reasons' attributes contained in that Printer.
     538
     539        The IPP Printer MUST accept the request in any state, transition the
     540        Printer object to the indicated new state as follows:
     541
     542
     543        Current    New 'printer-  IPP Printer's response status code and
     544        'printer-      state'                     action:
     545        state'
     546
     547        'idle'       'idle'         'successful-ok'
     548        'processing' 'processing'   'successful-ok'
     549
     550        'stopped'    'processing'   'successful-ok';
     551                                                   when there are jobs to be processed
     552        'stopped'    'idle'         'successful-ok';
     553                                                   when there are no jobs to be processed.
     554
     555        Access Rights: The authenticated user (see section 8.3) performing
     556        this operation must be an operator or administrator of the Printer
     557        object (see Sections 1 and 8.5).  Otherwise, the IPP Printer MUST
     558        reject the operation and return:  'client-error-forbidden', 'client-
     559        error-not-authenticated', or 'client-error-not-authorized' as
     560        appropriate.
     561
     562        The Resume-Printer Request and Resume-Printer Response have the same
     563        attribute groups and attributes as the Pause-Printer operation (see
     564        sections 3.2.7.1 and 3.2.7.2).                 
     565        """
    370566        raise ipp.errors.ServerErrorOperationNotSupported
    371567
     
    442638    @handler_for(ipp.OperationCodes.SET_PRINTER_ATTRIBUTES)
    443639    def set_printer_attributes(self, request, response):
     640
    444641        raise ipp.errors.ServerErrorOperationNotSupported
    445642
     
    699896    @handler_for(ipp.OperationCodes.SEND_URI)
    700897    def send_uri(self, request, response):
    701         raise ipp.errors.ServerErrorOperationNotSupported
     898       raise ipp.errors.ServerErrorOperationNotSupported
    702899
    703900    @handler_for(ipp.OperationCodes.GET_JOB_ATTRIBUTES)
     
    8071004    @handler_for(ipp.OperationCodes.SET_JOB_ATTRIBUTES)
    8081005    def set_job_attributes(self, request, response):
     1006       
    8091007        raise ipp.errors.ServerErrorOperationNotSupported
    8101008
Note: See TracChangeset for help on using the changeset viewer.