src/share/classes/javax/print/attribute/standard/RequestingUserName.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  31 import javax.print.attribute.PrintRequestAttribute;
  32 
  33 /**
  34  * Class RequestingUserName is a printing attribute class, a text attribute,
  35  * that specifies the name of the end user that submitted the print job. A
  36  * requesting user name is an arbitrary string defined by the client. The
  37  * printer does not put the client-specified RequestingUserName attribute into
  38  * the Print Job's attribute set; rather, the printer puts in a {@link
  39  * JobOriginatingUserName JobOriginatingUserName} attribute.
  40  * This means that services which support specifying a username with this
  41  * attribute should also report a JobOriginatingUserName in the job's
  42  * attribute set. Note that many print services may have a way to independently
  43  * authenticate the user name, and so may state support for a
  44  * requesting user name, but in practice will then report the user name
  45  * authenticated by the service rather than that specified via this
  46  * attribute.
  47  * <P>
  48  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  49  * locale gives the IPP natural language. The category name returned by
  50  * <CODE>getName()</CODE> gives the IPP attribute name.
  51  * <P>
  52  *
  53  * @author  Alan Kaminsky
  54  */
  55 public final class RequestingUserName   extends TextSyntax
  56     implements PrintRequestAttribute {
  57 
  58     private static final long serialVersionUID = -2683049894310331454L;
  59 
  60     /**
  61      * Constructs a new requesting user name attribute with the given user
  62      * name and locale.
  63      *
  64      * @param  userName  User name.
  65      * @param  locale    Natural language of the text string. null
  66      * is interpreted to mean the default locale as returned
  67      * by <code>Locale.getDefault()</code>
  68      *
  69      * @exception  NullPointerException
  70      *     (unchecked exception) Thrown if <CODE>userName</CODE> is null.
  71      */


   1 /*
   2  * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  31 import javax.print.attribute.PrintRequestAttribute;
  32 
  33 /**
  34  * Class RequestingUserName is a printing attribute class, a text attribute,
  35  * that specifies the name of the end user that submitted the print job. A
  36  * requesting user name is an arbitrary string defined by the client. The
  37  * printer does not put the client-specified RequestingUserName attribute into
  38  * the Print Job's attribute set; rather, the printer puts in a {@link
  39  * JobOriginatingUserName JobOriginatingUserName} attribute.
  40  * This means that services which support specifying a username with this
  41  * attribute should also report a JobOriginatingUserName in the job's
  42  * attribute set. Note that many print services may have a way to independently
  43  * authenticate the user name, and so may state support for a
  44  * requesting user name, but in practice will then report the user name
  45  * authenticated by the service rather than that specified via this
  46  * attribute.
  47  * <P>
  48  * <B>IPP Compatibility:</B> The string value gives the IPP name value. The
  49  * locale gives the IPP natural language. The category name returned by
  50  * <CODE>getName()</CODE> gives the IPP attribute name.

  51  *
  52  * @author  Alan Kaminsky
  53  */
  54 public final class RequestingUserName   extends TextSyntax
  55     implements PrintRequestAttribute {
  56 
  57     private static final long serialVersionUID = -2683049894310331454L;
  58 
  59     /**
  60      * Constructs a new requesting user name attribute with the given user
  61      * name and locale.
  62      *
  63      * @param  userName  User name.
  64      * @param  locale    Natural language of the text string. null
  65      * is interpreted to mean the default locale as returned
  66      * by <code>Locale.getDefault()</code>
  67      *
  68      * @exception  NullPointerException
  69      *     (unchecked exception) Thrown if <CODE>userName</CODE> is null.
  70      */