/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* define doc flavors for text types in the default encoding of
* this platform since we can always read those.
*/
};
};
"",
"| grep -E '^[ 0-9a-zA-Z_-]*@' | awk '{print $2, $3}'"
};
"",
"| grep -E '^[ 0-9a-zA-Z_-]*@' | awk '{print $4}'"
};
static {
}
/* let's try to support a few of these */
PrinterName.class,
PrinterIsAcceptingJobs.class,
QueuedJobCount.class,
};
/* it turns out to be inconvenient to store the other categories
* separately because many attributes are in multiple categories.
*/
Chromaticity.class,
Copies.class,
Destination.class,
Fidelity.class,
JobName.class,
JobSheets.class,
Media.class, /* have to support this somehow ... */
MediaPrintableArea.class,
OrientationRequested.class,
PageRanges.class,
RequestingUserName.class,
SheetCollate.class,
Sides.class,
};
};
private boolean isInvalid;
throw new IllegalArgumentException("null printer name");
}
isInvalid = false;
}
public void invalidateService() {
isInvalid = true;
}
return printer;
}
}
return name;
}
return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
}
/* As well as "myprinter accepting requests", look for
* "myprinter@somehost accepting requests".
*/
return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
}
}
}
return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS ;
}
if (UnixPrintServiceLookup.cmdIndex ==
}
if (UnixPrintServiceLookup.cmdIndex ==
return PrinterIsAcceptingJobs.ACCEPTING_JOBS ;
}
} else {
return PrinterIsAcceptingJobs.ACCEPTING_JOBS ;
}
}
}
return PrinterIsAcceptingJobs.NOT_ACCEPTING_JOBS ;
}
if (UnixPrintServiceLookup.isSysV()) {
return getPrinterIsAcceptingJobsSysV();
} else if (UnixPrintServiceLookup.isBSD()) {
return getPrinterIsAcceptingJobsBSD();
} else {
return PrinterIsAcceptingJobs.ACCEPTING_JOBS;
}
}
if (isInvalid) {
return PrinterState.STOPPED;
} else {
return null;
}
}
if (isInvalid) {
return psr;
} else {
return null;
}
}
return new QueuedJobCount(qlen);
}
if (UnixPrintServiceLookup.cmdIndex ==
}
int qlen = 0;
if (UnixPrintServiceLookup.cmdIndex ==
} else {
return new QueuedJobCount(0);
} else {
}
}
try {
} catch (NumberFormatException e) {
}
}
return new QueuedJobCount(qlen);
}
if (UnixPrintServiceLookup.isSysV()) {
return getQueuedJobCountSysV();
} else if (UnixPrintServiceLookup.isBSD()) {
return getQueuedJobCountBSD();
} else {
return new QueuedJobCount(0);
}
}
return attrs;
}
return attrs;
}
}
return true;
}
}
return false;
}
}
return new UnixPrintJob(this);
}
if (UnixPrintServiceLookup.isSysV()) {
return getSysVServiceAttributes();
} else {
return getBSDServiceAttributes();
}
}
} else {
new HashPrintServiceAttributeSet();
}
}
}
}
public void wakeNotifier() {
synchronized (this) {
}
}
}
public void addPrintServiceAttributeListener(
synchronized (this) {
return;
}
notifier = new ServiceNotifier(this);
}
}
}
public void removePrintServiceAttributeListener(
synchronized (this) {
return;
}
}
}
}
public <T extends PrintServiceAttribute>
{
throw new NullPointerException("category");
}
throw new IllegalArgumentException("Not a PrintServiceAttribute");
}
if (category == PrinterName.class) {
return (T)getPrinterName();
} else if (category == PrinterState.class) {
return (T)getPrinterState();
} else if (category == PrinterStateReasons.class) {
return (T)getPrinterStateReasons();
} else if (category == QueuedJobCount.class) {
return (T)getQueuedJobCount();
} else if (category == PrinterIsAcceptingJobs.class) {
return (T)getPrinterIsAcceptingJobs();
} else {
return null;
}
}
}
if (prnStateReasons != null) {
}
}
private void initSupportedDocFlavors() {
// copy host encoding flavors
} else {
}
}
if (supportedDocFlavors == null) {
}
return flavors;
}
if (supportedDocFlavors == null) {
}
return true;
}
}
return false;
}
return cats;
}
public boolean
{
throw new NullPointerException("null category");
}
throw new IllegalArgumentException(category +
" is not an Attribute");
}
if (category == otherAttrCats[i]) {
return true;
}
}
return false;
}
/* return defaults for all attributes for which there is a default
* value
*/
public Object
{
throw new NullPointerException("null category");
}
throw new IllegalArgumentException(category +
" is not an Attribute");
}
if (!isAttributeCategorySupported(category)) {
return null;
}
return new Copies(1);
} else if (category == Chromaticity.class) {
return Chromaticity.COLOR;
} else if (category == Destination.class) {
try {
} catch (SecurityException se) {
try {
} catch (URISyntaxException e) {
return null;
}
}
return Fidelity.FIDELITY_FALSE;
if (defaultCountry != null &&
return MediaSizeName.NA_LETTER;
} else {
return MediaSizeName.ISO_A4;
}
} else if (category == MediaPrintableArea.class) {
if (defaultCountry != null &&
} else {
}
} else if (category == OrientationRequested.class) {
return OrientationRequested.PORTRAIT;
} else if (category == PageRanges.class) {
} else if (category == RequestingUserName.class) {
try {
} catch (SecurityException se) {
}
} else if (category == SheetCollate.class) {
return SheetCollate.UNCOLLATED;
} else
return null;
}
return true;
}
else {
return false;
}
}
public Object
{
throw new NullPointerException("null category");
}
throw new IllegalArgumentException(category +
" does not implement Attribute");
}
if (!isDocFlavorSupported(flavor)) {
throw new IllegalArgumentException(flavor +
" is an unsupported flavor");
} else if (isAutoSense(flavor)) {
return null;
}
}
if (!isAttributeCategorySupported(category)) {
return null;
}
if (category == Chromaticity.class) {
return (arr);
} else {
return null;
}
} else if (category == Destination.class) {
try {
} catch (SecurityException se) {
try {
} catch (URISyntaxException e) {
return null;
}
}
return arr;
} else if (category == RequestingUserName.class) {
try {
} catch (SecurityException se) {
}
} else if (category == OrientationRequested.class) {
return arr;
} else {
return null;
}
(category == CopiesSupported.class)) {
} else {
return null;
}
return arr;
return arr;
} else if (category == MediaPrintableArea.class) {
/* The code below implements the behaviour that if no Media or
* MediaSize attribute is specified, return an array of
* MediaPrintableArea, one for each supported Media.
* If a MediaSize is specified, return a MPA consistent for that,
* and if a Media is specified locate its MediaSize and return
* its MPA, and if none is found, return an MPA for the default
* Media for this service.
*/
if (attributes == null) {
return getAllPrintableAreas();
}
if (media instanceof MediaSizeName) {
/* try to get a size from the default media */
if (media instanceof MediaSizeName) {
}
/* shouldn't happen, return a default */
8f, 10.5f,
return arr;
}
}
} else {
return getAllPrintableAreas();
}
}
/* If reach here MediaSize is non-null */
return arr;
} else if (category == PageRanges.class) {
return arr;
} else {
return null;
}
} else if (category == SheetCollate.class) {
return arr;
} else {
return null;
}
return arr;
} else {
return null;
}
} else {
return null;
}
}
if (media[i] instanceof MediaSizeName) {
mpas[i] = (MediaPrintableArea)
} else {
}
}
}
}
return mpasCopy;
}
/* Is this one of the flavors that this service explicitly
* generates postscript for, and so can control how it is rendered?
*/
return
}
throw new NullPointerException("null attribute");
}
if (!isDocFlavorSupported(flavor)) {
throw new IllegalArgumentException(flavor +
" is an unsupported flavor");
} else if (isAutoSense(flavor)) {
return false;
}
}
if (!isAttributeCategorySupported(category)) {
return false;
}
} else {
return false;
}
}
return true;
} else {
return false;
}
if (attr instanceof MediaSizeName) {
} else {
return false;
}
return false;
}
return false;
}
return false;
}
return false;
}
}
return true;
}
"is not supported");
}
if (attributes == null) {
return null;
}
try {
attributes)) {
}
} catch (ClassCastException e) {
}
}
return null;
} else {
return unsupp;
}
}
return null;
}
return "Unix Printer : " + getName();
}
return (obj == this ||
(obj instanceof UnixPrintService &&
}
public int hashCode() {
}
}
}