1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  *
23  * ident	"%Z%%M%	%I%	%E% SMI"
24  *
25  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
26  * Use is subject to license terms.
27  *
28  * pmCalls.java
29  * Debug messages
30  */
31 
32 package com.sun.admin.pm.client;
33 
34 import java.awt.*;
35 import java.applet.*;
36 import java.io.*;
37 import java.util.*;
38 import javax.swing.*;
39 
40 import com.sun.admin.pm.server.*;
41 
42 
43 /*
44  * Class of calls to backend
45  */
46 
47 public class pmCalls {
48 
49 /*
50  * Debugging routines
51  */
52 
testout(String out)53     public static void testout(String out) {
54 	Debug.info(out);
55     }
56 
debugShowPrinter(Printer p)57     public static void debugShowPrinter(Printer p) {
58 	Debug.info("CLNT:  debugShowPrinter");
59 
60         if (p.getPrinterName() != null) {
61 	    Debug.info("CLNT:  printer " +
62                             p.getPrinterName());
63         }
64 
65         if (p.getPrintServer() != null)
66             Debug.info("CLNT:  server " +
67                              p.getPrintServer());
68 
69         if (p.getPrinterType() != null)
70             Debug.info("CLNT:  printer type " +
71                             p.getPrinterType());
72 
73         if (p.getComment() != null)
74             Debug.info("CLNT:  Comment " +
75                             p.getComment());
76 
77         if (p.getDevice() != null)
78             Debug.info("CLNT:  Device " +
79                             p.getDevice());
80 
81 	if (p.getMake() != null)
82 	    Debug.info("CLNT:  Make " +
83 			    p.getMake());
84 	else
85 	    Debug.info("CLNT:  Make is null");
86 
87 	if (p.getModel() != null)
88 	    Debug.info("CLNT:  Model " +
89 			    p.getModel());
90 	else
91 	    Debug.info("CLNT:  Model is null");
92 
93 	if (p.getPPD() != null)
94 	    Debug.info("CLNT:  PPD " +
95 			    p.getPPD());
96 	else
97 	    Debug.info("CLNT:  PPD is null");
98 
99         if (p.getNotify() != null)
100             Debug.info("CLNT:  Notify " +
101                             p.getNotify());
102 
103 	if (p.getBanner() != null)
104 	    Debug.info("CLNT:  Banner " + p.getBanner());
105 
106         if (p.getProtocol() != null)
107             Debug.info("CLNT:  Protocol " +
108                             p.getProtocol());
109 
110         if (p.getDestination() != null)
111             Debug.info("CLNT:  Destination " +
112                             p.getDestination());
113 
114         if (p.getFileContents() != null) {
115 
116             String filedata[] = p.getFileContents();
117             String filecontents = new String();
118 
119 	    Debug.info("CLNT:  File Contents: ");
120 
121             if (filedata != null) {
122 		for (int i = 0; i < filedata.length; i++) {
123 			Debug.info("        " + filedata[i]);
124 		}
125 	    }
126         }
127 
128 	if (p.getNotify() != null) {
129 	    Debug.info("CLNT:  Fault Notification: " + p.getNotify());
130 	}
131 
132 	String ua[] = p.getUserAllowList();
133         Debug.info("CLNT:  UserAllowList ");
134         if (ua != null) {
135 		for (int i = 0; i < ua.length; i++) {
136 			Debug.info("        " + ua[i]);
137 		}
138 	}
139 
140         Debug.info("CLNT:  getIsDefaultPrinter is " + p.getIsDefaultPrinter());
141 
142     }
143 
debugshowPrinterList(NameService ns)144     public static void debugshowPrinterList(NameService ns) {
145 
146 	String[] list;
147 
148 	try {
149 		list = PrinterUtil.getPrinterList(ns);
150 		for (int i = 0; i < list.length; i++)
151 			Debug.info("CLNT:  " + list[i]);
152 	} catch (Exception e) {
153 		Debug.info("CLNT: debugshowPrinterList(): exception " + e);
154 	}
155 
156     }
157 
158 }
159