From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001
From: upstream source tree
+ * Every delimiter tag value can occur in the protocol field
+ * begin-attribute-group-tag and indicates that the following
+ * attributes will be part of the named group.IppPrintService
implementation.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public class DocPrintJobImpl implements CancelablePrintJob
+{
+ /** The print service this job is bound to. */
+ private IppPrintService service;
+
+ /** The set of print job listeners. */
+ private HashSet printJobListener = new HashSet();
+
+ /** The print job attributes listeners. */
+ private ArrayList attributesListener = new ArrayList();
+ /** The print job attributes listeners associated attribute set. */
+ private ArrayList attributesListenerAttributes = new ArrayList();
+
+ /** The username. */
+ private String username;
+ /** The password of the user. */
+ private String password;
+
+ /** Returned job uri. */
+ private JobUri jobUri = null;
+ /** Returned job id. */
+ private JobId jobId = null;
+
+ /** The requesting-username for later canceling */
+ private RequestingUserName requestingUser;
+
+ /** The print job sets. */
+ private PrintJobAttributeSet oldSet = new HashPrintJobAttributeSet();
+ private PrintJobAttributeSet currentSet = new HashPrintJobAttributeSet();
+
+ /**
+ * State variable if we already started printing.
+ */
+ private boolean printing = false;
+
+ // TODO Implement complete PrintJobListener notification
+ // TODO Implement PrintJobAttributeListener notification
+
+ /**
+ * Constructs a DocPrintJobImpl instance bound to the given print service.
+ *
+ * @param service the print service instance.
+ * @param user the user of this print service.
+ * @param passwd the password of the user.
+ */
+ public DocPrintJobImpl(IppPrintService service, String user, String passwd)
+ {
+ this.service = service;
+ username = user;
+ password = passwd;
+ }
+
+ /**
+ * @see DocPrintJob#addPrintJobAttributeListener(PrintJobAttributeListener, PrintJobAttributeSet)
+ */
+ public void addPrintJobAttributeListener(PrintJobAttributeListener listener,
+ PrintJobAttributeSet attributes)
+ {
+ if (listener == null)
+ return;
+
+ attributesListener.add(listener);
+ attributesListenerAttributes.add(attributes);
+ }
+
+ /**
+ * @see DocPrintJob#addPrintJobListener(PrintJobListener)
+ */
+ public void addPrintJobListener(PrintJobListener listener)
+ {
+ if (listener == null)
+ return;
+
+ printJobListener.add(listener);
+ }
+
+ /**
+ * @see javax.print.DocPrintJob#getAttributes()
+ */
+ public PrintJobAttributeSet getAttributes()
+ {
+ return AttributeSetUtilities.unmodifiableView(currentSet);
+ }
+
+ /**
+ * @see javax.print.DocPrintJob#getPrintService()
+ */
+ public PrintService getPrintService()
+ {
+ return service;
+ }
+
+ /**
+ * @see DocPrintJob#print(Doc, PrintRequestAttributeSet)
+ */
+ public void print(Doc doc, PrintRequestAttributeSet attributes)
+ throws PrintException
+ {
+ if (printing)
+ throw new PrintException("already printing");
+
+ printing = true;
+
+ DocAttributeSet docAtts = doc.getAttributes();
+ DocFlavor flavor = doc.getDocFlavor();
+
+ if (flavor == null || (!service.isDocFlavorSupported(flavor)))
+ {
+ notifyPrintJobListeners(new PrintJobEvent(this, PrintJobEvent.JOB_FAILED));
+ throw new PrintFlavorException("Invalid flavor", new DocFlavor[] {flavor});
+ }
+
+ // merge attributes as doc attributes take precendence
+ // over the print request attributes
+ HashAttributeSet mergedAtts = new HashAttributeSet();
+
+ if (attributes != null)
+ mergedAtts.addAll(attributes);
+ if (docAtts != null)
+ mergedAtts.addAll(docAtts);
+
+ // check for requesting-user-name -add the
+ // executing username if no other is specified
+ // save user name so we can make a cancel operation under same user
+ if (! mergedAtts.containsKey(RequestingUserName.class))
+ {
+ mergedAtts.add(IppPrintService.REQUESTING_USER_NAME);
+ requestingUser = IppPrintService.REQUESTING_USER_NAME;
+ }
+ else
+ {
+ requestingUser = (RequestingUserName)
+ mergedAtts.get(RequestingUserName.class);
+ }
+
+ // same for job-name
+ if (! mergedAtts.containsKey(JobName.class))
+ mergedAtts.add(IppPrintService.JOB_NAME);
+
+ IppResponse response = null;
+
+ try
+ {
+ PrinterURI printerUri = service.getPrinterURI();
+ String printerUriStr = "http" + printerUri.toString().substring(3);
+
+ URI uri = null;
+ try
+ {
+ uri = new URI(printerUriStr);
+ }
+ catch (URISyntaxException e)
+ {
+ // does not happen
+ }
+
+ IppRequest request =
+ new IppRequest(uri, username, password);
+
+ request.setOperationID( (short) OperationsSupported.PRINT_JOB.getValue());
+ request.setOperationAttributeDefaults();
+ request.addOperationAttribute(printerUri);
+
+ if (mergedAtts != null)
+ {
+ request.addAndFilterJobOperationAttributes(mergedAtts);
+ request.addAndFilterJobTemplateAttributes(mergedAtts);
+ }
+
+ // DocFlavor getMimeType returns charset quoted
+ DocumentFormat format = DocumentFormat.createDocumentFormat(flavor);
+ request.addOperationAttribute(format);
+
+ // Get and set the printdata based on the
+ // representation classname
+ String className = flavor.getRepresentationClassName();
+
+ if (className.equals("[B"))
+ {
+ request.setData((byte[]) doc.getPrintData());
+ response = request.send();
+ }
+ else if (className.equals("java.io.InputStream"))
+ {
+ InputStream stream = (InputStream) doc.getPrintData();
+ request.setData(stream);
+ response = request.send();
+ stream.close();
+ }
+ else if (className.equals("[C"))
+ {
+ try
+ {
+ // CUPS only supports UTF-8 currently so we convert
+ // We also assume that char[] is always utf-16 - correct ?
+ String str = new String((char[]) doc.getPrintData());
+ request.setData(str.getBytes("utf-16"));
+ response = request.send();
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ notifyPrintJobListeners(new PrintJobEvent(this, PrintJobEvent.JOB_FAILED));
+ throw new PrintFlavorException("Invalid charset of flavor", e, new DocFlavor[] {flavor});
+ }
+ }
+ else if (className.equals("java.io.Reader"))
+ {
+ try
+ {
+ // FIXME Implement
+ // Convert a Reader into a InputStream properly encoded
+ response = request.send();
+ throw new UnsupportedEncodingException("not supported yet");
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ notifyPrintJobListeners(new PrintJobEvent(this, PrintJobEvent.JOB_FAILED));
+ throw new PrintFlavorException("Invalid charset of flavor", e, new DocFlavor[] {flavor});
+ }
+ }
+ else if (className.equals("java.lang.String"))
+ {
+ try
+ {
+ // CUPS only supports UTF-8 currently so we convert
+ // We also assume that String is always utf-16 - correct ?
+ String str = (String) doc.getPrintData();
+ request.setData(str.getBytes("utf-16"));
+ response = request.send();
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ notifyPrintJobListeners(new PrintJobEvent(this, PrintJobEvent.JOB_FAILED));
+ throw new PrintFlavorException("Invalid charset of flavor", e, new DocFlavor[] {flavor});
+ }
+ }
+ else if (className.equals("java.net.URL"))
+ {
+ URL url = (URL) doc.getPrintData();
+ InputStream stream = url.openStream();
+ request.setData(stream);
+ response = request.send();
+ stream.close();
+ }
+ else if (className.equals("java.awt.image.renderable.RenderableImage")
+ || className.equals("java.awt.print.Printable")
+ || className.equals("java.awt.print.Pageable"))
+ {
+ // For the future :-)
+ throw new PrintException("Not yet supported.");
+ }
+ else
+ {
+ // should not happen - however
+ notifyPrintJobListeners(new PrintJobEvent(this, PrintJobEvent.JOB_FAILED));
+ throw new PrintFlavorException("Invalid flavor", new DocFlavor[] {flavor});
+ }
+
+ // at this point the data is transfered
+ notifyPrintJobListeners(new PrintJobEvent(
+ this, PrintJobEvent.DATA_TRANSFER_COMPLETE));
+ }
+ catch (IOException e)
+ {
+ throw new PrintException("IOException occured.", e);
+ }
+
+ int status = response.getStatusCode();
+ if (! (status == IppStatusCode.SUCCESSFUL_OK
+ || status == IppStatusCode.SUCCESSFUL_OK_IGNORED_OR_SUBSTITUED_ATTRIBUTES
+ || status == IppStatusCode.SUCCESSFUL_OK_CONFLICTING_ATTRIBUTES) )
+ {
+ notifyPrintJobListeners(new PrintJobEvent(
+ this, PrintJobEvent.JOB_FAILED));
+ throw new PrintException("Printing failed - received statuscode " + Integer.toHexString(status));
+
+ // TODO maybe specific status codes may require to throw a specific
+ // detailed attribute exception
+ }
+ else
+ {
+ // start print job progress monitoring thread
+ // FIXME Implement
+
+ // for now we just notify as finished
+ notifyPrintJobListeners(
+ new PrintJobEvent(this, PrintJobEvent.JOB_COMPLETE));
+ }
+
+ List jobAtts = response.getJobAttributes();
+
+ // extract the uri and id of job for canceling and further monitoring
+ Map jobAttributes = (Map) jobAtts.get(0);
+ jobUri = (JobUri) ((HashSet)jobAttributes.get(JobUri.class)).toArray()[0];
+ jobId = (JobId) ((HashSet)jobAttributes.get(JobId.class)).toArray()[0];
+ }
+
+ /**
+ * @see DocPrintJob#removePrintJobAttributeListener(PrintJobAttributeListener)
+ */
+ public void removePrintJobAttributeListener(PrintJobAttributeListener listener)
+ {
+ if (listener == null)
+ return;
+
+ int index = attributesListener.indexOf(listener);
+ if (index != -1)
+ {
+ attributesListener.remove(index);
+ attributesListenerAttributes.remove(index);
+ }
+ }
+
+ /**
+ * @see DocPrintJob#removePrintJobListener(PrintJobListener)
+ */
+ public void removePrintJobListener(PrintJobListener listener)
+ {
+ if (listener == null)
+ return;
+
+ printJobListener.remove(listener);
+ }
+
+ /**
+ * @see CancelablePrintJob#cancel()
+ */
+ public void cancel() throws PrintException
+ {
+ if (jobUri == null)
+ {
+ throw new PrintException("print job is not yet send");
+ }
+
+ IppResponse response = null;
+
+ try
+ {
+ IppRequest request = new IppRequest(jobUri.getURI(), username, password);
+ request.setOperationID( (short) OperationsSupported.CANCEL_JOB.getValue());
+ request.setOperationAttributeDefaults();
+ request.addOperationAttribute(jobUri);
+ request.addOperationAttribute(requestingUser);
+ response = request.send();
+ }
+ catch (IOException e)
+ {
+ throw new IppException("IOException occured during cancel request.", e);
+ }
+
+ int status = response.getStatusCode();
+ if (! (status == IppStatusCode.SUCCESSFUL_OK
+ || status == IppStatusCode.SUCCESSFUL_OK_IGNORED_OR_SUBSTITUED_ATTRIBUTES
+ || status == IppStatusCode.SUCCESSFUL_OK_CONFLICTING_ATTRIBUTES) )
+ {
+ notifyPrintJobListeners(new PrintJobEvent(
+ this, PrintJobEvent.JOB_FAILED));
+ throw new PrintException("Canceling failed - received statuscode " + Integer.toHexString(status));
+ }
+ else
+ {
+ notifyPrintJobListeners(new PrintJobEvent(
+ this, PrintJobEvent.JOB_CANCELED));
+ }
+ }
+
+ private void notifyPrintJobListeners(PrintJobEvent e)
+ {
+ Iterator it = printJobListener.iterator();
+ while (it.hasNext())
+ {
+ PrintJobListener l = (PrintJobListener) it.next();
+ if (e.getPrintEventType() == PrintJobEvent.DATA_TRANSFER_COMPLETE)
+ l.printDataTransferCompleted(e);
+ else if (e.getPrintEventType() == PrintJobEvent.JOB_CANCELED)
+ l.printJobCanceled(e);
+ else if (e.getPrintEventType() == PrintJobEvent.JOB_COMPLETE)
+ l.printJobCompleted(e);
+ else if (e.getPrintEventType() == PrintJobEvent.JOB_FAILED)
+ l.printJobFailed(e);
+ else if (e.getPrintEventType() == PrintJobEvent.NO_MORE_EVENTS)
+ l.printJobNoMoreEvents(e);
+ else
+ l.printJobRequiresAttention(e);
+ }
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/IppDelimiterTag.java b/libjava/classpath/gnu/javax/print/ipp/IppDelimiterTag.java
new file mode 100644
index 000000000..1c074a8dd
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/IppDelimiterTag.java
@@ -0,0 +1,99 @@
+/* IppDelimiterTag.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp;
+
+
+/**
+ * IPP Delimiter Tags as described in RFC 2910 section 3.5.1.
+ *
+ * The end-of-attributes-tag signals the end of the attributes
+ * section in the IPP request/response and therefore the beginning
+ * of the data section (if any).
+ * true
if, false
otherwise.
+ */
+ public static boolean isDelimiterTag(byte value)
+ {
+ if (value >= 0x01 && value <= 0x05)
+ return true;
+
+ return false;
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/IppException.java b/libjava/classpath/gnu/javax/print/ipp/IppException.java
new file mode 100644
index 000000000..c34a8f227
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/IppException.java
@@ -0,0 +1,88 @@
+/* IppException.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp;
+
+import javax.print.PrintException;
+
+/**
+ * IppException
signals exception thrown by
+ * the IPP implementation for various things like a failed
+ * ipp request or a wrapped io exception.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public class IppException extends PrintException
+{
+ /**
+ * Creates an IppException
.
+ */
+ public IppException()
+ {
+ super();
+ }
+
+ /**
+ * Creates an IppException
.
+ * @param s the message of the exception.
+ */
+ public IppException(String s)
+ {
+ super(s);
+ }
+
+ /**
+ * Creates an IppException
.
+ * @param e the exception cause this one.
+ */
+ public IppException(Exception e)
+ {
+ super(e);
+ }
+
+ /**
+ * Creates an IppException
.
+ * @param s the message of the exception.
+ * @param e the exception cause this one.
+ */
+ public IppException(String s, Exception e)
+ {
+ super(s, e);
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/IppMultiDocPrintService.java b/libjava/classpath/gnu/javax/print/ipp/IppMultiDocPrintService.java
new file mode 100644
index 000000000..59c3408d5
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/IppMultiDocPrintService.java
@@ -0,0 +1,87 @@
+/* IppMultiDocPrintService.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp;
+
+
+import java.net.URI;
+
+import javax.print.MultiDocPrintJob;
+import javax.print.MultiDocPrintService;
+
+/**
+ * Implementation of the MultiDocPrintService interface
+ * for IPP based printers.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public class IppMultiDocPrintService extends IppPrintService
+ implements MultiDocPrintService
+{
+ /** The username. */
+ private transient String user;
+
+ /** The password of the user. */
+ private transient String passwd;
+
+ /**
+ * Creates a IppMultiDocPrintService
object.
+ *
+ * @param uri the URI of the IPP printer.
+ * @param username the user of this print service.
+ * @param password the password of the user.
+ *
+ * @throws IppException if an error during connection occurs.
+ */
+ public IppMultiDocPrintService(URI uri, String username, String password)
+ throws IppException
+ {
+ super(uri, username, password);
+ user = username;
+ passwd = password;
+ }
+
+ /**
+ * @see MultiDocPrintService#createMultiDocPrintJob()
+ */
+ public MultiDocPrintJob createMultiDocPrintJob()
+ {
+ return new MultiDocPrintJobImpl(this, user, passwd);
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/IppPrintService.java b/libjava/classpath/gnu/javax/print/ipp/IppPrintService.java
new file mode 100644
index 000000000..9ce41c774
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/IppPrintService.java
@@ -0,0 +1,924 @@
+/* IppPrintService.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp;
+
+import gnu.classpath.SystemProperties;
+import gnu.classpath.debug.Component;
+import gnu.classpath.debug.SystemLogger;
+import gnu.javax.print.ipp.attribute.DefaultValueAttribute;
+import gnu.javax.print.ipp.attribute.RequestedAttributes;
+import gnu.javax.print.ipp.attribute.defaults.CopiesDefault;
+import gnu.javax.print.ipp.attribute.defaults.FinishingsDefault;
+import gnu.javax.print.ipp.attribute.defaults.JobHoldUntilDefault;
+import gnu.javax.print.ipp.attribute.defaults.JobPriorityDefault;
+import gnu.javax.print.ipp.attribute.defaults.JobSheetsDefault;
+import gnu.javax.print.ipp.attribute.defaults.MediaDefault;
+import gnu.javax.print.ipp.attribute.defaults.MultipleDocumentHandlingDefault;
+import gnu.javax.print.ipp.attribute.defaults.NumberUpDefault;
+import gnu.javax.print.ipp.attribute.defaults.OrientationRequestedDefault;
+import gnu.javax.print.ipp.attribute.defaults.PrintQualityDefault;
+import gnu.javax.print.ipp.attribute.defaults.PrinterResolutionDefault;
+import gnu.javax.print.ipp.attribute.defaults.SidesDefault;
+import gnu.javax.print.ipp.attribute.printer.DocumentFormat;
+import gnu.javax.print.ipp.attribute.supported.CompressionSupported;
+import gnu.javax.print.ipp.attribute.supported.DocumentFormatSupported;
+import gnu.javax.print.ipp.attribute.supported.FinishingsSupported;
+import gnu.javax.print.ipp.attribute.supported.JobHoldUntilSupported;
+import gnu.javax.print.ipp.attribute.supported.JobSheetsSupported;
+import gnu.javax.print.ipp.attribute.supported.MediaSupported;
+import gnu.javax.print.ipp.attribute.supported.MultipleDocumentHandlingSupported;
+import gnu.javax.print.ipp.attribute.supported.OperationsSupported;
+import gnu.javax.print.ipp.attribute.supported.OrientationRequestedSupported;
+import gnu.javax.print.ipp.attribute.supported.PageRangesSupported;
+import gnu.javax.print.ipp.attribute.supported.PrintQualitySupported;
+import gnu.javax.print.ipp.attribute.supported.PrinterResolutionSupported;
+import gnu.javax.print.ipp.attribute.supported.PrinterUriSupported;
+import gnu.javax.print.ipp.attribute.supported.SidesSupported;
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import javax.print.DocFlavor;
+import javax.print.DocPrintJob;
+import javax.print.PrintService;
+import javax.print.ServiceUIFactory;
+import javax.print.attribute.Attribute;
+import javax.print.attribute.AttributeSet;
+import javax.print.attribute.AttributeSetUtilities;
+import javax.print.attribute.HashAttributeSet;
+import javax.print.attribute.HashPrintServiceAttributeSet;
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.PrintServiceAttribute;
+import javax.print.attribute.PrintServiceAttributeSet;
+import javax.print.attribute.standard.Compression;
+import javax.print.attribute.standard.Copies;
+import javax.print.attribute.standard.CopiesSupported;
+import javax.print.attribute.standard.Fidelity;
+import javax.print.attribute.standard.Finishings;
+import javax.print.attribute.standard.JobHoldUntil;
+import javax.print.attribute.standard.JobImpressions;
+import javax.print.attribute.standard.JobImpressionsSupported;
+import javax.print.attribute.standard.JobKOctets;
+import javax.print.attribute.standard.JobKOctetsSupported;
+import javax.print.attribute.standard.JobMediaSheets;
+import javax.print.attribute.standard.JobMediaSheetsSupported;
+import javax.print.attribute.standard.JobName;
+import javax.print.attribute.standard.JobPriority;
+import javax.print.attribute.standard.JobPrioritySupported;
+import javax.print.attribute.standard.JobSheets;
+import javax.print.attribute.standard.Media;
+import javax.print.attribute.standard.MultipleDocumentHandling;
+import javax.print.attribute.standard.NumberUp;
+import javax.print.attribute.standard.NumberUpSupported;
+import javax.print.attribute.standard.OrientationRequested;
+import javax.print.attribute.standard.PageRanges;
+import javax.print.attribute.standard.PrintQuality;
+import javax.print.attribute.standard.PrinterName;
+import javax.print.attribute.standard.PrinterResolution;
+import javax.print.attribute.standard.PrinterURI;
+import javax.print.attribute.standard.RequestingUserName;
+import javax.print.attribute.standard.Sides;
+import javax.print.event.PrintServiceAttributeListener;
+
+
+/**
+ * Implementation of the PrintService interface
+ * for IPP based printers.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public class IppPrintService implements PrintService
+{
+ /**
+ * A Map with sets of attributes.
+ * key: A attribute category
+ * value: A set with values
+ *
+ * IPP may return sets of attributes e.g. for supported
+ * compression methods so we need to map to sets here.
+ */
+ private MapIppPrintService
object.
+ *
+ * @param uri the URI of the IPP printer.
+ * @param username the user of this print service.
+ * @param password the password of the user.
+ *
+ * @throws IppException if an error during connection occurs.
+ */
+ public IppPrintService(URI uri, String username, String password)
+ throws IppException
+ {
+ printerUri = new PrinterURI(uri);
+ user = username;
+ passwd = password;
+
+ printServiceAttributeListener =
+ new HashSetDefaultValueAttribute
.
+ */
+ private Attribute getPrinterDefaultAttribute(Class extends Attribute> attributeClass)
+ {
+ SetPrinterName
here.
+ * @see javax.print.PrintService#getName()
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * We currently provide no factories - just returns null.
+ * @see javax.print.PrintService#getServiceUIFactory()
+ */
+ public ServiceUIFactory getServiceUIFactory()
+ {
+ // SUN does not provide any service factory for
+ // print services (tested on linux/windows)
+
+ // for the moment we do the same - just return null
+ // later on we could provide at least the about UI dialog
+ return null;
+ }
+
+ /**
+ * @see javax.print.PrintService#getSupportedAttributeCategories()
+ */
+ public Class>[] getSupportedAttributeCategories()
+ {
+ SethandleSupportedAttributeValuesResponse(IppResponse, Class)
only.
+ *
+ * @see PrintService#getSupportedAttributeValues(Class, DocFlavor, AttributeSet)
+ * @see #handleSupportedAttributeValuesResponse(IppResponse, Class)
+ */
+ public Object getSupportedAttributeValues(Class extends Attribute> category,
+ DocFlavor flavor, AttributeSet attributes)
+ {
+ // We currently ignore the attribute set - there is nothing in the IPP
+ // specification which would come closer to what we do here.
+
+ if (category == null)
+ throw new NullPointerException("category may not be null");
+
+ if (!Attribute.class.isAssignableFrom(category))
+ throw new IllegalArgumentException("category must be of type Attribute");
+
+ if (flavor != null && !isDocFlavorSupported(flavor))
+ throw new IllegalArgumentException("flavor is not supported");
+
+ if (!isAttributeCategorySupported(category))
+ return null;
+
+ // always supported
+ if (category.equals(Fidelity.class))
+ return new Fidelity[] { Fidelity.FIDELITY_FALSE, Fidelity.FIDELITY_TRUE };
+ if (category.equals(JobName.class))
+ return JOB_NAME;
+ if (category.equals(RequestingUserName.class))
+ return REQUESTING_USER_NAME;
+
+ // map category to category-supported
+ String categoryName = IppUtilities.getSupportedAttrName(category);
+
+ IppResponse response = null;
+ try
+ {
+ IppRequest request = new IppRequest(printerUri.getURI(), user, passwd);
+ request.setOperationID(
+ (short) OperationsSupported.GET_PRINTER_ATTRIBUTES.getValue());
+ request.setOperationAttributeDefaults();
+ request.addOperationAttribute(new RequestedAttributes(categoryName));
+ request.addOperationAttribute(printerUri);
+
+ if (flavor != null)
+ {
+ DocumentFormat f = DocumentFormat.createDocumentFormat(flavor);
+ request.addOperationAttribute(f);
+ }
+
+ response = request.send();
+
+ int status = response.getStatusCode();
+ if (! (status == IppStatusCode.SUCCESSFUL_OK
+ || status == IppStatusCode.SUCCESSFUL_OK_IGNORED_OR_SUBSTITUED_ATTRIBUTES
+ || status == IppStatusCode.SUCCESSFUL_OK_CONFLICTING_ATTRIBUTES) )
+ {
+ logger.log(Component.IPP, "Statuscode not OK - got:" + status);
+ }
+ }
+ catch (IOException e)
+ {
+ // method cannot throw exception - just log
+ logger.log(Component.IPP, "IOException", e);
+ }
+ catch (IppException e)
+ {
+ // method cannot throw exception - just log
+ logger.log(Component.IPP, "IPPException", e);
+ }
+
+ return handleSupportedAttributeValuesResponse(response, category);
+ }
+
+ /**
+ * Called to handle the supported attribute values response for the given
+ * category. This might be overridden by subclasses with different requirements
+ * for parsing/handling the response from the GetPrinterAttributes.
+ *
+ * @param response the response of the GetPrinterAttributes IPP request
+ * @param category the category for which the supported values are requested
+ * @return A object indicating the supported values for the given attribute
+ * category, or null
if this print service doesn't support the
+ * given attribute category at all.
+ *
+ * @see #getSupportedAttributeValues(Class, DocFlavor, AttributeSet)
+ */
+ protected Object handleSupportedAttributeValuesResponse(IppResponse response,
+ Class extends Attribute> category)
+ {
+ List
+ * The syntax value is defined as 11 octets follwing the + * DateAndTime format of RFC 1903. (see IppResponse) + *
+ * + * @param attribute the attribute + * @throws IOException if thrown by the stream + */ + private void write(DateTimeSyntax attribute) throws IOException + { + String name = ((Attribute) attribute).getName(); + out.writeByte(IppValueTag.DATETIME); + out.writeShort(name.length()); + out.write(name.getBytes()); + out.writeShort(11); // length fixed to 11 + + Date date = attribute.getValue(); + Calendar cal = new GregorianCalendar(); + cal.setTime(date); + + out.writeShort(cal.get(Calendar.YEAR)); + out.writeByte(cal.get(Calendar.MONTH)); + out.writeByte(cal.get(Calendar.DAY_OF_MONTH)); + out.writeByte(cal.get(Calendar.HOUR_OF_DAY)); + out.writeByte(cal.get(Calendar.MINUTE)); + int second = cal.get(Calendar.SECOND); + out.writeByte(second == 0 ? 60 : second); + out.writeByte(cal.get(Calendar.MILLISECOND) / 100); + + int offsetInMillis = cal.get(Calendar.ZONE_OFFSET); + char directionFromUTC = '+'; + if (offsetInMillis < 0) + { + directionFromUTC = '-'; + offsetInMillis = offsetInMillis * (-1); + } + + out.writeByte(directionFromUTC); + out.writeByte(offsetInMillis / 3600000); // hours + out.writeByte((offsetInMillis % 3600000) / 60000); // minutes + } + + /** + * Writes an attribute in TextSyntax into the stream. + *+ * By default attributes are qritten as TEXT_WITHOUT_LANGUAGE value-tag. + * As some attributes in the JPS are TextSyntax attributes but actually + * of NAME value-tag in IPP this method checks for these attributes and + * writes them as NAME_WITHOUT_LANGUAGE value-tag into the stream. + *
+ * + * @param attribute the attribute + * @param out the stream to write to + * @throws IOException if thrown by the stream + */ + private void write(TextSyntax attribute) throws IOException + { + // We only use *WithoutLanguage, correct according to spec. + String name = ((Attribute) attribute).getName(); + + if (attribute instanceof RequestingUserName + || attribute instanceof JobName + || attribute instanceof DocumentName + || attribute instanceof JobOriginatingUserName) + out.writeByte(IppValueTag.NAME_WITHOUT_LANGUAGE); + else if (attribute instanceof DocumentFormat) + out.writeByte(IppValueTag.MIME_MEDIA_TYPE); + else + out.writeByte(IppValueTag.TEXT_WITHOUT_LANGUAGE); + + out.writeShort(name.length()); + out.write(name.getBytes()); + out.writeShort(attribute.getValue().length()); + out.write(attribute.getValue().getBytes()); + } + + /** + * Writes an attribute in URISyntax into the stream. + * @param attribute the attribute + * @param out the stream to write to + * @throws IOException if thrown by the stream + */ + private void write(URISyntax attribute) throws IOException + { + // only uriScheme syntax type should not appear + // in a request (reference-uri-schemes-supported) + String name = ((Attribute) attribute).getName(); + String uriAscii = attribute.getURI().toASCIIString(); + out.writeByte(IppValueTag.URI); + out.writeShort(name.length()); + out.write(name.getBytes()); + out.writeShort(uriAscii.length()); + out.write(uriAscii.getBytes()); + } + + /** + * Writes an attribute in CharsetSyntax into the stream. + * @param attribute the attribute + * @param out the stream to write to + * @throws IOException if thrown by the stream + */ + private void write(CharsetSyntax attribute) throws IOException + { + String name = ((Attribute) attribute).getName(); + out.writeByte(IppValueTag.CHARSET); + out.writeShort(name.length()); + out.write(name.getBytes()); + out.writeShort(attribute.getValue().length()); + out.write(attribute.getValue().getBytes()); + } + + /** + * Writes an attribute in NaturalLanguageSyntax into the stream. + * @param attribute the attribute + * @param out the stream to write to + * @throws IOException if thrown by the stream + */ + private void write(NaturalLanguageSyntax attribute) throws IOException + { + String name = ((Attribute) attribute).getName(); + out.writeByte(IppValueTag.NATURAL_LANGUAGE); + out.writeShort(name.length()); + out.write(name.getBytes()); + out.writeShort(attribute.getValue().length()); + out.write(attribute.getValue().getBytes()); + } + + /** + * Writes an attribute in RequestedAttributes into the stream. + * @param attribute the attribute + * @param out the stream to write to + * @throws IOException if thrown by the stream + */ + private void write(RequestedAttributes attribute) throws IOException + { + String[] values = attribute.getValues(); + + String name = ((Attribute) attribute).getName(); + out.writeByte(IppValueTag.KEYWORD); + out.writeShort(name.length()); + out.write(name.getBytes()); + out.writeShort(values[0].length()); + out.write(values[0].getBytes()); + + for (int i=1; i < values.length; i++) + { + out.writeByte(IppValueTag.KEYWORD); + out.writeShort(0x0000); // length for additional value + out.writeShort(values[i].length()); + out.write(values[i].getBytes()); + } + } + + + /** + * Writes the given operation attribute group of the given map instance + * (key=group, values=set of attributes) into the supplied data + * output stream. + * + * @param attributes the set with the attributes. + * + * @throws IOException if thrown by the used DataOutputStream. + * @throws IppException if unknown attributes occur. + */ + public void writeOperationAttributes(AttributeSet attributes) + throws IOException, IppException + { + out.write(IppDelimiterTag.OPERATION_ATTRIBUTES_TAG); + + // its essential to write these two in this order and as first ones + Attribute att = attributes.get(AttributesCharset.class); + write((CharsetSyntax) att); + + logger.log(Component.IPP, "Attribute: Name: <" + + att.getCategory().getName() + "> Value: <" + att.toString() + ">"); + + attributes.remove(AttributesCharset.class); + + att = attributes.get(AttributesNaturalLanguage.class); + write((NaturalLanguageSyntax) att); + attributes.remove(AttributesNaturalLanguage.class); + + logger.log(Component.IPP, "Attribute: Name: <" + + att.getCategory().getName() + "> Value: <" + att.toString() + ">"); + + // furthermore its essential to now write out the target attribute + PrinterURI printerUri = (PrinterURI) attributes.get(PrinterURI.class); + JobUri jobUri = (JobUri) attributes.get(JobUri.class); + JobId jobId = (JobId) attributes.get(JobId.class); + RequestedAttributes reqAttrs + = (RequestedAttributes)attributes.get(RequestedAttributes.class); + if (printerUri != null && jobId == null && jobUri == null) + { + write(printerUri); + attributes.remove(PrinterURI.class); + logger.log(Component.IPP, "Attribute: Name: <" + printerUri + .getCategory().getName() + "> Value: <" + printerUri.toString() + ">"); + } + else if (jobUri != null && jobId == null && printerUri == null) + { + write(jobUri); + attributes.remove(JobUri.class); + logger.log(Component.IPP, "Attribute: Name: <" + jobUri + .getCategory().getName() + "> Value: <" + jobUri.toString() + ">"); + } + else if (printerUri != null && jobId != null && jobUri == null) + { + write(printerUri); // must be third + write(jobId); + attributes.remove(PrinterURI.class); + attributes.remove(JobId.class); + logger.log(Component.IPP, "Attribute: Name: <" + printerUri + .getCategory().getName() + "> Value: <" + printerUri.toString() + ">"); + logger.log(Component.IPP, "Attribute: Name: <" + jobId.getCategory() + .getName() + "> Value: <" + jobId.toString() + ">"); + } + else if (jobUri != null && jobId != null) + { + write(jobUri); + attributes.remove(JobUri.class); + attributes.remove(JobId.class); // MUST NOT redundant + logger.log(Component.IPP, "Attribute: Name: <" + jobUri.getCategory() + .getName() + "> Value: <" + jobUri.toString() + ">"); + } + else if (reqAttrs != null) + { + write(reqAttrs); + attributes.remove(RequestedAttributes.class); + logger.log(Component.IPP, "RequestedAttributes: <" + reqAttrs + ">"); + } + else + { + throw new IppException("Unknown target operation attribute combination."); + } + + writeAttributes(attributes); + } + + /** + * Writes the given attribute groups of the given map instance + * (key=group, values=set of attributes) into the supplied data + * output stream. + * + * @param attributes the set with the attributes. + * + * @throws IOException if thrown by the used DataOutputStream. + * @throws IppException if unknown attributes occur. + */ + public void writeAttributes(AttributeSet attributes) + throws IOException, IppException + { + Attribute[] attributeArray = attributes.toArray(); + for (int i = 0; i < attributeArray.length; i++) + { + logger.log(Component.IPP, "Attribute: Name: <" + attributeArray[i] + .getCategory().getName() + "> Value: <" + + attributeArray[i].toString() + ">"); + + if (attributeArray[i] instanceof IntegerSyntax) + write((IntegerSyntax) attributeArray[i]); + else if (attributeArray[i] instanceof TextSyntax) + write((TextSyntax) attributeArray[i]); + else if (attributeArray[i] instanceof DateTimeSyntax) + write((DateTimeSyntax) attributeArray[i]); + else if (attributeArray[i] instanceof ResolutionSyntax) + write((ResolutionSyntax) attributeArray[i]); + else if (attributeArray[i] instanceof SetOfIntegerSyntax) + write((SetOfIntegerSyntax) attributeArray[i]); + else if (attributeArray[i] instanceof EnumSyntax) + write((EnumSyntax) attributeArray[i]); + else if (attributeArray[i] instanceof URISyntax) + write((URISyntax) attributeArray[i]); + else if (attributeArray[i] instanceof CharsetSyntax) + write((CharsetSyntax) attributeArray[i]); + else if (attributeArray[i] instanceof NaturalLanguageSyntax) + write((NaturalLanguageSyntax) attributeArray[i]); + else if (attributeArray[i] instanceof RequestedAttributes) + write((RequestedAttributes) attributeArray[i]); + else + throw new IppException("Unknown syntax type"); + } + } + + } + + /** + * Logger for tracing - enable by passing + * -Dgnu.classpath.debug.components=ipp to the vm. + */ + static final Logger logger = SystemLogger.SYSTEM; + + /** + * The request id counter simply counts up + * to give unique request ids per JVM instance. + */ + private static int requestIdCounter = 1; + + /** The IPP version defaults to 1.1 */ + private static final short VERSION = 0x0101; + + /** Signals if the request is already on its way */ + private boolean alreadySent = false; + + /** The operation type of this request. */ + private short operation_id; + + /** + * The request id of this request. This is + * assigned automatically by the constructor. + */ + private final int request_id; + + private AttributeSet operationAttributes; + + private AttributeSet printerAttributes; + + private AttributeSet jobAttributes; + + private Object data; + + private URI requestUri; + + /** The underlying connection - IPP is http based */ + private HttpURLConnection connection; + + /** + * Creates an IPPRequest instance. + * + * @param uri the URI of the request + * @param user the user if any + * @param password the password of the supplied user + */ + public IppRequest(URI uri, String user, String password) + { + request_id = incrementRequestIdCounter(); + requestUri = uri; + + try + { + URL url = new URL("http", + user == null + ? uri.getHost() : user + ":" + + password + "@" + uri.getHost(), + uri.getPort(), uri.getPath()); + + connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("POST"); + connection.setDoOutput(true); + + connection.setRequestProperty("Content-type", "application/ipp"); + connection.setRequestProperty("Accept", "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2"); + } + catch (IOException e) + { + // MalformedURLException - uri is already checked + // ProtocolException - POST is correct method type + // IOException -HTTPURLConnection constructor actually + // does never throw this exception. + logger.log(Component.IPP, "Unexpected IOException", e); + } + + logger.log(Component.IPP, "[IppConnection] Host: " + uri.getHost() + + " Port: " + uri.getPort() + " Path: " + + uri.getPath()); + } + + /** + * Synchronized method to be called by the constructor + * to assign a unique request id to this request. + * + * @return The unique request id. + */ + private synchronized int incrementRequestIdCounter() + { + return IppRequest.requestIdCounter++; + } + + /** + * Returns the id of this request. + * + * @return The request ID. + */ + public int getRequestID() + { + return request_id; + } + + /** + * Sets the data of the request. The data used in this + * request will be the one of the supplied inputstream + * instead of the alternative byte array possibility. + * + * @param stream the input stream to use for the data. + */ + public void setData(InputStream stream) + { + data = stream; + } + + /** + * Sets the data of the request. The data used in this + * request will be the one of the supplied byte[] + * instead of the alternative input stream possibility. + * + * @param bytes the byte[] to use for the data. + */ + public void setData(byte[] bytes) + { + data = bytes; + } + + /** + * Sets the operation id for this request. + * + * @param id the operation id. + */ + public void setOperationID(short id) + { + operation_id = id; + } + + /** + * Adds the default values for the operation + * attributes "attributes-charset" and + * "attributes-natural-language" + */ + public void setOperationAttributeDefaults() + { + if (operationAttributes == null) + operationAttributes = new HashAttributeSet(); + + operationAttributes.add(AttributesCharset.UTF8); + operationAttributes.add(AttributesNaturalLanguage.EN); + } + + /** + * Add the job attribute of this request to the given + * attribute set. + * + * @param attribute the job attribute. + */ + public void addJobAttribute(Attribute attribute) + { + if (jobAttributes == null) + jobAttributes = new HashAttributeSet(); + + jobAttributes.add(attribute); + } + + /** + * Sets the printer attribute of this request to the given + * attribute set. + * + * @param attribute the printer attribute. + */ + public void addPrinterAttributes(Attribute attribute) + { + if (printerAttributes == null) + printerAttributes = new HashAttributeSet(); + + printerAttributes.add(attribute); + } + + /** + * Adds the given attribute to the operation attributes set. + * + * @param attribute the operation attribute to add. + */ + public void addOperationAttribute(Attribute attribute) + { + if (operationAttributes == null) + operationAttributes = new HashAttributeSet(); + + operationAttributes.add(attribute); + } + + /** + * Filters from the given attribute set the job operation out + * and adds them to the operation attributes set. + * + * @param set the attributes to filter, may not benull
.
+ */
+ public void addAndFilterJobOperationAttributes(AttributeSet set)
+ {
+ if (operationAttributes == null)
+ operationAttributes = new HashAttributeSet();
+
+ // document-natural-language - not defined in JPS attributes
+ // document-format - specified outside, special treatment
+ Attribute[] tmp = set.toArray();
+ for (int i = 0; i < tmp.length; i++)
+ {
+ if (tmp[i].getCategory().equals(JobName.class)
+ || tmp[i].getCategory().equals(Fidelity.class)
+ || tmp[i].getCategory().equals(JobImpressions.class)
+ || tmp[i].getCategory().equals(JobKOctets.class)
+ || tmp[i].getCategory().equals(JobMediaSheets.class)
+ || tmp[i].getCategory().equals(Compression.class)
+ || tmp[i].getCategory().equals(DocumentName.class)
+ || tmp[i].getCategory().equals(RequestingUserName.class))
+
+ operationAttributes.add(tmp[i]);
+ }
+ }
+
+ /**
+ * Filters from the given attribute set the job template attributes
+ * out and adds them to the job attributes set.
+ *
+ * @param set the attributes to filter, may not be null
.
+ */
+ public void addAndFilterJobTemplateAttributes(AttributeSet set)
+ {
+ if (jobAttributes == null)
+ jobAttributes = new HashAttributeSet();
+
+ // document-natural-language - not defined in JPS attributes
+ // document-format - specified outside, special treatment
+ Attribute[] tmp = set.toArray();
+ for (int i = 0; i < tmp.length; i++)
+ {
+ if (tmp[i].getCategory().equals(JobPriority.class)
+ || tmp[i].getCategory().equals(JobHoldUntil.class)
+ || tmp[i].getCategory().equals(JobSheets.class)
+ || tmp[i].getCategory().equals(MultipleDocumentHandling.class)
+ || tmp[i].getCategory().equals(Copies.class)
+ || tmp[i].getCategory().equals(Finishings.class)
+ || tmp[i].getCategory().equals(PageRanges.class)
+ || tmp[i].getCategory().equals(NumberUp.class)
+ || tmp[i].getCategory().equals(OrientationRequested.class)
+ || tmp[i].getCategory().equals(Media.class)
+ || tmp[i].getCategory().equals(PrinterResolution.class)
+ || tmp[i].getCategory().equals(PrintQuality.class)
+ || tmp[i].getCategory().equals(SheetCollate.class)
+ || tmp[i].getCategory().equals(Sides.class))
+
+ jobAttributes.add(tmp[i]);
+ }
+ }
+
+ /**
+ * Does some validation of the supplied parameters and then
+ * sends the request to the ipp server or service.
+ *
+ * @return The response if any.
+ *
+ * @throws IllegalStateException if request is already sent
+ * @throws IppException if connection or request failed.
+ * @throws IOException if writing of the header, attributes or footer fails.
+ */
+ public IppResponse send() throws IppException, IOException
+ {
+ if (alreadySent)
+ throw new IllegalStateException("Request is already sent");
+
+ alreadySent = true;
+
+ OutputStream stream = connection.getOutputStream();
+ DataOutputStream out = new DataOutputStream(stream);
+
+ // the header 8 bytes long
+ out.writeShort(VERSION);
+ out.writeShort(operation_id);
+ out.writeInt(request_id);
+
+ logger.log(Component.IPP, "OperationID: " + Integer.toHexString(operation_id)
+ + " RequestID: " + request_id);
+
+ // Pass stuff the the attribute writer which knows how to
+ // write the attributes in correct order
+ logger.log(Component.IPP, "Operation Attributes");
+
+ RequestWriter writer = new RequestWriter(out);
+ writer.writeOperationAttributes(operationAttributes);
+
+ if (jobAttributes != null)
+ {
+ logger.log(Component.IPP, "Job Attributes");
+ out.write(IppDelimiterTag.JOB_ATTRIBUTES_TAG);
+ writer.writeAttributes(jobAttributes);
+ }
+ if (printerAttributes != null)
+ {
+ logger.log(Component.IPP, "Printer Attributes");
+ out.write(IppDelimiterTag.PRINTER_ATTRIBUTES_TAG);
+ writer.writeAttributes(printerAttributes);
+ }
+
+ // write the delimiter to the data
+ out.write(IppDelimiterTag.END_OF_ATTRIBUTES_TAG);
+
+ // check if data is byte[] or inputstream
+ if (data instanceof InputStream)
+ {
+ byte[] readbuf = new byte[2048];
+ int len = 0;
+ while( (len = ((InputStream) data).read(readbuf)) > 0)
+ out.write(readbuf, 0, len);
+ }
+ else if (data != null)
+ {
+ out.write((byte[]) data);
+ }
+
+ out.flush();
+ stream.flush();
+
+ // Set the connection timeout, for if the printer is offline.
+ // FIXME: The print services polling should probably be done in its
+ // own thread.
+ connection.setConnectTimeout( timeout );
+
+ int responseCode = connection.getResponseCode();
+
+ if (responseCode == HttpURLConnection.HTTP_OK)
+ {
+ IppResponse response = new IppResponse(requestUri, operation_id);
+ response.setResponseData(connection.getInputStream());
+ return response;
+ }
+
+ logger.log(Component.IPP, "HTTP-Statuscode: " + responseCode);
+
+ throw new IppException("Request failed got HTTP status code "
+ + responseCode);
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/IppResponse.java b/libjava/classpath/gnu/javax/print/ipp/IppResponse.java
new file mode 100644
index 000000000..703bdc1eb
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/IppResponse.java
@@ -0,0 +1,787 @@
+/* IppResponse.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.javax.print.ipp;
+
+import gnu.classpath.debug.Component;
+import gnu.classpath.debug.SystemLogger;
+import gnu.javax.print.ipp.attribute.UnknownAttribute;
+import gnu.javax.print.ipp.attribute.defaults.DocumentFormatDefault;
+import gnu.javax.print.ipp.attribute.defaults.JobHoldUntilDefault;
+import gnu.javax.print.ipp.attribute.defaults.JobSheetsDefault;
+import gnu.javax.print.ipp.attribute.defaults.MediaDefault;
+import gnu.javax.print.ipp.attribute.defaults.PrinterResolutionDefault;
+import gnu.javax.print.ipp.attribute.job.AttributesCharset;
+import gnu.javax.print.ipp.attribute.job.AttributesNaturalLanguage;
+import gnu.javax.print.ipp.attribute.job.JobMoreInfo;
+import gnu.javax.print.ipp.attribute.job.JobPrinterUri;
+import gnu.javax.print.ipp.attribute.job.JobUri;
+import gnu.javax.print.ipp.attribute.printer.CharsetConfigured;
+import gnu.javax.print.ipp.attribute.printer.DocumentFormat;
+import gnu.javax.print.ipp.attribute.printer.NaturalLanguageConfigured;
+import gnu.javax.print.ipp.attribute.printer.PrinterCurrentTime;
+import gnu.javax.print.ipp.attribute.printer.PrinterDriverInstaller;
+import gnu.javax.print.ipp.attribute.supported.CharsetSupported;
+import gnu.javax.print.ipp.attribute.supported.DocumentFormatSupported;
+import gnu.javax.print.ipp.attribute.supported.GeneratedNaturalLanguageSupported;
+import gnu.javax.print.ipp.attribute.supported.JobHoldUntilSupported;
+import gnu.javax.print.ipp.attribute.supported.JobSheetsSupported;
+import gnu.javax.print.ipp.attribute.supported.MediaSupported;
+import gnu.javax.print.ipp.attribute.supported.PrinterResolutionSupported;
+import gnu.javax.print.ipp.attribute.supported.PrinterUriSupported;
+
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.standard.CopiesSupported;
+import javax.print.attribute.standard.DateTimeAtCompleted;
+import javax.print.attribute.standard.DateTimeAtCreation;
+import javax.print.attribute.standard.DateTimeAtProcessing;
+import javax.print.attribute.standard.JobImpressionsSupported;
+import javax.print.attribute.standard.JobKOctetsSupported;
+import javax.print.attribute.standard.JobMediaSheetsSupported;
+import javax.print.attribute.standard.JobStateReason;
+import javax.print.attribute.standard.JobStateReasons;
+import javax.print.attribute.standard.NumberUpSupported;
+import javax.print.attribute.standard.PrinterMoreInfo;
+import javax.print.attribute.standard.PrinterMoreInfoManufacturer;
+import javax.print.attribute.standard.PrinterStateReason;
+import javax.print.attribute.standard.PrinterStateReasons;
+import javax.print.attribute.standard.Severity;
+
+/**
+ * IppResponse
models a response received from an IPP
+ * compatible server as described in RFC 2910 IPP 1.1 Encoding and Transport.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public class IppResponse
+{
+
+ /**
+ * ResponseReader
is responsible for parsing an IPP 1.1
+ * response stream. It provides access to the attribute groups after parsing
+ * via getter methods.
+ * + * The enconding of a response is structured as follows (for an official + * description please have a look at the RFC document mentioned above): + *
+ * Where each attribute-group (if any) is encoded as follows: + *
+ * Encoding of attributes: + *
+ * Encoding of attribute-with-one-value: + *
+ * Encoding of additional value: + *
+ * The syntax value is defined as 11 octets follwing the DateAndTime format + * of RFC 1903: + *
IppResponse
instance.
+ *
+ * @param uri the uri the request was directy to.
+ * @param operation_id the operation id of the request.
+ */
+ public IppResponse(URI uri, short operation_id)
+ {
+ this.uri = uri;
+ this.operation_id = operation_id;
+ operationAttributes =
+ new ArrayList+ * Also provides mapping from the attribute name values to + * the actual class object. Used to construct objects via reflection. + *
+ * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class IppUtilities +{ + // These are reused in the reflection code to not instantiate an array everytime + private static Object[] INTEGER_ATT_VALUE = new Object[1]; + private static Class>[] INTEGER_CLASS_ARRAY = new Class[] {int.class}; + private static Object[] TEXT_ATT_VALUE = new Object[2]; + private static Class>[] TEXT_CLASS_ARRAY = new Class[] {String.class, Locale.class}; + + // The map -> Attribute name to Attribute class + private static HashMapClass
object.
+ */
+ public static Class extends Attribute> getClass(String name)
+ {
+ return classesByName.get(name);
+ }
+
+ /**
+ * Returns the name of the supported attribute
+ * based on the given standard attribute category.
+ *
+ * @param clazz the standard attribute category
+ * @return The name of the supported attribute category.
+ */
+ public static String getSupportedAttrName(Class extends Attribute> clazz)
+ {
+ return instanceByClass.get(clazz).getName();
+ }
+
+ /**
+ * Returns the category of the supported attribute
+ * based on the given standard attribute category.
+ *
+ * @param clazz the standard attribute category
+ * @return The supported attribute category.
+ */
+ public static Class extends Attribute> getSupportedCategory(Class extends Attribute> clazz)
+ {
+ return instanceByClass.get(clazz).getCategory();
+ }
+
+ /**
+ * Helper method to convert to an int.
+ * @param b the byte array
+ * @return The converted int.
+ */
+ public static int convertToInt(byte[] b)
+ {
+ return (((b[0] & 0xff) << 24) | ((b[1] & 0xff) << 16)
+ | ((b[2] & 0xff) << 8) | (b[3] & 0xff));
+ }
+
+ /**
+ * Helper method to convert to an int.
+ * @param b1 the 1th byte
+ * @param b2 the 2th byte
+ * @param b3 the 3th byte
+ * @param b4 the 4th byte
+ * @return The converted int.
+ */
+ public static int convertToInt(byte b1, byte b2, byte b3, byte b4)
+ {
+ return (((b1 & 0xff) << 24) | ((b2 & 0xff) << 16)
+ | ((b3 & 0xff) << 8) | (b4 & 0xff));
+ }
+
+ /**
+ * Helper method to convert to a short.
+ * @param b1 the 1th byte
+ * @param b2 the 2th byte
+ * @return The converted short.
+ */
+ public static short convertToShort(byte b1, byte b2)
+ {
+ return (short) ((b1 << 8) | (b2 & 0xff));
+ }
+
+ /**
+ * Instantiates an EnumSyntax
based attribute with the given IPP
+ * name and the given value (Enums maybe int or String based).
+ *
+ * @param name the attribute name of the subclass.
+ * @param value the integer value of the specific enum.
+ * @return The Attribute (a subclass of EnumSyntax)
+ */
+ public static Attribute getEnumAttribute(String name, Object value)
+ {
+ Class> attrClass = getClass(name);
+
+ // There might be unknown enums we have no mapped class for
+ if (attrClass == null)
+ return null;
+
+ try
+ {
+ Field[] fields = attrClass.getDeclaredFields();
+ for (int i = 0; i < fields.length; i++)
+ {
+ Field field = fields[i];
+ if (field.getType().equals(attrClass))
+ {
+ EnumSyntax attr = (EnumSyntax) field.get(null);
+ if (value instanceof Integer
+ && attr.getValue() == ((Integer) value).intValue())
+ return (Attribute) attr;
+ else if (value instanceof String
+ && attr.toString().equals(value))
+ return (Attribute) attr;
+ }
+ }
+ }
+ catch (SecurityException e)
+ {
+ // should not happen
+ }
+ catch (IllegalArgumentException e)
+ {
+ // should not happen
+ }
+ catch (IllegalAccessException e)
+ {
+ // should not happen, all fields are public
+ }
+
+ return null;
+ }
+
+
+
+ /**
+ * Instantiates an IntegerSyntax
based attribute with the
+ * given IPP name for the given int value.
+ *
+ * @param name the attribute name of the subclass.
+ * @param value the integer value
+ * @return The Attribute (a subclass of IntegerSyntax)
+ */
+ public static Attribute getIntegerAttribute(String name, int value)
+ {
+ Class> attrClass = getClass(name);
+
+ // There might be unknown attributes we have no mapped class for
+ if (attrClass == null)
+ return null;
+
+ try
+ {
+ INTEGER_ATT_VALUE[0] = Integer.valueOf(value);
+ Constructor> c = attrClass.getDeclaredConstructor(INTEGER_CLASS_ARRAY);
+ return (Attribute) c.newInstance(INTEGER_ATT_VALUE);
+ }
+ catch (SecurityException e)
+ {
+ // should not happen
+ }
+ catch (NoSuchMethodException e)
+ {
+ // should not happen
+ }
+ catch (IllegalAccessException e)
+ {
+ // should not happen, all fields are public
+ }
+ catch (InstantiationException e)
+ {
+ // should not happen, all fields are public
+ }
+ catch (InvocationTargetException e)
+ {
+ // should not happen, all fields are public
+ }
+
+ return null;
+ }
+
+ /**
+ * Instantiates an TextSyntax
based attribute with the given
+ * IPP name for the given text value (will be decoded).
+ *
+ * @param name the attribute name of the subclass.
+ * @param tag the tag defined in {@link IppValueTag}
+ * @param value the byte[] value to be decoded based on the tag value.
+ * @return The Attribute (a subclass of TextSyntax)
+ */
+ public static Attribute getTextAttribute(String name, byte tag, byte[] value)
+ {
+ // without language tag is rather easy - default locale
+ if (tag == IppValueTag.NAME_WITHOUT_LANGUAGE
+ || tag == IppValueTag.TEXT_WITHOUT_LANGUAGE)
+ {
+ TEXT_ATT_VALUE[0] = new String(value);
+ TEXT_ATT_VALUE[1] = Locale.getDefault();
+ }
+ else
+ {
+ short langLength = convertToShort(value[0], value[1]);
+ byte[] tmp = new byte[langLength];
+ byte[] tmp2 = new byte[value.length - 4 - langLength];
+ System.arraycopy(value, 2, tmp, 0, langLength);
+
+ // parse into language/region
+ String language = new String(tmp);
+ String text = new String(tmp2);
+ Locale locale = null;
+
+ if (language.length() > 2)
+ locale = new Locale(language.substring(0, 2), language.substring(3));
+ else
+ locale = new Locale(language);
+
+ TEXT_ATT_VALUE[0] = text;
+ TEXT_ATT_VALUE[1] = locale;
+ }
+
+ Class> attrClass = getClass(name);
+
+ // There might be unknown attributes we have no mapped class for
+ if (attrClass == null)
+ return null;
+
+ try
+ {
+ Constructor> c = attrClass.getDeclaredConstructor(TEXT_CLASS_ARRAY);
+ return (Attribute) c.newInstance(TEXT_ATT_VALUE);
+ }
+ catch (SecurityException e)
+ {
+ // should not happen
+ }
+ catch (NoSuchMethodException e)
+ {
+ // should not happen
+ }
+ catch (IllegalAccessException e)
+ {
+ // should not happen, all fields are public
+ }
+ catch (InstantiationException e)
+ {
+ // should not happen, all fields are public
+ }
+ catch (InvocationTargetException e)
+ {
+ // should not happen, all fields are public
+ }
+
+ return null;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/IppValueTag.java b/libjava/classpath/gnu/javax/print/ipp/IppValueTag.java
new file mode 100644
index 000000000..def9545a3
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/IppValueTag.java
@@ -0,0 +1,170 @@
+/* IppValueTag.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp;
+
+/**
+ * IPP Value Tags as described in RFC 2910 section 3.5.2.
+ * + * Attributes are always of a special type syntax (e.g. boolean or + * interger attribute). These value types are specified by the tag + * constants provided in this class. Beside the syntax types some + * out of band values for reporting requested attributes as + * unsupported, unknown etc. back to the client. + *
+ * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class IppValueTag +{ + + /** Out of band value for unsupported attributes. */ + public static final byte UNSUPPORTED = 0x10; + + // 0x11 reserved for 'default' for definition in a future + // IETF standards track document + + /** Out of band value for unknown attributes. */ + public static final byte UNKNOWN = 0x12; + + /** Out of band value for attribute without a value. */ + public static final byte NO_VALUE = 0x13; + + // 0x14-0x1F reserved for "out-of-band" values in future IETF + // standards track documents. + + // 0x20 reserved for definition in a future IETF + // standards track document + + /** Indicates a value of syntax type integer. */ + public static final byte INTEGER = 0x21; + + /** Indicates a value of syntax type boolean. */ + public static final byte BOOLEAN = 0x22; + + /** Indicates a value of syntax type enum (enumeration). */ + public static final byte ENUM = 0x23; + + // 0x24-0x2F reserved for integer types for definition in + // future IETF standards track documents + + /** Indicates a value of syntax type octect string. */ + public static final byte OCTECTSTRING_UNSPECIFIED = 0x30; + + /** Indicates a value of syntax type datetime. */ + public static final byte DATETIME = 0x31; + + /** Indicates a value of syntax type resolution. */ + public static final byte RESOLUTION = 0x32; + + /** Indicates a value of syntax type range of integers. */ + public static final byte RANGEOFINTEGER = 0x33; + + // 0x34 reserved for definition in a future IETF + // standards track document + + /** Indicates a value of syntax type text with language. */ + public static final byte TEXT_WITH_LANGUAGE = 0x35; + + /** Indicates a value of syntax type name with language. */ + public static final byte NAME_WITH_LANGUAGE = 0x36; + + // 0x37-0x3F reserved for octetString type definitions in + // future IETF standards track documents + + // 0x40 reserved for definition in a future IETF + // standards track document + + /** Indicates a value of syntax type text without language. */ + public static final byte TEXT_WITHOUT_LANGUAGE = 0x41; + + /** Indicates a value of syntax type name without language. */ + public static final byte NAME_WITHOUT_LANGUAGE = 0x42; + + // 0x43 reserved for definition in a future IETF + // standards track document + + /** Indicates a value of syntax type keyword. */ + public static final byte KEYWORD = 0x44; + + /** Indicates a value of syntax type URI. */ + public static final byte URI = 0x45; + + /** Indicates a value of syntax type URI scheme. */ + public static final byte URI_SCHEME = 0x46; + + /** Indicates a value of syntax type charset. */ + public static final byte CHARSET = 0x47; + + /** Indicates a value of syntax type language. */ + public static final byte NATURAL_LANGUAGE =0x48; + + /** Indicates a value of syntax type mime media. */ + public static final byte MIME_MEDIA_TYPE = 0x49; + + // 0x4A-0x5F reserved for character string type definitions + // in future IETF standards track documents + + + private IppValueTag() + { + // not to be instantiated; + } + + /** + * Tests if given value corresponds to a + * value tag value. + * + * @param value the value to test for + * @returntrue
if, false
otherwise.
+ */
+ public static boolean isValueTag(byte value)
+ {
+ if(value == 0x10 || value == 0x12 || value == 0x13
+ || value == 0x21 || value == 0x22 || value == 0x23
+ || value == 0x30 || value == 0x31 || value == 0x32
+ || value == 0x33 || value == 0x35 || value == 0x36
+ || value == 0x41 || value == 0x42 || value == 0x44
+ || value == 0x45 || value == 0x46 || value == 0x47
+ || value == 0x48 || value == 0x49 )
+ return true;
+
+ return false;
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/MultiDocPrintJobImpl.java b/libjava/classpath/gnu/javax/print/ipp/MultiDocPrintJobImpl.java
new file mode 100644
index 000000000..89163dc99
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/MultiDocPrintJobImpl.java
@@ -0,0 +1,80 @@
+/* MultiDocPrintJobImpl.java -- GNU implementation of MultiDocPrintJob
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp;
+
+
+import javax.print.MultiDoc;
+import javax.print.MultiDocPrintJob;
+import javax.print.PrintException;
+import javax.print.attribute.PrintRequestAttributeSet;
+
+/**
+ * Implementation of the MultiDocPrintJob interface. Implementation
+ * is specific to the IppPrintService
implementation.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public class MultiDocPrintJobImpl extends DocPrintJobImpl
+ implements MultiDocPrintJob
+{
+
+ /**
+ * Constructor forwarding arguments to the super constructor.
+ *
+ * @param service the print service instance.
+ * @param user the user of this print service.
+ * @param passwd the password of the user.
+ */
+ public MultiDocPrintJobImpl(IppPrintService service, String user,
+ String passwd)
+ {
+ super(service, user, passwd);
+ }
+
+ /**
+ * @see MultiDocPrintJob#print(MultiDoc, PrintRequestAttributeSet)
+ */
+ public void print(MultiDoc multiDoc, PrintRequestAttributeSet attributes)
+ throws PrintException
+ {
+ // FIXME Implement
+ throw new PrintException("Multidoc not yet supported by implementation.");
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/CharsetSyntax.java b/libjava/classpath/gnu/javax/print/ipp/attribute/CharsetSyntax.java
new file mode 100644
index 000000000..cd112f459
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/CharsetSyntax.java
@@ -0,0 +1,115 @@
+/* CharsetSyntax.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute;
+
+import java.io.Serializable;
+
+/**
+ * CharsetSyntax
is the abstract base class of all attribute
+ * classes which provide a charset (US-ASCII) string as value.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public abstract class CharsetSyntax implements Cloneable, Serializable
+{
+ private final String value;
+
+ /**
+ * Creates a CharsetSyntax
object with the given value
+ * and locale.
+ *
+ * @param value the value for this syntax
+ *
+ * @exception NullPointerException if value is null
+ */
+ protected CharsetSyntax(String value)
+ {
+ if (value == null)
+ throw new NullPointerException("value may not be null");
+
+ this.value = value;
+ }
+
+ /**
+ * Returns the value of this syntax object.
+ *
+ * @return The value.
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /**
+ * Returns the hashcode for this object.
+ *
+ * @return The hashcode.
+ */
+ public int hashCode()
+ {
+ return value.hashCode();
+ }
+
+ /**
+ * Tests if the given object is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @return true if both objects are equal, false otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if (! (obj instanceof CharsetSyntax))
+ return false;
+
+ CharsetSyntax tmp = (CharsetSyntax) obj;
+ return value.equals(tmp.getValue());
+ }
+
+ /**
+ * Returns a string representing the object. The returned
+ * string is the underlying text value of this object.
+ *
+ * @return The string representation.
+ */
+ public String toString()
+ {
+ return getValue();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/DefaultValueAttribute.java b/libjava/classpath/gnu/javax/print/ipp/attribute/DefaultValueAttribute.java
new file mode 100644
index 000000000..cc40db22e
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/DefaultValueAttribute.java
@@ -0,0 +1,59 @@
+/* DefaultValueAttribute.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute;
+
+import javax.print.attribute.Attribute;
+
+/**
+ * Marker interface for all attribute classes describing attributes
+ * providing default values. Often there exist a sequence of an
+ * attribute name like: Name - > Name-default -> Name-supported.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public interface DefaultValueAttribute extends Attribute
+{
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this SupportedValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public Attribute getAssociatedAttribute();
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/DetailedStatusMessage.java b/libjava/classpath/gnu/javax/print/ipp/attribute/DetailedStatusMessage.java
new file mode 100644
index 000000000..2d005a82e
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/DetailedStatusMessage.java
@@ -0,0 +1,93 @@
+/* DetailedStatusMessage.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute;
+
+import java.util.Locale;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * DetailedStatusMessage attribute as described in RFC 2911 section
+ * 3.1.6 Operation Response Status Codes and Status Message
+ * provides a short description of the status of the operation.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class DetailedStatusMessage extends TextSyntax
+ implements Attribute
+{
+
+ /**
+ * Creates a DetailedStatusMessage
object with the given value
+ * and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @exception NullPointerException if value is null
+ */
+ public DetailedStatusMessage(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class DetailedStatusMessage
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return DetailedStatusMessage.class;
+ }
+
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "detailed-status-message".
+ */
+ public String getName()
+ {
+ return "detailed-status-message";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/DocumentAccessError.java b/libjava/classpath/gnu/javax/print/ipp/attribute/DocumentAccessError.java
new file mode 100644
index 000000000..56b55ba76
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/DocumentAccessError.java
@@ -0,0 +1,93 @@
+/* DocumentAccessError.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute;
+
+import java.util.Locale;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * DocumentAccessError attribute as described in RFC 2911 section
+ * 3.1.6 Operation Response Status Codes and Status Message
+ * provides additional information for document access errors.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class DocumentAccessError extends TextSyntax
+ implements Attribute
+{
+
+ /**
+ * Creates a DocumentAccessError
object with the given value
+ * and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @exception NullPointerException if value is null
+ */
+ public DocumentAccessError(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class DocumentAccessError
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return DocumentAccessError.class;
+ }
+
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "document-access-error".
+ */
+ public String getName()
+ {
+ return "document-access-error";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/NaturalLanguageSyntax.java b/libjava/classpath/gnu/javax/print/ipp/attribute/NaturalLanguageSyntax.java
new file mode 100644
index 000000000..a648c8cec
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/NaturalLanguageSyntax.java
@@ -0,0 +1,117 @@
+/* NaturalLanguageSyntax.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute;
+
+import java.io.Serializable;
+
+/**
+ * NaturalLanguageSyntax
is the abstract base class of all
+ * attribute classes which provide a natural language (US-ASCII)
+ * string as value.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public abstract class NaturalLanguageSyntax
+ implements Cloneable, Serializable
+{
+ private final String value;
+
+ /**
+ * Creates a NaturalLanguageSyntax
object with the given value
+ * and locale.
+ *
+ * @param value the value for this syntax
+ *
+ * @exception NullPointerException if value is null
+ */
+ protected NaturalLanguageSyntax(String value)
+ {
+ if (value == null)
+ throw new NullPointerException("value may not be null");
+
+ this.value = value;
+ }
+
+ /**
+ * Returns the value of this syntax object.
+ *
+ * @return The value.
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /**
+ * Returns the hashcode for this object.
+ *
+ * @return The hashcode.
+ */
+ public int hashCode()
+ {
+ return value.hashCode();
+ }
+
+ /**
+ * Tests if the given object is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @return true if both objects are equal, false otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if (! (obj instanceof NaturalLanguageSyntax))
+ return false;
+
+ NaturalLanguageSyntax tmp = (NaturalLanguageSyntax) obj;
+ return value.equals(tmp.getValue());
+ }
+
+ /**
+ * Returns a string representing the object. The returned
+ * string is the underlying text value of this object.
+ *
+ * @return The string representation.
+ */
+ public String toString()
+ {
+ return getValue();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/RequestedAttributes.java b/libjava/classpath/gnu/javax/print/ipp/attribute/RequestedAttributes.java
new file mode 100644
index 000000000..4c129f6d5
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/RequestedAttributes.java
@@ -0,0 +1,132 @@
+/* RequestedAttributes.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute;
+
+import gnu.java.lang.CPStringBuilder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.print.attribute.Attribute;
+
+/**
+ * RequestedAttributes
specifies the requested
+ * attributes in an IPP request operation.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class RequestedAttributes implements Attribute
+{
+ private ArrayListRequestedAttributes
object with
+ * the initial value.
+ *
+ * @param value the string for the ipp name
+ *
+ * @exception NullPointerException if value is null
+ */
+ public RequestedAttributes(String value)
+ {
+ if (value == null)
+ throw new NullPointerException();
+
+ attributes = new ArrayListDocumentFormat
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return RequestedAttributes.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "requested-attributes".
+ */
+ public String getName()
+ {
+ return "requested-attributes";
+ }
+
+ /**
+ * Returns the string representation for this object.
+ *
+ * @return The string representation.
+ */
+ public String toString()
+ {
+ CPStringBuilder b = new CPStringBuilder();
+
+ if (attributes.size() > 0)
+ b.append(attributes.get(0));
+
+ for (int i=1; i < attributes.size(); i++)
+ b.append(", " + attributes.get(i));
+
+ return b.toString();
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/StatusMessage.java b/libjava/classpath/gnu/javax/print/ipp/attribute/StatusMessage.java
new file mode 100644
index 000000000..0701008ef
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/StatusMessage.java
@@ -0,0 +1,92 @@
+/* StatusMessage.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute;
+
+import java.util.Locale;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * StatusMessage attribute as described in RFC 2911 section
+ * 3.1.6 Operation Response Status Codes and Status Message
+ * provides a short description of the status of the operation.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class StatusMessage extends TextSyntax implements Attribute
+{
+
+ /**
+ * Creates a StatusMessage
object with the given value
+ * and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @exception NullPointerException if value is null
+ */
+ public StatusMessage(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class StatusMessage
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return StatusMessage.class;
+ }
+
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "status-message".
+ */
+ public String getName()
+ {
+ return "status-message";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/UnknownAttribute.java b/libjava/classpath/gnu/javax/print/ipp/attribute/UnknownAttribute.java
new file mode 100644
index 000000000..a03beccbe
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/UnknownAttribute.java
@@ -0,0 +1,190 @@
+/* UnknownAttribute.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute;
+
+import gnu.javax.print.ipp.IppUtilities;
+import gnu.javax.print.ipp.IppValueTag;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.print.attribute.Attribute;
+
+/**
+ * UnknownAttribute holds all the parsed Attribute information.
+ * It provides methods to get the value-tag, name and value.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class UnknownAttribute implements Attribute
+{
+ private byte tag;
+ private String name;
+ private byte[] value;
+
+ /**
+ * Creates a UnknownAttribute
object with the given values.
+ *
+ * @param tag the value tag
+ * @param name the attribute name
+ * @param value the byte[] with the value
+ */
+ public UnknownAttribute(byte tag, String name, byte[] value)
+ {
+ this.tag = tag;
+ this.name = name;
+ this.value = value;
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class UnknownAttribute
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return UnknownAttribute.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name attributes IPP name.
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Returns the value tag
+ * @return The tag.
+ *
+ * @see gnu.javax.print.ipp.IppValueTag
+ */
+ public byte getValueTag()
+ {
+ return tag;
+ }
+
+ /**
+ * Returns the name of the attribute.
+ * @return The name.
+ */
+ public String getAttributeName()
+ {
+ return name;
+ }
+
+ /**
+ * Returns the attribute value origin byte array.
+ * @return The value.
+ */
+ public byte[] getAttributeValue()
+ {
+ return value;
+ }
+
+ /**
+ * Returns the attribute value decoded as String.
+ * @return The value as String.
+ */
+ public String getAttributeValueAsString()
+ {
+ return new String(value);
+ }
+
+ /**
+ * Returns the attribute value decoded as int.
+ * @return The value as int.
+ */
+ public int getAttributeValueAsInt()
+ {
+ return IppUtilities.convertToInt(value);
+ }
+
+ /**
+ * Returns the attribute value decoded as an URI.
+ * @return The value as URI.
+ */
+ public URI getAttributeValueAsUri()
+ {
+ try
+ {
+ return new URI(new String(value));
+ }
+ catch (URISyntaxException e)
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Provides a string representation for some default
+ * tag types (e.g. int, rangeofinteger, string, uri).
+ * For other more complex types "No conversion found."
+ * is returned.
+ */
+ public String toString()
+ {
+ switch (tag)
+ {
+ case IppValueTag.INTEGER:
+ return "" + getAttributeValueAsInt();
+ case IppValueTag.RANGEOFINTEGER:
+ int lower = IppUtilities.convertToInt(value[0], value[1],
+ value[2], value[3]);
+ int upper = IppUtilities.convertToInt(value[4], value[5],
+ value[6], value[7]);
+ return lower + "-" + upper;
+ case IppValueTag.URI:
+ return getAttributeValueAsUri().toString();
+ case IppValueTag.KEYWORD:
+ case IppValueTag.URI_SCHEME:
+ case IppValueTag.CHARSET:
+ case IppValueTag.NATURAL_LANGUAGE:
+ case IppValueTag.MIME_MEDIA_TYPE:
+ case IppValueTag.NAME_WITHOUT_LANGUAGE:
+ case IppValueTag.TEXT_WITHOUT_LANGUAGE:
+ return getAttributeValueAsString();
+ default:
+ return "No conversion found.";
+ }
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/CopiesDefault.java b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/CopiesDefault.java
new file mode 100644
index 000000000..39d8fe1c0
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/CopiesDefault.java
@@ -0,0 +1,118 @@
+/* CopiesDefault.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.print.ipp.attribute.defaults;
+
+import gnu.javax.print.ipp.attribute.DefaultValueAttribute;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.standard.Copies;
+
+/**
+ * CopiesDefault
provides the default value
+ * for the copies attribute.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class CopiesDefault extends IntegerSyntax
+ implements DefaultValueAttribute
+{
+
+ /**
+ * Creates a CopiesDefault
object.
+ *
+ * @param value the number of copies
+ *
+ * @exception IllegalArgumentException if value < 1
+ */
+ public CopiesDefault(int value)
+ {
+ super(value);
+
+ if (value < 1)
+ throw new IllegalArgumentException("value may not be less than 1");
+ }
+
+ /**
+ * Tests if the given object is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @return true
if both objects are equal,
+ * false
otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if(! (obj instanceof CopiesDefault))
+ return false;
+
+ return super.equals(obj);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class CopiesDefault
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return CopiesDefault.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "copies-default".
+ */
+ public String getName()
+ {
+ return "copies-default";
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this DefaultValuesAttribute enum.
+ * May return null if no value exists in JPS API.
+ * + * @return The enum of the standard attribute class. + */ + public Attribute getAssociatedAttribute() + { + return new Copies(getValue()); + } +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/DocumentFormatDefault.java b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/DocumentFormatDefault.java new file mode 100644 index 000000000..5eff91498 --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/DocumentFormatDefault.java @@ -0,0 +1,106 @@ +/* DocumentFormatDefault.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.defaults; + +import gnu.javax.print.ipp.attribute.DefaultValueAttribute; +import gnu.javax.print.ipp.attribute.printer.DocumentFormat; + +import java.util.Locale; + +import javax.print.attribute.Attribute; +import javax.print.attribute.TextSyntax; + +/** + *DocumentFormatDefault
specifies the default document
+ * format of a printer.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ *
+ */
+public final class DocumentFormatDefault extends TextSyntax
+ implements DefaultValueAttribute
+{
+
+ /**
+ * Creates a DocumentFormatDefault
object with the
+ * given value and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @exception NullPointerException if value is null
+ */
+ public DocumentFormatDefault(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class DocumentFormatDefault
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return DocumentFormatDefault.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "document-format-default".
+ */
+ public String getName()
+ {
+ return "document-format-default";
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this DefaultValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public Attribute getAssociatedAttribute()
+ {
+ return new DocumentFormat(getValue(), getLocale());
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/FinishingsDefault.java b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/FinishingsDefault.java
new file mode 100644
index 000000000..9d4a06002
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/FinishingsDefault.java
@@ -0,0 +1,263 @@
+/* FinishingsDefault.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.defaults;
+
+import gnu.javax.print.ipp.IppUtilities;
+import gnu.javax.print.ipp.attribute.DefaultValueAttribute;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+
+
+/**
+ * The FinishingsDefault
attribute provides the supported
+ * values for finishings of a job.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class FinishingsDefault extends EnumSyntax
+ implements DefaultValueAttribute
+{
+
+ /** No finishing. */
+ public static final FinishingsDefault NONE = new FinishingsDefault(3);
+
+ /** Staple the document(s) */
+ public static final FinishingsDefault STAPLE = new FinishingsDefault(4);
+
+ /** Cover a document */
+ public static final FinishingsDefault COVER = new FinishingsDefault(6);
+
+ /**
+ * This value indicates that a binding is to be applied to the document.
+ * The type and placement of the binding is site-defined.
+ */
+ public static final FinishingsDefault BIND = new FinishingsDefault(7);
+
+ /**
+ * Bind the document(s) with one or more staples (wire stitches)
+ * along the middle fold.
+ */
+ public static final FinishingsDefault SADDLE_STITCH = new FinishingsDefault(8);
+
+ /**
+ * Bind the document(s) with one or more staples (wire stitches)
+ * along one edge.
+ */
+ public static final FinishingsDefault EDGE_STITCH = new FinishingsDefault(9);
+
+ /**
+ * Bind the document(s) with one or more staples in the top left
+ * corner.
+ */
+ public static final FinishingsDefault STAPLE_TOP_LEFT = new FinishingsDefault(20);
+
+ /**
+ * Bind the document(s) with one or more staples in the bottom
+ * left corner.
+ */
+ public static final FinishingsDefault STAPLE_BOTTOM_LEFT = new FinishingsDefault(21);
+
+ /**
+ * Bind the document(s) with one or more staples in the top right corner.
+ */
+ public static final FinishingsDefault STAPLE_TOP_RIGHT = new FinishingsDefault(22);
+
+ /**
+ * Bind the document(s) with one or more staples in the bottom right corner.
+ */
+ public static final FinishingsDefault STAPLE_BOTTOM_RIGHT = new FinishingsDefault(23);
+
+ /**
+ * Bind the document(s) with one or more staples (wire stitches)
+ * along the left edge.
+ */
+ public static final FinishingsDefault EDGE_STITCH_LEFT = new FinishingsDefault(24);
+
+ /**
+ * Bind the document(s) with one or more staples (wire stitches) along
+ * the top edge.
+ */
+ public static final FinishingsDefault EDGE_STITCH_TOP = new FinishingsDefault(25);
+
+ /**
+ * Bind the document(s) with one or more staples (wire stitches) along
+ * the right edge.
+ */
+ public static final FinishingsDefault EDGE_STITCH_RIGHT = new FinishingsDefault(26);
+
+ /**
+ * Bind the document(s) with one or more staples (wire stitches) along
+ * the bottom edge.
+ */
+ public static final FinishingsDefault EDGE_STITCH_BOTTOM = new FinishingsDefault(27);
+
+ /**
+ * Bind the document(s) with two staples (wire stitches) along the
+ * left edge assuming a portrait document.
+ */
+ public static final FinishingsDefault STAPLE_DUAL_LEFT = new FinishingsDefault(28);
+
+ /**
+ * Bind the document(s) with two staples (wire stitches) along the
+ * top edge assuming a portrait document.
+ */
+ public static final FinishingsDefault STAPLE_DUAL_TOP = new FinishingsDefault(29);
+
+ /**
+ * Bind the document(s) with two staples (wire stitches) along the
+ * right edge assuming a portrait document.
+ */
+ public static final FinishingsDefault STAPLE_DUAL_RIGHT = new FinishingsDefault(30);
+
+ /**
+ * Bind the document(s) with two staples (wire stitches) along the
+ * bottom edge assuming a portrait document.
+ */
+ public static final FinishingsDefault STAPLE_DUAL_BOTTOM = new FinishingsDefault(31);
+
+ private static final String[] stringTable = { "none", "staple", null,
+ "cover", "bind", "saddle-stitch",
+ "edge-stitch", null, null, null,
+ null, null, null, null, null,
+ null, null, "staple-top-left",
+ "staple-bottom-left",
+ "staple-top-right",
+ "staple-bottom-right",
+ "edge-stitch-left",
+ "edge-stitch-top",
+ "edge-stitch-right",
+ "edge-stitch-bottom",
+ "staple-dual-left",
+ "staple-dual-top",
+ "staple-dual-right",
+ "staple-dual-bottom" };
+
+ private static final FinishingsDefault[] enumValueTable = { NONE, STAPLE, null,
+ COVER, BIND,
+ SADDLE_STITCH,
+ EDGE_STITCH, null,
+ null, null, null,
+ null, null, null,
+ null, null, null,
+ STAPLE_TOP_LEFT,
+ STAPLE_BOTTOM_LEFT,
+ STAPLE_TOP_RIGHT,
+ STAPLE_BOTTOM_RIGHT,
+ EDGE_STITCH_LEFT,
+ EDGE_STITCH_TOP,
+ EDGE_STITCH_RIGHT,
+ EDGE_STITCH_BOTTOM,
+ STAPLE_DUAL_LEFT,
+ STAPLE_DUAL_TOP,
+ STAPLE_DUAL_RIGHT,
+ STAPLE_DUAL_BOTTOM };
+
+ /**
+ * Constructs a FinishingsDefault
object.
+ *
+ * @param value the value
+ */
+ protected FinishingsDefault(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return the class FinishingsDefault
itself
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return FinishingsDefault.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "finishings-default".
+ */
+ public String getName()
+ {
+ return "finishings-default";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+ /**
+ * Returns the lowest used value by the enumerations of this class.
+ * .
+ * @return The lowest value used.
+ */
+ protected int getOffset()
+ {
+ return 3;
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this DefaultValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public Attribute getAssociatedAttribute()
+ {
+ return IppUtilities.getEnumAttribute("finishings", new Integer(getValue()));
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/JobHoldUntilDefault.java b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/JobHoldUntilDefault.java
new file mode 100644
index 000000000..7c29f231c
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/JobHoldUntilDefault.java
@@ -0,0 +1,149 @@
+/* JobHoldUntilDefault.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.defaults;
+
+import gnu.javax.print.ipp.attribute.DefaultValueAttribute;
+
+import java.util.Date;
+import java.util.Locale;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.TextSyntax;
+import javax.print.attribute.standard.JobHoldUntil;
+
+/**
+ * JobHoldUntilDefault attribute provides the default value
+ * for the attribute type job-hold-until.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class JobHoldUntilDefault extends TextSyntax
+ implements DefaultValueAttribute
+{
+
+ // a keyword/name based attribute in IPP
+ // can be extended by administrators
+ // standard values are predefined
+
+ /** Job should be printed immediately. */
+ public static final JobHoldUntilDefault NO_HOLD =
+ new JobHoldUntilDefault("no-hold", null);
+
+ /** Job should be hold indefinitely. */
+ public static final JobHoldUntilDefault INDEFINITE =
+ new JobHoldUntilDefault("indefinite", null);
+
+ /** Job should be processed during the day. */
+ public static final JobHoldUntilDefault DAY_TIME =
+ new JobHoldUntilDefault("day-time", null);
+
+ /** Job should be processed in the evening. */
+ public static final JobHoldUntilDefault EVENING =
+ new JobHoldUntilDefault("evening", null);
+
+ /** Job should be processed during night. */
+ public static final JobHoldUntilDefault NIGHT =
+ new JobHoldUntilDefault("night", null);
+
+ /** Job should be processed during the weekend. */
+ public static final JobHoldUntilDefault WEEKEND =
+ new JobHoldUntilDefault("weekend", null);
+
+ /**
+ * Job should be processed as second-shift
+ * (after close of business).
+ */
+ public static final JobHoldUntilDefault SECOND_SHIFT =
+ new JobHoldUntilDefault("second-shift", null);
+
+ /**
+ * Job should be processed as third-shift
+ * (after midnight).
+ */
+ public static final JobHoldUntilDefault THIRD_SHIFT =
+ new JobHoldUntilDefault("third-shift", null);
+
+ /**
+ * Creates a JobHoldUntilDefault
object with the
+ * given value and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @throws NullPointerException if value is null
+ */
+ public JobHoldUntilDefault(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class JobHoldUntilDefault
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return JobHoldUntilDefault.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "job-hold-until-default".
+ */
+ public String getName()
+ {
+ return "job-hold-until-default";
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this DefaultValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public Attribute getAssociatedAttribute()
+ {
+ // FIXME Same Mapping problem as in IppPrintService
+ return new JobHoldUntil(new Date());
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/JobPriorityDefault.java b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/JobPriorityDefault.java
new file mode 100644
index 000000000..9430250ae
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/JobPriorityDefault.java
@@ -0,0 +1,118 @@
+/* JobPriorityDefault.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.print.ipp.attribute.defaults;
+
+import gnu.javax.print.ipp.attribute.DefaultValueAttribute;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.standard.JobPriority;
+
+
+/**
+ * JobPriorityDefault attribute provides the default value of
+ * the printer object for the job-priority attribute.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class JobPriorityDefault extends IntegerSyntax
+ implements DefaultValueAttribute
+{
+
+ /**
+ * Creates a JobPriorityDefault
object.
+ *
+ * @param value the priority
+ *
+ * @exception IllegalArgumentException if value < 1 or value > 100
+ */
+ public JobPriorityDefault(int value)
+ {
+ super(value);
+
+ if (value < 1 || value > 100)
+ throw new IllegalArgumentException("value out of range");
+ }
+
+ /**
+ * Tests if the given object is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @return true
if both objects are equal,
+ * false
otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if(! (obj instanceof JobPriorityDefault))
+ return false;
+
+ return super.equals(obj);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class JobPriorityDefault
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return JobPriorityDefault.class;
+ }
+
+ /**
+ * Returns name of this class.
+ *
+ * @return The anme "job-priority-default".
+ */
+ public String getName()
+ {
+ return "job-priority-default";
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this DefaultValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public Attribute getAssociatedAttribute()
+ {
+ return new JobPriority(getValue());
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/JobSheetsDefault.java b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/JobSheetsDefault.java
new file mode 100644
index 000000000..6bf027eda
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/JobSheetsDefault.java
@@ -0,0 +1,122 @@
+/* JobSheetsDefault.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.defaults;
+
+import gnu.javax.print.ipp.attribute.DefaultValueAttribute;
+
+import java.util.Locale;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.TextSyntax;
+import javax.print.attribute.standard.JobSheets;
+
+/**
+ * JobSheetsDefault attribute provides the default value of
+ * the printer object for the job-sheets attribute.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class JobSheetsDefault extends TextSyntax
+ implements DefaultValueAttribute
+{
+ //a keyword/name based attribute in IPP
+ // can be extended by administrators
+ // standard values are predefined
+
+ /** No job sheet is the default */
+ public static final JobSheetsDefault NONE =
+ new JobSheetsDefault("none", Locale.getDefault());
+
+ /** A job sheet is the default */
+ public static final JobSheetsDefault STANDARD =
+ new JobSheetsDefault("standard", Locale.getDefault());
+
+ /**
+ * Creates a JobSheetsDefault
object with the
+ * given value and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @throws NullPointerException if value is null
+ */
+ public JobSheetsDefault(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class JobSheetsDefault
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return JobSheetsDefault.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "job-sheets-default".
+ */
+ public String getName()
+ {
+ return "job-sheets-default";
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this DefaultValuesAttribute enum.
+ * May return null if no value exists in JPS API.
+ * + * @return The enum of the standard attribute class. + */ + public Attribute getAssociatedAttribute() + { + if (this.equals(JobSheetsDefault.NONE)) + return JobSheets.NONE; + if (this.equals(JobSheetsDefault.STANDARD)) + return JobSheets.STANDARD; + + return null; + } + +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/MediaDefault.java b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/MediaDefault.java new file mode 100644 index 000000000..5945d0b9b --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/MediaDefault.java @@ -0,0 +1,105 @@ +/* MediaDefault.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package gnu.javax.print.ipp.attribute.defaults; + +import gnu.javax.print.ipp.IppUtilities; +import gnu.javax.print.ipp.attribute.DefaultValueAttribute; + +import java.util.Locale; + +import javax.print.attribute.Attribute; +import javax.print.attribute.TextSyntax; + +/** + * MediaDefault attribute provides the default value of + * the printer object for the media attribute. + * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class MediaDefault extends TextSyntax + implements DefaultValueAttribute +{ + + /** + * Creates aMediaDefault
object with the
+ * given value and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @throws NullPointerException if value is null
+ */
+ public MediaDefault(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class MediaDefault
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return MediaDefault.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "media-default".
+ */
+ public String getName()
+ {
+ return "media-default";
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this DefaultValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public Attribute getAssociatedAttribute()
+ {
+ return IppUtilities.getEnumAttribute("media" , getValue());
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/MultipleDocumentHandlingDefault.java b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/MultipleDocumentHandlingDefault.java
new file mode 100644
index 000000000..1563db82c
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/MultipleDocumentHandlingDefault.java
@@ -0,0 +1,152 @@
+/* MultipleDocumentHandlingDefault.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.print.ipp.attribute.defaults;
+
+import gnu.javax.print.ipp.IppUtilities;
+import gnu.javax.print.ipp.attribute.DefaultValueAttribute;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+
+
+/**
+ * MultipleDocumentHandlingDefault
provides the
+ * default value for the MultipleDocumentHandling attribute.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class MultipleDocumentHandlingDefault extends EnumSyntax
+ implements DefaultValueAttribute
+{
+
+ //a keyword based attribute in IPP - int values just starting at 0
+
+ /**
+ * Supports only multiple documents treated as a single document. This
+ * applies to attributes which specify treatment of multiple document jobs.
+ */
+ public static final MultipleDocumentHandlingDefault SINGLE_DOCUMENT =
+ new MultipleDocumentHandlingDefault(0);
+
+ /** Supports multiple documents as uncollated copies */
+ public static final MultipleDocumentHandlingDefault SEPARATE_DOCUMENTS_UNCOLLATED_COPIES =
+ new MultipleDocumentHandlingDefault(1);
+
+ /** Supports multiple documents as collated copies */
+ public static final MultipleDocumentHandlingDefault SEPARATE_DOCUMENTS_COLLATED_COPIES =
+ new MultipleDocumentHandlingDefault(2);
+
+ /**
+ * Supports multiple documents where every single document starts
+ * with a new sheet.
+ */
+ public static final MultipleDocumentHandlingDefault SINGLE_DOCUMENT_NEW_SHEET =
+ new MultipleDocumentHandlingDefault(3);
+
+ private static final String[] stringTable = { "single-document",
+ "separate-documents-uncollated-copies",
+ "separate-documents-collated-copies",
+ "single-document-new-sheet" };
+
+ private static final MultipleDocumentHandlingDefault[] enumValueTable =
+ { SINGLE_DOCUMENT, SEPARATE_DOCUMENTS_UNCOLLATED_COPIES,
+ SEPARATE_DOCUMENTS_COLLATED_COPIES, SINGLE_DOCUMENT_NEW_SHEET};
+
+ /**
+ * Constructs a MultipleDocumentHandlingDefault
object.
+ *
+ * @param value the enum value
+ */
+ protected MultipleDocumentHandlingDefault(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class MultipleDocumentHandlingDefault
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return MultipleDocumentHandlingDefault.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "multiple-document-handling-default".
+ */
+ public String getName()
+ {
+ return "multiple-document-handling-default";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this DefaultValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public Attribute getAssociatedAttribute()
+ {
+ return IppUtilities.getEnumAttribute("multiple-document-handling",
+ new Integer(getValue()));
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/NumberUpDefault.java b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/NumberUpDefault.java
new file mode 100644
index 000000000..8e2d076d5
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/NumberUpDefault.java
@@ -0,0 +1,114 @@
+/* NumberUpDefault.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.print.ipp.attribute.defaults;
+
+import gnu.javax.print.ipp.attribute.DefaultValueAttribute;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.IntegerSyntax;
+import javax.print.attribute.standard.NumberUp;
+
+/**
+ * NumberUpDefault attribute provides the default value of
+ * the numper up attribute.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class NumberUpDefault extends IntegerSyntax
+ implements DefaultValueAttribute
+{
+
+ /**
+ * Creates a NumberUpDefault
object.
+ *
+ * @param value the value
+ * @throws IllegalArgumentException if value < 1
+ */
+ public NumberUpDefault(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Tests if the given object is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @return true
if both objects are equal,
+ * false
otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if(! (obj instanceof NumberUpDefault))
+ return false;
+
+ return super.equals(obj);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class NumberUpDefault
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return NumberUpDefault.class;
+ }
+
+ /**
+ * Returns name of this class.
+ *
+ * @return The name "number-up-default".
+ */
+ public String getName()
+ {
+ return "number-up-default";
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this DefaultValuesAttribute enum.
+ * May return null if no value exists in JPS API.
+ * + * @return The enum of the standard attribute class. + */ + public Attribute getAssociatedAttribute() + { + return new NumberUp(getValue()); + } +} diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/OrientationRequestedDefault.java b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/OrientationRequestedDefault.java new file mode 100644 index 000000000..4563ec525 --- /dev/null +++ b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/OrientationRequestedDefault.java @@ -0,0 +1,154 @@ +/* OrientationRequestedDefault.java -- + Copyright (C) 2006 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package gnu.javax.print.ipp.attribute.defaults; + +import gnu.javax.print.ipp.IppUtilities; +import gnu.javax.print.ipp.attribute.DefaultValueAttribute; + +import javax.print.attribute.Attribute; +import javax.print.attribute.EnumSyntax; + + +/** + * TheOrientationRequestedDefault
attribute provides
+ * the default value for the job attribute orientation-requested.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class OrientationRequestedDefault extends EnumSyntax
+ implements DefaultValueAttribute
+{
+
+ /** Orientation as portrait. */
+ public static final OrientationRequestedDefault PORTRAIT =
+ new OrientationRequestedDefault(3);
+
+ /** Orientation as landscape. */
+ public static final OrientationRequestedDefault LANDSCAPE =
+ new OrientationRequestedDefault(4);
+
+ /** Orientation as reversed landscape. */
+ public static final OrientationRequestedDefault REVERSE_LANDSCAPE =
+ new OrientationRequestedDefault(5);
+
+ /** Orientation as reversed portrait. */
+ public static final OrientationRequestedDefault REVERSE_PORTRAIT =
+ new OrientationRequestedDefault(6);
+
+
+ private static final String[] stringTable = { "portrait", "landscape",
+ "reverse-landscape",
+ "reverse-portrait" };
+
+ private static final OrientationRequestedDefault[]
+ enumValueTable = { PORTRAIT, LANDSCAPE,
+ REVERSE_LANDSCAPE, REVERSE_PORTRAIT };
+
+ /**
+ * Constructs a OrientationRequestedDefault
object.
+ *
+ * @param value the value
+ */
+ protected OrientationRequestedDefault(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class OrientationRequestedDefault
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return OrientationRequestedDefault.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "orientation-requested-default".
+ */
+ public String getName()
+ {
+ return "orientation-requested-default";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+ /**
+ * Returns the lowest used value by the enumerations of this class.
+ * .
+ * @return The lowest value used.
+ */
+ protected int getOffset()
+ {
+ return 3;
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this DefaultValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public Attribute getAssociatedAttribute()
+ {
+ return IppUtilities.getEnumAttribute("orientation-requested",
+ new Integer(getValue()));
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/PrintQualityDefault.java b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/PrintQualityDefault.java
new file mode 100644
index 000000000..7b123eeb4
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/PrintQualityDefault.java
@@ -0,0 +1,141 @@
+/* PrintQualityDefault.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.print.ipp.attribute.defaults;
+
+import gnu.javax.print.ipp.IppUtilities;
+import gnu.javax.print.ipp.attribute.DefaultValueAttribute;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+
+
+/**
+ * PrintQualityDefault
provides the
+ * default value for the print-quality attribute.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class PrintQualityDefault extends EnumSyntax
+ implements DefaultValueAttribute
+{
+ /** Draft quality of the printer. */
+ public static final PrintQualityDefault DRAFT = new PrintQualityDefault(3);
+
+ /** Normal quality of the printer. */
+ public static final PrintQualityDefault NORMAL = new PrintQualityDefault(4);
+
+ /** High quality of the printer. */
+ public static final PrintQualityDefault HIGH = new PrintQualityDefault(5);
+
+ private static final String[] stringTable = { "draft", "normal", "high" };
+
+ private static final PrintQualityDefault[] enumValueTable = { DRAFT, NORMAL, HIGH };
+
+ /**
+ * Constructs a PrintQualityDefault
object.
+ *
+ * @param value the value of the enum
+ */
+ protected PrintQualityDefault(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class PrintQualityDefault
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return PrintQualityDefault.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "print-quality-default".
+ */
+ public String getName()
+ {
+ return "print-quality-default";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+ /**
+ * Returns the lowest used value by the enumerations of this class.
+ * .
+ * @return The lowest value used.
+ */
+ protected int getOffset()
+ {
+ return 3;
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this DefaultValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public Attribute getAssociatedAttribute()
+ {
+ return IppUtilities.getEnumAttribute(
+ "print-quality", new Integer(getValue()));
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/PrinterResolutionDefault.java b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/PrinterResolutionDefault.java
new file mode 100644
index 000000000..2c84b99ba
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/PrinterResolutionDefault.java
@@ -0,0 +1,119 @@
+/* PrinterResolutionDefault.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.print.ipp.attribute.defaults;
+
+import gnu.javax.print.ipp.attribute.DefaultValueAttribute;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.ResolutionSyntax;
+import javax.print.attribute.standard.PrinterResolution;
+
+
+/**
+ * The PrinterResolutionDefault
attribute provides
+ * the default value for the job attribute printer-resolution.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class PrinterResolutionDefault extends ResolutionSyntax
+ implements DefaultValueAttribute
+{
+
+ /**
+ * Creates a ResolutionSyntax
object with the given arguments.
+ *
+ * @param crossFeedResolution the cross feed resolution
+ * @param feedResolution the feed resolution
+ * @param units the unit to use (e.g. {@link #DPCM} or {@link #DPI})
+ *
+ * @exception IllegalArgumentException if preconditions fail
+ */
+ public PrinterResolutionDefault(int crossFeedResolution, int feedResolution,
+ int units)
+ {
+ super(crossFeedResolution, feedResolution, units);
+ }
+
+ /**
+ * Tests if the given object is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @return true
if both objects are equal,
+ * false
otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if(! (obj instanceof PrinterResolutionDefault))
+ return false;
+
+ return super.equals(obj);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class PrinterResolutionDefault
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return PrinterResolutionDefault.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "printer-resolution-default".
+ */
+ public String getName()
+ {
+ return "printer-resolution-default";
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this DefaultValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public Attribute getAssociatedAttribute()
+ {
+ return new PrinterResolution(getCrossFeedResolutionDphi(),
+ getFeedResolutionDphi(), 1);
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/SidesDefault.java b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/SidesDefault.java
new file mode 100644
index 000000000..a50560ae9
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/defaults/SidesDefault.java
@@ -0,0 +1,150 @@
+/* SidesDefault.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.print.ipp.attribute.defaults;
+
+import gnu.javax.print.ipp.IppUtilities;
+import gnu.javax.print.ipp.attribute.DefaultValueAttribute;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+
+
+/**
+ * SidesDefault
provides the
+ * default for the sides attribute.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class SidesDefault extends EnumSyntax
+ implements DefaultValueAttribute
+{
+
+ /** Specifies that each page should be printed on one sheet. */
+ public static final SidesDefault ONE_SIDED = new SidesDefault(0);
+
+ /**
+ * Specifies that two following pages should be printed on the
+ * front and back of one sheet for binding on the long edge.
+ */
+ public static final SidesDefault TWO_SIDED_LONG_EDGE =
+ new SidesDefault(1);
+
+ /**
+ * Specifies that two following pages should be printed on the
+ * front and back of one sheet for binding on the short edge.
+ */
+ public static final SidesDefault TWO_SIDED_SHORT_EDGE =
+ new SidesDefault(2);
+
+ /** An alias constant for "two sided long edge". */
+ public static final SidesDefault DUPLEX = new SidesDefault(1);
+
+ /** An alias constant for "two sided short edge". */
+ public static final SidesDefault TUMBLE = new SidesDefault(2);
+
+ private static final String[] stringTable = { "one-sided",
+ "two-sided-long-edge",
+ "two-sided-short-edge" };
+
+ private static final SidesDefault[] enumValueTable = { ONE_SIDED,
+ TWO_SIDED_LONG_EDGE,
+ TWO_SIDED_SHORT_EDGE };
+
+
+ /**
+ * Creates a SidesDefault
object.
+ *
+ * @param value the value of the enum
+ */
+ protected SidesDefault(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class SidesDefault
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return SidesDefault.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "sides-default".
+ */
+ public String getName()
+ {
+ return "sides-default";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this DefaultValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public Attribute getAssociatedAttribute()
+ {
+ return IppUtilities.getEnumAttribute("sides", new Integer(getValue()));
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/job/AttributesCharset.java b/libjava/classpath/gnu/javax/print/ipp/attribute/job/AttributesCharset.java
new file mode 100644
index 000000000..4fe2ce0d5
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/job/AttributesCharset.java
@@ -0,0 +1,93 @@
+/* AttributesCharset.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.job;
+
+import gnu.javax.print.ipp.attribute.CharsetSyntax;
+
+import javax.print.attribute.Attribute;
+
+/**
+ * AttributesCharset attribute as described in RFC 2911 chapter
+ * 3.1.4 Character Set and Natural Language Operation Attributes.
+ *
+ * This operation attribute identifies the charset used by any text
+ * and name attribute supplied by the client in the request. This
+ * charset must be used by the printer object in the response.
+ * All clients and IPP objects must support the 'utf-8' charset.
+ *
AttributesCharset
object.
+ *
+ * @param value the charset string value.
+ */
+ public AttributesCharset(String value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class AttributesCharset
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return AttributesCharset.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "attributes-charset".
+ */
+ public String getName()
+ {
+ return "attributes-charset";
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/job/AttributesNaturalLanguage.java b/libjava/classpath/gnu/javax/print/ipp/attribute/job/AttributesNaturalLanguage.java
new file mode 100644
index 000000000..151cec439
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/job/AttributesNaturalLanguage.java
@@ -0,0 +1,95 @@
+/* AttributesNaturalLanguage.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.job;
+
+
+import gnu.javax.print.ipp.attribute.NaturalLanguageSyntax;
+
+import javax.print.attribute.Attribute;
+
+/**
+ * AttributesNaturalLanguage attribute as described in RFC 2911 chapter
+ * 3.1.4 Character Set and Natural Language Operation Attributes.
+ * + * This operation attribute identifies the natural language used + * by any text and name attribute supplied by the client in the request. + * The printer object should use this natural language for the response + * to this request. + *
+ * + * @author Wolfgang Baer (WBaer@gmx.de) + */ +public final class AttributesNaturalLanguage extends NaturalLanguageSyntax + implements Attribute +{ + + /** Defines the default language EN */ + public static final AttributesNaturalLanguage EN = + new AttributesNaturalLanguage("en"); + + /** + * Creates aAttributesNaturalLanguage
object.
+ *
+ * @param value the language string value.
+ */
+ public AttributesNaturalLanguage(String value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class AttributesNaturalLanguage
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return AttributesNaturalLanguage.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "attributes-natural-language".
+ */
+ public String getName()
+ {
+ return "attributes-natural-language";
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobDetailedStatusMessages.java b/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobDetailedStatusMessages.java
new file mode 100644
index 000000000..5b83344a9
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobDetailedStatusMessages.java
@@ -0,0 +1,92 @@
+/* JobDetailedStatusMessages.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.job;
+
+import java.util.Locale;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * JobDetailedStatusMessages provides additional detailed and
+ * technical job informations.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class JobDetailedStatusMessages
+ extends TextSyntax implements Attribute
+{
+
+ /**
+ * Creates a JobDetailedStatusMessages
object with the given value
+ * and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @exception NullPointerException if value is null
+ */
+ public JobDetailedStatusMessages(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class JobDetailedStatusMessages
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return JobDetailedStatusMessages.class;
+ }
+
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "job-detailed-status-messages".
+ */
+ public String getName()
+ {
+ return "job-detailed-status-messages";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobDocumentAccessErrors.java b/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobDocumentAccessErrors.java
new file mode 100644
index 000000000..c3fff057c
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobDocumentAccessErrors.java
@@ -0,0 +1,93 @@
+/* JobDocumentAccessErrors.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.job;
+
+import java.util.Locale;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * JobDocumentAccessErrors provides additional information
+ * for each access error for print-uri or document-uri jobs.
+ * technical job informations.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class JobDocumentAccessErrors
+ extends TextSyntax implements Attribute
+{
+
+ /**
+ * Creates a JobDocumentAccessErrors
object with the given value
+ * and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @exception NullPointerException if value is null
+ */
+ public JobDocumentAccessErrors(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class JobDocumentAccessErrors
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return JobDocumentAccessErrors.class;
+ }
+
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "job-document-access-errors".
+ */
+ public String getName()
+ {
+ return "job-document-access-errors";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobId.java b/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobId.java
new file mode 100644
index 000000000..78c866723
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobId.java
@@ -0,0 +1,87 @@
+/* JobId.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.job;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.IntegerSyntax;
+
+/**
+ * The JobId
attribute contains the ID of a
+ * print job created or currently being processed.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class JobId extends IntegerSyntax implements Attribute
+{
+
+ /**
+ * Creates a IntegerSyntax
with the given value.
+ *
+ * @param value the integer to set
+ * @throws IllegalArgumentException if value is < 1
+ */
+ public JobId(int value)
+ {
+ super(value);
+
+ if (value < 1)
+ throw new IllegalArgumentException("job-id may not be less than 1");
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class JobId
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return JobId.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "job-id".
+ */
+ public String getName()
+ {
+ return "job-id";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobMoreInfo.java b/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobMoreInfo.java
new file mode 100644
index 000000000..569400f40
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobMoreInfo.java
@@ -0,0 +1,87 @@
+/* JobMoreInfo.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.job;
+
+import java.net.URI;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.URISyntax;
+
+/**
+ * JobMoreInfo attribute as described in RFC 2911 section
+ * 4.3.4 contains the URI where more information about a job
+ * (e.g. through a HTML page) can be found.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class JobMoreInfo extends URISyntax implements Attribute
+{
+
+ /**
+ * Creates a JobMoreInfo
object.
+ *
+ * @param uri the URI value for the syntax
+ * @throws NullPointerException if uri is null
+ */
+ public JobMoreInfo(URI uri)
+ {
+ super(uri);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class JobMoreInfo
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return JobMoreInfo.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "job-more-info".
+ */
+ public String getName()
+ {
+ return "job-more-info";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobPrinterUri.java b/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobPrinterUri.java
new file mode 100644
index 000000000..1375a2419
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobPrinterUri.java
@@ -0,0 +1,87 @@
+/* JobPrinterUri.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.job;
+
+import java.net.URI;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.URISyntax;
+
+/**
+ * JobPrinterUri attribute as described in RFC 2911 section
+ * 4.3.3 contains the URI of the printer which created and
+ * processes a job.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class JobPrinterUri extends URISyntax implements Attribute
+{
+
+ /**
+ * Creates a JobPrinterUri
object.
+ *
+ * @param uri the URI value for the syntax
+ * @throws NullPointerException if uri is null
+ */
+ public JobPrinterUri(URI uri)
+ {
+ super(uri);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class JobPrinterUri
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return JobPrinterUri.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "job-printer-uri".
+ */
+ public String getName()
+ {
+ return "job-printer-uri";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobStateMessage.java b/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobStateMessage.java
new file mode 100644
index 000000000..d65126621
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobStateMessage.java
@@ -0,0 +1,92 @@
+/* JobStateMessage.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.job;
+
+import java.util.Locale;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * JobStateMessage attribute describes information about the
+ * job-state and job-state-reasons in human readable form.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class JobStateMessage
+ extends TextSyntax implements Attribute
+{
+
+ /**
+ * Creates a JobStateMessage
object with the given value
+ * and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @exception NullPointerException if value is null
+ */
+ public JobStateMessage(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class JobStateMessage
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return JobStateMessage.class;
+ }
+
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "job-state-message".
+ */
+ public String getName()
+ {
+ return "job-state-message";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobUri.java b/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobUri.java
new file mode 100644
index 000000000..4b545b956
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/job/JobUri.java
@@ -0,0 +1,87 @@
+/* JobUri.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.job;
+
+import java.net.URI;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.URISyntax;
+
+/**
+ * JobUri attribute as described in RFC 2911 section
+ * 4.3.1 contains the URI for a job generated by the printer
+ * after a create request.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class JobUri extends URISyntax implements Attribute
+{
+
+ /**
+ * Creates a JobUri
object.
+ *
+ * @param uri the URI value for the syntax
+ * @throws NullPointerException if uri is null
+ */
+ public JobUri(URI uri)
+ {
+ super(uri);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class JobUri
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return JobUri.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "job-uri".
+ */
+ public String getName()
+ {
+ return "job-uri";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/printer/CharsetConfigured.java b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/CharsetConfigured.java
new file mode 100644
index 000000000..42430377c
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/CharsetConfigured.java
@@ -0,0 +1,86 @@
+/* CharsetConfigured.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.printer;
+
+import gnu.javax.print.ipp.attribute.CharsetSyntax;
+
+import javax.print.attribute.Attribute;
+
+/**
+ * CharsetConfigured attribute as described in RFC 2911 section
+ * 4.4.17 provides the charset which is configured by the
+ * server to be used in the name and text syntax attribute types.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class CharsetConfigured extends CharsetSyntax
+ implements Attribute
+{
+
+ /**
+ * Creates a CharsetConfigured
object.
+ *
+ * @param value the charset string value.
+ */
+ public CharsetConfigured(String value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class CharsetConfigured
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return CharsetConfigured.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "charset-configured".
+ */
+ public String getName()
+ {
+ return "charset-configured";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/printer/DocumentFormat.java b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/DocumentFormat.java
new file mode 100644
index 000000000..9a5e01e1d
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/DocumentFormat.java
@@ -0,0 +1,111 @@
+/* DocumentFormat.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.printer;
+
+import java.util.Locale;
+
+import javax.print.DocFlavor;
+import javax.print.attribute.Attribute;
+import javax.print.attribute.SupportedValuesAttribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * DocumentFormatSupported
specifies the supported document
+ * formats of a printer. Printer are supplying a set of this attribute.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class DocumentFormat extends TextSyntax
+ implements SupportedValuesAttribute
+{
+
+ /**
+ * Creates a DocumentFormat
object with the
+ * given value and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @exception NullPointerException if value is null
+ */
+ public DocumentFormat(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Constructs a document format object for the given flavor.
+ * The constructor reworkes the mimetype of the given flavor
+ * to remove the quoted charset parameter if present.
+ *
+ * @param flavor the flavor with the mimetype
+ * @return The created document format.
+ */
+ public static DocumentFormat createDocumentFormat(DocFlavor flavor)
+ {
+ String charset = flavor.getParameter("charset");
+ String mimetype = flavor.getMediaType() + "/" + flavor.getMediaSubtype();
+ if (charset != null)
+ mimetype += "; charset=" + charset;
+
+ return new DocumentFormat(mimetype, null);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class DocumentFormat
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return DocumentFormat.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "document-format".
+ */
+ public String getName()
+ {
+ return "document-format";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/printer/MultipleOperationTimeOut.java b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/MultipleOperationTimeOut.java
new file mode 100644
index 000000000..bb00b8891
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/MultipleOperationTimeOut.java
@@ -0,0 +1,86 @@
+/* MultipleOperationTimeOut.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.printer;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.IntegerSyntax;
+
+/**
+ * MultipleOperationTimeOut attribute as described in RFC 2911 section
+ * 4.4.31 provides the minimum time ins second a printer object waits
+ * before time out and recovery. The printer object waits e.g. for
+ * additional SendDocument or SendUri operations.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class MultipleOperationTimeOut extends IntegerSyntax
+ implements Attribute
+{
+
+ /**
+ * Creates a MultipleOperationTimeOut
with the given value.
+ *
+ * @param value the integer to set
+ */
+ public MultipleOperationTimeOut(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class MultipleOperationTimeOut
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return MultipleOperationTimeOut.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "multiple-operation-time-out".
+ */
+ public String getName()
+ {
+ return "multiple-operation-time-out";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/printer/NaturalLanguageConfigured.java b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/NaturalLanguageConfigured.java
new file mode 100644
index 000000000..8dc05fe58
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/NaturalLanguageConfigured.java
@@ -0,0 +1,86 @@
+/* NaturalLanguageConfigured.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.printer;
+
+import gnu.javax.print.ipp.attribute.NaturalLanguageSyntax;
+
+import javax.print.attribute.Attribute;
+
+/**
+ * NaturalLanguageConfigured attribute as described in RFC 2911
+ * section 4.4.19 provides the natural language which is configured
+ * by the server to be used in the name and text syntax attribute types.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class NaturalLanguageConfigured extends NaturalLanguageSyntax
+ implements Attribute
+{
+
+ /**
+ * Creates a NaturalLanguageConfigured
object.
+ *
+ * @param value the charset string value.
+ */
+ public NaturalLanguageConfigured(String value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class NaturalLanguageConfigured
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return NaturalLanguageConfigured.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "natural-language-configured".
+ */
+ public String getName()
+ {
+ return "natural-language-configured";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/printer/PrinterCurrentTime.java b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/PrinterCurrentTime.java
new file mode 100644
index 000000000..361916773
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/PrinterCurrentTime.java
@@ -0,0 +1,107 @@
+/* PrinterCurrentTime.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.printer;
+
+import java.util.Date;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.DateTimeSyntax;
+import javax.print.attribute.PrintServiceAttribute;
+
+/**
+ * PrinterCurrentTime attribute as described in RFC 2911 section
+ * 4.4.30 provides the current time of the print service.
+ * Its to be used by other attributes like the date-time-at-xxx
+ * attributes in the creation process.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class PrinterCurrentTime extends DateTimeSyntax
+ implements PrintServiceAttribute
+{
+
+ /**
+ * Creates a PrinterCurrentTime
object.
+ *
+ * @param value the date at creation time
+ *
+ * @exception NullPointerException if value is null
+ */
+ public PrinterCurrentTime(Date value)
+ {
+ super(value);
+ }
+
+ /**
+ * Tests if the given object is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @return true
if both objects are equal,
+ * false
otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if(! (obj instanceof PrinterCurrentTime))
+ return false;
+
+ return super.equals(obj);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class PrinterCurrentTime
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return PrinterCurrentTime.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "printer-current-time".
+ */
+ public String getName()
+ {
+ return "printer-current-time";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/printer/PrinterDriverInstaller.java b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/PrinterDriverInstaller.java
new file mode 100644
index 000000000..28a2f4485
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/PrinterDriverInstaller.java
@@ -0,0 +1,88 @@
+/* PrinterDriverInstaller.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.printer;
+
+import java.net.URI;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.URISyntax;
+
+/**
+ * PrinterDriverInstaller attribute as described in RFC 2911 section
+ * 4.4.81 provides the URI where a printer driver installer
+ * can be found.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class PrinterDriverInstaller extends URISyntax
+ implements Attribute
+{
+
+ /**
+ * Creates a PrinterDriverInstaller
object.
+ *
+ * @param uri the URI value for the syntax
+ * @throws NullPointerException if uri is null
+ */
+ public PrinterDriverInstaller(URI uri)
+ {
+ super(uri);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class PrinterDriverInstaller
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return PrinterDriverInstaller.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "printer-driver-installer".
+ */
+ public String getName()
+ {
+ return "printer-driver-installer";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/printer/PrinterStateMessage.java b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/PrinterStateMessage.java
new file mode 100644
index 000000000..07c458889
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/PrinterStateMessage.java
@@ -0,0 +1,94 @@
+/* PrinterStateMessage.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.printer;
+
+import java.util.Locale;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.PrintServiceAttribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * PrinterStateMessage attribute as described in RFC 2911 section
+ * 4.4.13 provides a textual representation of the attributes
+ * printer-state and printer-state-reasons for consumption by
+ * humans.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class PrinterStateMessage extends TextSyntax
+ implements PrintServiceAttribute
+{
+
+ /**
+ * Creates a PrinterStateMessage
object with the
+ * given value and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @exception NullPointerException if value is null
+ */
+ public PrinterStateMessage(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class PrinterStateMessage
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return PrinterStateMessage.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "printer-state-message".
+ */
+ public String getName()
+ {
+ return "printer-state-message";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/printer/PrinterUpTime.java b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/PrinterUpTime.java
new file mode 100644
index 000000000..7bec92ed3
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/printer/PrinterUpTime.java
@@ -0,0 +1,86 @@
+/* PrinterUpTime.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.printer;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.IntegerSyntax;
+
+/**
+ * PrinterUpTime attribute as described in RFC 2911 section
+ * 4.4.29 provides the uptime of the printer object. This
+ * is a value in second starting at 1 after a initialization
+ * or reboot of the printer object.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class PrinterUpTime extends IntegerSyntax
+ implements Attribute
+{
+
+ /**
+ * Creates a PrinterUpTime
with the given value.
+ *
+ * @param value the integer to set
+ */
+ public PrinterUpTime(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class PrinterUpTime
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return PrinterUpTime.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "printer-up-time".
+ */
+ public String getName()
+ {
+ return "printer-up-time";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/CharsetSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/CharsetSupported.java
new file mode 100644
index 000000000..22b484ef8
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/CharsetSupported.java
@@ -0,0 +1,88 @@
+/* CharsetSupported.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.supported;
+
+import gnu.javax.print.ipp.attribute.CharsetSyntax;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.SupportedValuesAttribute;
+
+/**
+ * CharsetSupported attribute as described in RFC 2911 section
+ * 4.4.18 provides the charset which are supported by the
+ * IPP implementation to be used in the name and text syntax
+ * attribute types.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class CharsetSupported extends CharsetSyntax
+ implements SupportedValuesAttribute
+{
+
+ /**
+ * Creates a CharsetSupported
object.
+ *
+ * @param value the charset string value.
+ */
+ public CharsetSupported(String value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class CharsetSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return CharsetSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "charset-supported".
+ */
+ public String getName()
+ {
+ return "charset-supported";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/CompressionSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/CompressionSupported.java
new file mode 100644
index 000000000..768091cb2
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/CompressionSupported.java
@@ -0,0 +1,161 @@
+/* CompressionSupported.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.print.ipp.attribute.supported;
+
+import gnu.javax.print.ipp.IppUtilities;
+
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+import javax.print.attribute.standard.Compression;
+
+
+/**
+ * CompressionSupported
provides the values which are
+ * supported for the compression attribute.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class CompressionSupported extends EnumSyntax
+ implements SupportedValuesAttribute
+{
+
+ /** The print data is not compressed. */
+ public static final CompressionSupported NONE = new CompressionSupported(0);
+
+ /** The print data is ZIP compressed. */
+ public static final CompressionSupported DEFLATE = new CompressionSupported(1);
+
+ /** The print data is GNU Zip compressed. */
+ public static final CompressionSupported GZIP = new CompressionSupported(2);
+
+ /** The print data is UNIX compressed. */
+ public static final CompressionSupported COMPRESS = new CompressionSupported(3);
+
+ private static final String[] stringTable = { "none", "deflate",
+ "gzip", "compress" };
+
+ private static final CompressionSupported[] enumValueTable = { NONE, DEFLATE,
+ GZIP, COMPRESS };
+
+ /**
+ * Constructs a CompressionSupported
object.
+ *
+ * @param value the enum value
+ */
+ protected CompressionSupported(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class CompressionSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return CompressionSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "compression-supported".
+ */
+ public String getName()
+ {
+ return "compression-supported";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this SupportedValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public Compression getAssociatedAttribute()
+ {
+ return (Compression) IppUtilities.getEnumAttribute(
+ "compression", new Integer(getValue()));
+ }
+
+ /**
+ * Constructs an array from a set of -supported attributes.
+ * @param set set to process
+ * @return The constructed array.
+ *
+ * @see #getAssociatedAttribute()
+ */
+ public static Compression[]
+ getAssociatedAttributeArray(SetDocumentFormatSupported
specifies the supported document
+ * formats of a printer. Printer are supplying a set of this attribute.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class DocumentFormatSupported extends TextSyntax
+ implements SupportedValuesAttribute
+{
+
+ /**
+ * Creates a DocumentFormatSupported
object with the
+ * given value and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @exception NullPointerException if value is null
+ */
+ public DocumentFormatSupported(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class DocumentFormatSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return DocumentFormatSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "document-format-supported".
+ */
+ public String getName()
+ {
+ return "document-format-supported";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/FinishingsSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/FinishingsSupported.java
new file mode 100644
index 000000000..f271fa71b
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/FinishingsSupported.java
@@ -0,0 +1,302 @@
+/* FinishingsSupported.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.supported;
+
+import gnu.javax.print.ipp.IppUtilities;
+
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+import javax.print.attribute.standard.Finishings;
+
+
+/**
+ * The FinishingsSupported
attribute provides the supported
+ * values for finishings of a job.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class FinishingsSupported extends EnumSyntax
+ implements SupportedValuesAttribute
+{
+
+ /** No finishing. */
+ public static final FinishingsSupported NONE = new FinishingsSupported(3);
+
+ /** Staple the document(s) */
+ public static final FinishingsSupported STAPLE = new FinishingsSupported(4);
+
+ /** Cover a document */
+ public static final FinishingsSupported COVER = new FinishingsSupported(6);
+
+ /**
+ * This value indicates that a binding is to be applied to the document.
+ * The type and placement of the binding is site-defined.
+ */
+ public static final FinishingsSupported BIND = new FinishingsSupported(7);
+
+ /**
+ * Bind the document(s) with one or more staples (wire stitches)
+ * along the middle fold.
+ */
+ public static final FinishingsSupported SADDLE_STITCH =
+ new FinishingsSupported(8);
+
+ /**
+ * Bind the document(s) with one or more staples (wire stitches)
+ * along one edge.
+ */
+ public static final FinishingsSupported EDGE_STITCH =
+ new FinishingsSupported(9);
+
+ /**
+ * Bind the document(s) with one or more staples in the top left
+ * corner.
+ */
+ public static final FinishingsSupported STAPLE_TOP_LEFT =
+ new FinishingsSupported(20);
+
+ /**
+ * Bind the document(s) with one or more staples in the bottom
+ * left corner.
+ */
+ public static final FinishingsSupported STAPLE_BOTTOM_LEFT =
+ new FinishingsSupported(21);
+
+ /**
+ * Bind the document(s) with one or more staples in the top right corner.
+ */
+ public static final FinishingsSupported STAPLE_TOP_RIGHT =
+ new FinishingsSupported(22);
+
+ /**
+ * Bind the document(s) with one or more staples in the bottom right corner.
+ */
+ public static final FinishingsSupported STAPLE_BOTTOM_RIGHT =
+ new FinishingsSupported(23);
+
+ /**
+ * Bind the document(s) with one or more staples (wire stitches)
+ * along the left edge.
+ */
+ public static final FinishingsSupported EDGE_STITCH_LEFT =
+ new FinishingsSupported(24);
+
+ /**
+ * Bind the document(s) with one or more staples (wire stitches) along
+ * the top edge.
+ */
+ public static final FinishingsSupported EDGE_STITCH_TOP =
+ new FinishingsSupported(25);
+
+ /**
+ * Bind the document(s) with one or more staples (wire stitches) along
+ * the right edge.
+ */
+ public static final FinishingsSupported EDGE_STITCH_RIGHT =
+ new FinishingsSupported(26);
+
+ /**
+ * Bind the document(s) with one or more staples (wire stitches) along
+ * the bottom edge.
+ */
+ public static final FinishingsSupported EDGE_STITCH_BOTTOM =
+ new FinishingsSupported(27);
+
+ /**
+ * Bind the document(s) with two staples (wire stitches) along the
+ * left edge assuming a portrait document.
+ */
+ public static final FinishingsSupported STAPLE_DUAL_LEFT =
+ new FinishingsSupported(28);
+
+ /**
+ * Bind the document(s) with two staples (wire stitches) along the
+ * top edge assuming a portrait document.
+ */
+ public static final FinishingsSupported STAPLE_DUAL_TOP =
+ new FinishingsSupported(29);
+
+ /**
+ * Bind the document(s) with two staples (wire stitches) along the
+ * right edge assuming a portrait document.
+ */
+ public static final FinishingsSupported STAPLE_DUAL_RIGHT =
+ new FinishingsSupported(30);
+
+ /**
+ * Bind the document(s) with two staples (wire stitches) along the
+ * bottom edge assuming a portrait document.
+ */
+ public static final FinishingsSupported STAPLE_DUAL_BOTTOM =
+ new FinishingsSupported(31);
+
+ private static final String[] stringTable = { "none", "staple", null,
+ "cover", "bind", "saddle-stitch",
+ "edge-stitch", null, null, null,
+ null, null, null, null, null,
+ null, null, "staple-top-left",
+ "staple-bottom-left",
+ "staple-top-right",
+ "staple-bottom-right",
+ "edge-stitch-left",
+ "edge-stitch-top",
+ "edge-stitch-right",
+ "edge-stitch-bottom",
+ "staple-dual-left",
+ "staple-dual-top",
+ "staple-dual-right",
+ "staple-dual-bottom" };
+
+ private static final FinishingsSupported[] enumValueTable = { NONE, STAPLE,
+ null, COVER, BIND,
+ SADDLE_STITCH,
+ EDGE_STITCH, null,
+ null, null, null,
+ null, null, null,
+ null, null, null,
+ STAPLE_TOP_LEFT,
+ STAPLE_BOTTOM_LEFT,
+ STAPLE_TOP_RIGHT,
+ STAPLE_BOTTOM_RIGHT,
+ EDGE_STITCH_LEFT,
+ EDGE_STITCH_TOP,
+ EDGE_STITCH_RIGHT,
+ EDGE_STITCH_BOTTOM,
+ STAPLE_DUAL_LEFT,
+ STAPLE_DUAL_TOP,
+ STAPLE_DUAL_RIGHT,
+ STAPLE_DUAL_BOTTOM };
+
+ /**
+ * Constructs a FinishingsSupported
object.
+ *
+ * @param value the value
+ */
+ protected FinishingsSupported(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return the class FinishingsSupported
itself
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return FinishingsSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "finishings-supported".
+ */
+ public String getName()
+ {
+ return "finishings-supported";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+ /**
+ * Returns the lowest used value by the enumerations of this class.
+ * .
+ * @return The lowest value used.
+ */
+ protected int getOffset()
+ {
+ return 3;
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this SupportedValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public Finishings getAssociatedAttribute()
+ {
+ return (Finishings) IppUtilities.getEnumAttribute(
+ "finishings", new Integer(getValue()));
+ }
+
+ /**
+ * Constructs an array from a set of -supported attributes.
+ * @param set set to process
+ * @return The constructed array.
+ *
+ * @see #getAssociatedAttribute()
+ */
+ public static Finishings[]
+ getAssociatedAttributeArray(SetGeneratedNaturalLanguageSupported
object.
+ *
+ * @param value the charset string value.
+ */
+ public GeneratedNaturalLanguageSupported(String value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class GeneratedNaturalLanguageSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return GeneratedNaturalLanguageSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "generated-natural-language-supported".
+ */
+ public String getName()
+ {
+ return "generated-natural-language-supported";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/IppVersionsSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/IppVersionsSupported.java
new file mode 100644
index 000000000..072d7499a
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/IppVersionsSupported.java
@@ -0,0 +1,122 @@
+/* IppVersionsSupported.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.supported;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+
+/**
+ * IppVersionsSupported attribute as described in RFC 2911 section
+ * 4.4.14 provides the value(s) (implemented as EnumSyntax)
+ * of the supported IPP versions.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class IppVersionsSupported extends EnumSyntax
+ implements SupportedValuesAttribute
+{
+
+ // a keyword based attribute in IPP - int values just starting at 0
+
+ /** IPP version 1.0 */
+ public static final IppVersionsSupported V_1_0 =
+ new IppVersionsSupported(0);
+
+ /** IPP version 1.1 */
+ public static final IppVersionsSupported V_1_1 =
+ new IppVersionsSupported(1);
+
+ private static final String[] stringTable = { "1.0", "1.1" };
+
+ private static final IppVersionsSupported[] enumValueTable = { V_1_0,
+ V_1_1 };
+
+ /**
+ * Constructs a IppVersionsSupported
object.
+ *
+ * @param value the enum value
+ */
+ public IppVersionsSupported(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns the category of this class.
+ *
+ * @return The class IppVersionsSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return IppVersionsSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "ipp-versions-supported".
+ */
+ public String getName()
+ {
+ return "ipp-versions-supported";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/JobHoldUntilSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/JobHoldUntilSupported.java
new file mode 100644
index 000000000..2add4a0cd
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/JobHoldUntilSupported.java
@@ -0,0 +1,134 @@
+/* JobHoldUntilSupported.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.supported;
+
+import java.util.Locale;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.SupportedValuesAttribute;
+import javax.print.attribute.TextSyntax;
+
+/**
+ * JobHoldUntilSupported attribute provides the supported
+ * values for the attribute type job-hold-until.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class JobHoldUntilSupported extends TextSyntax
+ implements SupportedValuesAttribute
+{
+
+ // a keyword/name based attribute in IPP
+ // can be extended by administrators
+ // standard values are predefined
+
+ /** Job should be printed immediately. */
+ public static final JobHoldUntilSupported NO_HOLD =
+ new JobHoldUntilSupported("no-hold", null);
+
+ /** Job should be hold indefinitely. */
+ public static final JobHoldUntilSupported INDEFINITE =
+ new JobHoldUntilSupported("indefinite", null);
+
+ /** Job should be processed during the day. */
+ public static final JobHoldUntilSupported DAY_TIME =
+ new JobHoldUntilSupported("day-time", null);
+
+ /** Job should be processed in the evening. */
+ public static final JobHoldUntilSupported EVENING =
+ new JobHoldUntilSupported("evening", null);
+
+ /** Job should be processed during night. */
+ public static final JobHoldUntilSupported NIGHT =
+ new JobHoldUntilSupported("night", null);
+
+ /** Job should be processed during the weekend. */
+ public static final JobHoldUntilSupported WEEKEND =
+ new JobHoldUntilSupported("weekend", null);
+
+ /**
+ * Job should be processed as second-shift
+ * (after close of business).
+ */
+ public static final JobHoldUntilSupported SECOND_SHIFT =
+ new JobHoldUntilSupported("second-shift", null);
+
+ /**
+ * Job should be processed as third-shift
+ * (after midnight).
+ */
+ public static final JobHoldUntilSupported THIRD_SHIFT =
+ new JobHoldUntilSupported("third-shift", null);
+
+ /**
+ * Creates a JobHoldUntilSupported
object with the
+ * given value and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @throws NullPointerException if value is null
+ */
+ public JobHoldUntilSupported(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class JobHoldUntilSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return JobHoldUntilSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "job-hold-until-supported".
+ */
+ public String getName()
+ {
+ return "job-hold-until-supported";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.java
new file mode 100644
index 000000000..aeb86ff10
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/JobSheetsSupported.java
@@ -0,0 +1,148 @@
+/* JobSheetsSupported.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.supported;
+
+import gnu.javax.print.ipp.attribute.defaults.JobSheetsDefault;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Set;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.SupportedValuesAttribute;
+import javax.print.attribute.TextSyntax;
+import javax.print.attribute.standard.JobSheets;
+
+/**
+ * JobSheetsSupported attribute provides the supported values
+ * of the job-sheets attribute.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class JobSheetsSupported extends TextSyntax
+ implements SupportedValuesAttribute
+{
+ //a keyword/name based attribute in IPP
+ // can be extended by administrators
+ // standard values are predefined
+
+ /** No job sheet is the default */
+ public static final JobSheetsDefault NONE =
+ new JobSheetsDefault("none", Locale.getDefault());
+
+ /** A job sheet is the default */
+ public static final JobSheetsDefault STANDARD =
+ new JobSheetsDefault("standard", Locale.getDefault());
+
+ /**
+ * Creates a JobSheetsSupported
object with the
+ * given value and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @throws NullPointerException if value is null
+ */
+ public JobSheetsSupported(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class JobSheetsSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return JobSheetsSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "job-sheets-supported".
+ */
+ public String getName()
+ {
+ return "job-sheets-supported";
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this SupportedValuesAttribute enum.
+ * May return null if no value exists in JPS API.
+ * + * @return The enum of the standard attribute class. + */ + public JobSheets getAssociatedAttribute() + { + if (this.equals(JobSheetsDefault.NONE)) + return JobSheets.NONE; + if (this.equals(JobSheetsDefault.STANDARD)) + return JobSheets.STANDARD; + + return null; + } + + /** + * Constructs an array from a set of -supported attributes. + * @param set set to process + * @return The constructed array. + * + * @see #getAssociatedAttribute() + */ + public static JobSheets[] + getAssociatedAttributeArray(SetMediaSupported
object with the
+ * given value and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use, if null
the default
+ * locale is used.
+ *
+ * @throws NullPointerException if value is null
+ */
+ public MediaSupported(String value, Locale locale)
+ {
+ super(value, locale);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class MediaSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return MediaSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "media-supported".
+ */
+ public String getName()
+ {
+ return "media-supported";
+ }
+
+ /**
+ * Constructs an array from a set of -supported attributes.
+ * @param set set to process
+ * @return The constructed array.
+ */
+ public static Media[] getAssociatedAttributeArray(SetMultipleDocumentHandlingSupported
provides the
+ * supported values for the MultipleDocumentHandling attribute.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class MultipleDocumentHandlingSupported extends EnumSyntax
+ implements SupportedValuesAttribute
+{
+
+ //a keyword based attribute in IPP - int values just starting at 0
+
+ /**
+ * Supports only multiple documents treated as a single document. This
+ * applies to attributes which specify treatment of multiple document jobs.
+ */
+ public static final MultipleDocumentHandlingSupported SINGLE_DOCUMENT =
+ new MultipleDocumentHandlingSupported(0);
+
+ /** Supports multiple documents as uncollated copies */
+ public static final MultipleDocumentHandlingSupported SEPARATE_DOCUMENTS_UNCOLLATED_COPIES =
+ new MultipleDocumentHandlingSupported(1);
+
+ /** Supports multiple documents as collated copies */
+ public static final MultipleDocumentHandlingSupported SEPARATE_DOCUMENTS_COLLATED_COPIES =
+ new MultipleDocumentHandlingSupported(2);
+
+ /**
+ * Supports multiple documents where every single document starts
+ * with a new sheet.
+ */
+ public static final MultipleDocumentHandlingSupported SINGLE_DOCUMENT_NEW_SHEET =
+ new MultipleDocumentHandlingSupported(3);
+
+ private static final String[] stringTable = { "single-document",
+ "separate-documents-uncollated-copies",
+ "separate-documents-collated-copies",
+ "single-document-new-sheet" };
+
+ private static final MultipleDocumentHandlingSupported[] enumValueTable =
+ { SINGLE_DOCUMENT, SEPARATE_DOCUMENTS_UNCOLLATED_COPIES,
+ SEPARATE_DOCUMENTS_COLLATED_COPIES, SINGLE_DOCUMENT_NEW_SHEET};
+
+ /**
+ * Constructs a MultipleDocumentHandlingSupported
object.
+ *
+ * @param value the enum value
+ */
+ protected MultipleDocumentHandlingSupported(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class MultipleDocumentHandlingSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return MultipleDocumentHandlingSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "multiple-document-handling-supported".
+ */
+ public String getName()
+ {
+ return "multiple-document-handling-supported";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this SupportedValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public MultipleDocumentHandling getAssociatedAttribute()
+ {
+ return (MultipleDocumentHandling) IppUtilities.getEnumAttribute(
+ "multiple-document-handling", new Integer(getValue()));
+ }
+
+ /**
+ * Constructs an array from a set of -supported attributes.
+ * @param set set to process
+ * @return The constructed array.
+ *
+ * @see #getAssociatedAttribute()
+ */
+ public static MultipleDocumentHandling[]
+ getAssociatedAttributeArray(SetMultipleDocumentJobsSupported
specifies if a printer
+ * supported multiple documents in one job.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public class MultipleDocumentJobsSupported extends EnumSyntax
+ implements SupportedValuesAttribute
+{
+
+ /** Multiple documents per job are not supported. */
+ public static final MultipleDocumentJobsSupported NOT_SUPPORTED =
+ new MultipleDocumentJobsSupported(0);
+
+ /** Multiple documents per job are supported. */
+ public static final MultipleDocumentJobsSupported SUPPORTED =
+ new MultipleDocumentJobsSupported(1);
+
+ private static final String[] stringTable = { "not-supported", "supported" };
+
+ private static final MultipleDocumentJobsSupported[] enumValueTable =
+ { NOT_SUPPORTED, SUPPORTED };
+
+ /**
+ * Constructs a MultipleDocumentJobsSupported
object.
+ *
+ * @param value the enum value
+ */
+ protected MultipleDocumentJobsSupported(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class MultipleDocumentJobsSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return MultipleDocumentJobsSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "multiple-document-jobs-supported".
+ */
+ public String getName()
+ {
+ return "multiple-document-jobs-supported";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/OperationsSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/OperationsSupported.java
new file mode 100644
index 000000000..a059c89a5
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/OperationsSupported.java
@@ -0,0 +1,231 @@
+/* OperationsSupported.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.supported;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+
+/**
+ * OperationsSupported
specifies the enums of the operations
+ * supported by a given printer or job object. The attribute is further
+ * specified in RFC 2911 section 4.4.15.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class OperationsSupported extends EnumSyntax
+ implements SupportedValuesAttribute
+{
+ /*
+ * Value Operation Name
+ ----------------- -------------------------------------
+ 0x0000 reserved, not used
+ 0x0001 reserved, not used
+ 0x0002 Print-Job
+ 0x0003 Print-URI
+ 0x0004 Validate-Job
+ 0x0005 Create-Job
+ 0x0006 Send-Document
+ 0x0007 Send-URI
+ 0x0008 Cancel-Job
+ 0x0009 Get-Job-Attributes
+ 0x000A Get-Jobs
+ 0x000B Get-Printer-Attributes
+ 0x000C Hold-Job
+ 0x000D Release-Job
+ 0x000E Restart-Job
+ 0x000F reserved for a future operation
+ 0x0010 Pause-Printer
+ 0x0011 Resume-Printer
+ 0x0012 Purge-Jobs
+ 0x0013-0x3FFF reserved for future IETF standards track operations
+ 0x4000-0x8FFF reserved for vendor extensions
+ */
+
+ // standard ipp 1.1 operations
+
+ /**
+ * Operation to print a job in one request/response. */
+ public static final OperationsSupported PRINT_JOB =
+ new OperationsSupported(0x02);
+
+ /** Operation to print a document from an URI */
+ public static final OperationsSupported PRINT_URI =
+ new OperationsSupported(0x03);
+
+ /** Operation to validate a job before submission. */
+ public static final OperationsSupported VALIDATE_JOB =
+ new OperationsSupported(0x04);
+
+ /**
+ * Operation to create an initial job for use with multiple document per job.
+ */
+ public static final OperationsSupported CREATE_JOB =
+ new OperationsSupported(0x05);
+
+ /**
+ * Operation to send a document to a multidoc job created via CREATE_JOB
+ */
+ public static final OperationsSupported SEND_DOCUMENT =
+ new OperationsSupported(0x06);
+
+ /**
+ * Operation to send a document uri to a multidoc job created
+ * via CREATE_JOB. The document accessible from this URI will be printed.
+ */
+ public static final OperationsSupported SEND_URI =
+ new OperationsSupported(0x07);
+
+ /** Operation to cancel a job by its ID or name. */
+ public static final OperationsSupported CANCEL_JOB =
+ new OperationsSupported(0x08);
+
+ /** Operation to get job attributes of a current job. */
+ public static final OperationsSupported GET_JOB_ATTRIBUTES =
+ new OperationsSupported(0x09);
+
+ /** Operation to pause a printer. */
+ public static final OperationsSupported PAUSE_PRINTER =
+ new OperationsSupported(0x10);
+
+ /** Operation to get all currently queued or processed jobs. */
+ public static final OperationsSupported GET_JOBS =
+ new OperationsSupported(0x0A);
+
+ /** Operation to get the attributes of a printer. */
+ public static final OperationsSupported GET_PRINTER_ATTRIBUTES =
+ new OperationsSupported(0x0B);
+
+ /** Operation to put a job on hold by its ID or name. */
+ public static final OperationsSupported HOLD_JOB =
+ new OperationsSupported(0x0C);
+
+ /** Operation to release a job by its ID or name. */
+ public static final OperationsSupported RELEASE_JOB =
+ new OperationsSupported(0x0D);
+
+ /** Operation to restart a job by its ID or name. */
+ public static final OperationsSupported RESTART_JOB =
+ new OperationsSupported(0x0E);
+
+ /** Not yet an operation - reserved for futher use. */
+ public static final OperationsSupported RESERVED =
+ new OperationsSupported(0x0F);
+
+ /** Operation to resume a printer. */
+ public static final OperationsSupported RESUME_PRINTER =
+ new OperationsSupported(0x11);
+
+ /** Operation to remove all jobs from a printer regardless of state. */
+ public static final OperationsSupported PURGE_JOBS =
+ new OperationsSupported(0x12);
+
+
+ private static final String[] stringTable = { "print-job", "print-uri",
+ "validate-job", "create-job",
+ "send-document", "send-uri",
+ "cancel-job", "get-job-attributes",
+ "pause-printer", "get-jobs",
+ "get-printer-attributes", "hold-job",
+ "release-job", "restart-job", "reserved",
+ "resume-printer", "purge-job"};
+
+ private static final OperationsSupported[] enumValueTable =
+ { PRINT_JOB, PRINT_URI, VALIDATE_JOB, CREATE_JOB, SEND_DOCUMENT, SEND_URI,
+ CANCEL_JOB, GET_JOB_ATTRIBUTES, PAUSE_PRINTER, GET_JOBS, GET_PRINTER_ATTRIBUTES,
+ HOLD_JOB, RELEASE_JOB, RESTART_JOB, RESERVED, RESUME_PRINTER, PURGE_JOBS};
+
+
+ /**
+ * Constructs a OperationsSupported
object.
+ *
+ * @param value the enum value
+ */
+ protected OperationsSupported(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class OperationsSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return OperationsSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "operations-supported".
+ */
+ public String getName()
+ {
+ return "operations-supported";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+ // we start with 2
+ protected int getOffset()
+ {
+ return 2;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/OrientationRequestedSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/OrientationRequestedSupported.java
new file mode 100644
index 000000000..4b87c53a5
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/OrientationRequestedSupported.java
@@ -0,0 +1,178 @@
+/* OrientationRequestedSupported.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.print.ipp.attribute.supported;
+
+import gnu.javax.print.ipp.IppUtilities;
+
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+import javax.print.attribute.standard.OrientationRequested;
+
+
+/**
+ * The OrientationRequestedSupported
attribute provides
+ * the supported values for the job attribute orientation-requested.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class OrientationRequestedSupported extends EnumSyntax
+ implements SupportedValuesAttribute
+{
+
+ /** Orientation as portrait. */
+ public static final OrientationRequestedSupported PORTRAIT =
+ new OrientationRequestedSupported(3);
+
+ /** Orientation as landscape. */
+ public static final OrientationRequestedSupported LANDSCAPE =
+ new OrientationRequestedSupported(4);
+
+ /** Orientation as reversed landscape. */
+ public static final OrientationRequestedSupported REVERSE_LANDSCAPE =
+ new OrientationRequestedSupported(5);
+
+ /** Orientation as reversed portrait. */
+ public static final OrientationRequestedSupported REVERSE_PORTRAIT =
+ new OrientationRequestedSupported(6);
+
+
+ private static final String[] stringTable = { "portrait", "landscape",
+ "reverse-landscape",
+ "reverse-portrait" };
+
+ private static final OrientationRequestedSupported[]
+ enumValueTable = { PORTRAIT, LANDSCAPE,
+ REVERSE_LANDSCAPE, REVERSE_PORTRAIT };
+
+ /**
+ * Constructs a OrientationRequestedSupported
object.
+ *
+ * @param value the value
+ */
+ protected OrientationRequestedSupported(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class OrientationRequestedSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return OrientationRequestedSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "orientation-requested-supported".
+ */
+ public String getName()
+ {
+ return "orientation-requested-supported";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+ /**
+ * Returns the lowest used value by the enumerations of this class.
+ * .
+ * @return The lowest value used.
+ */
+ protected int getOffset()
+ {
+ return 3;
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this SupportedValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public OrientationRequested getAssociatedAttribute()
+ {
+ return (OrientationRequested) IppUtilities.getEnumAttribute(
+ "orientation-requested", new Integer(getValue()));
+ }
+
+ /**
+ * Constructs an array from a set of -supported attributes.
+ * @param set set to process
+ * @return The constructed array.
+ *
+ * @see #getAssociatedAttribute()
+ */
+ public static OrientationRequested[]
+ getAssociatedAttributeArray(SetPageRangesSupported
is a boolean typed
+ * attribute indicating (as EnumSyntax) if page ranges
+ * are supported.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class PageRangesSupported extends EnumSyntax
+ implements SupportedValuesAttribute
+{
+ /** Page ranges are not supported. */
+ public static final PageRangesSupported NOT_SUPPORTED =
+ new PageRangesSupported(0);
+
+ /** Page ranges are supported. */
+ public static final PageRangesSupported SUPPORTED =
+ new PageRangesSupported(1);
+
+ private static final String[] stringTable = { "not-supported", "supported" };
+
+ private static final PageRangesSupported[] enumValueTable = { NOT_SUPPORTED,
+ SUPPORTED };
+
+ /**
+ * Constructs a PageRangesSupported
object.
+ *
+ * @param value the enum value
+ */
+ protected PageRangesSupported(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class PageRangesSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return PageRangesSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "page-ranges-supported".
+ */
+ public String getName()
+ {
+ return "page-ranges-supported";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrintQualitySupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrintQualitySupported.java
new file mode 100644
index 000000000..25cbf9f0b
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/PrintQualitySupported.java
@@ -0,0 +1,169 @@
+/* PrintQualitySupported.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.print.ipp.attribute.supported;
+
+import gnu.javax.print.ipp.IppUtilities;
+
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+import javax.print.attribute.standard.PrintQuality;
+
+
+/**
+ * PrintQualitySupported
provides the
+ * supported values for the print-quality attribute.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class PrintQualitySupported extends EnumSyntax
+ implements SupportedValuesAttribute
+{
+ /** Draft quality of the printer. */
+ public static final PrintQualitySupported DRAFT =
+ new PrintQualitySupported(3);
+
+ /** Normal quality of the printer. */
+ public static final PrintQualitySupported NORMAL =
+ new PrintQualitySupported(4);
+
+ /** High quality of the printer. */
+ public static final PrintQualitySupported HIGH =
+ new PrintQualitySupported(5);
+
+ private static final String[] stringTable = { "draft", "normal", "high" };
+
+ private static final PrintQualitySupported[] enumValueTable = { DRAFT,
+ NORMAL,
+ HIGH };
+
+ /**
+ * Constructs a PrintQualitySupported
object.
+ *
+ * @param value the value of the enum
+ */
+ protected PrintQualitySupported(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class PrintQualitySupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return PrintQualitySupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "print-quality-supported".
+ */
+ public String getName()
+ {
+ return "print-quality-supported";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+ /**
+ * Returns the lowest used value by the enumerations of this class.
+ * .
+ * @return The lowest value used.
+ */
+ protected int getOffset()
+ {
+ return 3;
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this SupportedValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public PrintQuality getAssociatedAttribute()
+ {
+ return (PrintQuality) IppUtilities.getEnumAttribute(
+ "print-quality", new Integer(getValue()));
+ }
+
+ /**
+ * Constructs an array from a set of -supported attributes.
+ * @param set set to process
+ * @return The constructed array.
+ *
+ * @see #getAssociatedAttribute()
+ */
+ public static PrintQuality[] getAssociatedAttributeArray(SetPrinterResolutionSupported
attribute provides
+ * the supported values for the job attribute printer-resolution.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class PrinterResolutionSupported extends ResolutionSyntax
+ implements SupportedValuesAttribute
+{
+
+ /**
+ * Creates a PrinterResolutionSupported
object with the
+ * given arguments.
+ *
+ * @param crossFeedResolution the cross feed resolution
+ * @param feedResolution the feed resolution
+ * @param units the unit to use (e.g. {@link #DPCM} or {@link #DPI})
+ *
+ * @exception IllegalArgumentException if preconditions fail
+ */
+ public PrinterResolutionSupported(int crossFeedResolution,
+ int feedResolution, int units)
+ {
+ super(crossFeedResolution, feedResolution, units);
+ }
+
+ /**
+ * Tests if the given object is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @return true
if both objects are equal,
+ * false
otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if(! (obj instanceof PrinterResolutionSupported))
+ return false;
+
+ return super.equals(obj);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class PrinterResolutionSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return PrinterResolutionSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "printer-resolution-supported".
+ */
+ public String getName()
+ {
+ return "printer-resolution-supported";
+ }
+
+ /**
+ * Returns the equally enum of the standard attribute class
+ * of this SupportedValuesAttribute enum.
+ *
+ * @return The enum of the standard attribute class.
+ */
+ public PrinterResolution getAssociatedAttribute()
+ {
+ return new PrinterResolution(getCrossFeedResolutionDphi(),
+ getFeedResolutionDphi(), 1);
+ }
+
+ /**
+ * Constructs an array from a set of -supported attributes.
+ * @param set set to process
+ * @return The constructed array.
+ *
+ * @see #getAssociatedAttribute()
+ */
+ public static PrinterResolution[]
+ getAssociatedAttributeArray(SetPrinterUriSupported
object.
+ *
+ * @param uri the URI value for the syntax
+ * @throws NullPointerException if uri is null
+ */
+ public PrinterUriSupported(URI uri)
+ {
+ super(uri);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class PrinterUriSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return PrinterUriSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "printer-uri-supported".
+ */
+ public String getName()
+ {
+ return "printer-uri-supported";
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/SidesSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/SidesSupported.java
new file mode 100644
index 000000000..eff82c143
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/SidesSupported.java
@@ -0,0 +1,137 @@
+/* SidesSupported.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.javax.print.ipp.attribute.supported;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+
+
+/**
+ * SidesSupported
provides the
+ * supported values for the sides attribute.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class SidesSupported extends EnumSyntax
+ implements SupportedValuesAttribute
+{
+
+ /** Specifies that each page should be printed on one sheet. */
+ public static final SidesSupported ONE_SIDED = new SidesSupported(0);
+
+ /**
+ * Specifies that two following pages should be printed on the
+ * front and back of one sheet for binding on the long edge.
+ */
+ public static final SidesSupported TWO_SIDED_LONG_EDGE =
+ new SidesSupported(1);
+
+ /**
+ * Specifies that two following pages should be printed on the
+ * front and back of one sheet for binding on the short edge.
+ */
+ public static final SidesSupported TWO_SIDED_SHORT_EDGE =
+ new SidesSupported(2);
+
+ /** An alias constant for "two sided long edge". */
+ public static final SidesSupported DUPLEX = new SidesSupported(1);
+
+ /** An alias constant for "two sided short edge". */
+ public static final SidesSupported TUMBLE = new SidesSupported(2);
+
+ private static final String[] stringTable = { "one-sided",
+ "two-sided-long-edge",
+ "two-sided-short-edge" };
+
+ private static final SidesSupported[]
+ enumValueTable = { ONE_SIDED, TWO_SIDED_LONG_EDGE,
+ TWO_SIDED_SHORT_EDGE };
+
+
+ /**
+ * Creates a SidesSupported
object.
+ *
+ * @param value the value of the enum
+ */
+ protected SidesSupported(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class SidesSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return SidesSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "sides-supported".
+ */
+ public String getName()
+ {
+ return "sides-supported";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/UriAuthenticationSupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/UriAuthenticationSupported.java
new file mode 100644
index 000000000..dc1a29f5c
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/UriAuthenticationSupported.java
@@ -0,0 +1,142 @@
+/* UriAuthenticationSupported.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.supported;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+
+/**
+ * UriAuthenticationSupported attribute as described in RFC 2911 section
+ * 4.4.2 provides the keywords (implemented as EnumSyntax) which
+ * authentication methods are supported by the printer object. This
+ * includes a value of none.
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class UriAuthenticationSupported extends EnumSyntax
+ implements SupportedValuesAttribute
+{
+
+ // a keyword based attribute in IPP - int values just starting at 0
+
+ /** Supports no authentication - assumes anonymous process */
+ public static final UriAuthenticationSupported NONE =
+ new UriAuthenticationSupported(0);
+
+ /**
+ * The authenticated user assumed is the value of the
+ * "requesting-user-name" operation attribute supplied
+ * with the operation.
+ */
+ public static final UriAuthenticationSupported REQUESTING_USER_NAME =
+ new UriAuthenticationSupported(1);
+
+ /** Supports HTTP basic authentication (RFC 2617) */
+ public static final UriAuthenticationSupported BASIC =
+ new UriAuthenticationSupported(2);
+
+ /** Supports HTTP digest authentication (RFC 2617) */
+ public static final UriAuthenticationSupported DIGEST =
+ new UriAuthenticationSupported(3);
+
+ /** Supports authentication through a client provided certificate */
+ public static final UriAuthenticationSupported CERTIFICATE =
+ new UriAuthenticationSupported(4);
+
+ private static final String[] stringTable = { "none",
+ "requesting-user-name",
+ "basic", "digest",
+ "certificate" };
+
+ private static final UriAuthenticationSupported[] enumValueTable =
+ { NONE, REQUESTING_USER_NAME, BASIC, DIGEST, CERTIFICATE };
+
+ /**
+ * Constructs a UriAuthenticationSupported
object.
+ *
+ * @param value the enum value
+ */
+ public UriAuthenticationSupported(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class UriAuthenticationSupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return UriAuthenticationSupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "uri-authentication-supported".
+ */
+ public String getName()
+ {
+ return "uri-authentication-supported";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+}
diff --git a/libjava/classpath/gnu/javax/print/ipp/attribute/supported/UriSecuritySupported.java b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/UriSecuritySupported.java
new file mode 100644
index 000000000..03396978f
--- /dev/null
+++ b/libjava/classpath/gnu/javax/print/ipp/attribute/supported/UriSecuritySupported.java
@@ -0,0 +1,127 @@
+/* UriSecuritySupported.java --
+ Copyright (C) 2006 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.javax.print.ipp.attribute.supported;
+
+import javax.print.attribute.Attribute;
+import javax.print.attribute.EnumSyntax;
+import javax.print.attribute.SupportedValuesAttribute;
+
+/**
+ * UriSecuritySupported attribute as described in RFC 2911 section
+ * 4.4.3 provides the keywords (implemented as EnumSyntax) for
+ * the security mechanisms supported by the corresponding uri's
+ * supported (same place in setOf).
+ *
+ * @author Wolfgang Baer (WBaer@gmx.de)
+ */
+public final class UriSecuritySupported extends EnumSyntax
+ implements SupportedValuesAttribute
+{
+
+ // a keyword based attribute in IPP - int values just starting at 0
+
+ /** The URI has no secure communication */
+ public static final UriSecuritySupported NONE =
+ new UriSecuritySupported(0);
+
+ /** The URI has SSL3 communication */
+ public static final UriSecuritySupported SSL3 =
+ new UriSecuritySupported(1);
+
+ /** The URI has TLS (RFC 2246) communication */
+ public static final UriSecuritySupported TLS =
+ new UriSecuritySupported(2);
+
+ private static final String[] stringTable = { "none", "ssl3", "tls" };
+
+ private static final UriSecuritySupported[] enumValueTable = { NONE,
+ SSL3, TLS };
+
+ /**
+ * Constructs a UriSecuritySupported
object.
+ *
+ * @param value the enum value
+ */
+ public UriSecuritySupported(int value)
+ {
+ super(value);
+ }
+
+ /**
+ * Returns category of this class.
+ *
+ * @return The class UriSecuritySupported
itself.
+ */
+ public Class extends Attribute> getCategory()
+ {
+ return UriSecuritySupported.class;
+ }
+
+ /**
+ * Returns the name of this attribute.
+ *
+ * @return The name "uri-security-supported".
+ */
+ public String getName()
+ {
+ return "uri-security-supported";
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * @return The enumeration values as strings.
+ */
+ protected String[] getStringTable()
+ {
+ return stringTable;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * @return The enumeration values.
+ */
+ protected EnumSyntax[] getEnumValueTable()
+ {
+ return enumValueTable;
+ }
+
+}
--
cgit v1.2.3