[Fedora-directory-commits] directoryconsole/src/com/netscape/admin/dirserv/logging DSLogViewerModel.java, 1.1.1.1, 1.2

Nathan Kinder (nkinder) fedora-directory-commits at redhat.com
Mon Jul 2 19:44:11 UTC 2007


Author: nkinder

Update of /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/logging
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5440/src/com/netscape/admin/dirserv/logging

Modified Files:
	DSLogViewerModel.java 
Log Message:
Resolves: 246513
Summary: Removed server root concept from Directory Console.



Index: DSLogViewerModel.java
===================================================================
RCS file: /cvs/dirsec/directoryconsole/src/com/netscape/admin/dirserv/logging/DSLogViewerModel.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- DSLogViewerModel.java	18 Jul 2005 00:55:49 -0000	1.1.1.1
+++ DSLogViewerModel.java	2 Jul 2007 19:44:09 -0000	1.2
@@ -31,8 +31,8 @@
 public class DSLogViewerModel extends DefaultTableModel {
 
 	public DSLogViewerModel(ConsoleInfo consoleInfo, String url) {
-		_url = consoleInfo.getAdminURL() +
-			consoleInfo.get( "ServerInstance" ) + "/" + url;
+		_serverID = (String)consoleInfo.get( "ServerInstance" );
+		_url = consoleInfo.getAdminURL() + _serverID + "/" + url;
 		_password = consoleInfo.getAuthenticationPassword();
 		_username = (String)consoleInfo.get( GlobalConstants.TASKS_AUTH_DN );
 		_password = (String)consoleInfo.get( GlobalConstants.TASKS_AUTH_PWD );
@@ -65,41 +65,46 @@
 		return false;
     }
 
-	/**
-	 * Fetch data from Directory/Admin Server.
-	 *
-	 */
+    /**
+     * Fetch data from Directory/Admin Server.
+     *
+     */
     public void updateLogData() {
         if (!_updating) {
             _updating = true;       // this gets reset in derived classes finish()
-    		/* Tack the log file name on to the URL */
-			Hashtable args = new Hashtable();
-			args.put("logfile", getLogFileName());
-    		/* Tack on the number of lines to return */
-			args.put("num", Integer.toString(getLineCount()));
-    		/* If a filter string was specified, tack that on */
-    		if ( getFilter() != null )
-				args.put("str", getFilter());
-    		try {
-    			URL url = new URL( _url );
-    			Debug.println( "DSLogViewerModel.updateLogData: " + url );
-    			HttpManager _httpManager = new HttpManager();
-				// tell the http manager to use UTF8 encoding
-				_httpManager.setSendUTF8(true);
-				InputStream data = CGIReportTask.encode(args);
-				_httpManager.post(url, getCommClient(), null, data, data.available(),
-								 CommManager.FORCE_BASIC_AUTH|
-								 CommManager.ASYNC_RESPONSE);
-    			waitForFinish();
-    		}
-    		catch (Exception e) {
-    			Debug.println( "DSLogViewerModel.updateLogData for " +
-    								_url + ": " + e );
-    		}
-    		fireTableDataChanged();
+            Hashtable args = new Hashtable();
+            /* Set which server's log you want */
+            args.put("id", _serverID);
+            /* Set which logfile you want to view */
+            args.put("file", getLogFileName());
+            /* Tack on the number of lines to return */
+            args.put("num", Integer.toString(getLineCount()));
+            /* We only want the CGI to return raw log content */
+            args.put("nohtml", "1");
+            /* If a filter string was specified, tack that on */
+            if ( getFilter() != null )
+                args.put("str", getFilter());
+            try {
+                URL url = new URL( _url );
+                Debug.println( "DSLogViewerModel.updateLogData: " + url );
+                HttpManager _httpManager = new HttpManager();
+                // tell the http manager to use UTF8 encoding
+                _httpManager.setSendUTF8(true);
+                InputStream data = CGIReportTask.encode(args);
+                _httpManager.post(url, getCommClient(), null,
+                                  data, data.available(),
+                                  CommManager.FORCE_BASIC_AUTH|
+                                  CommManager.ASYNC_RESPONSE);
+                waitForFinish();
+            }
+            catch (Exception e) {
+                Debug.println( "DSLogViewerModel.updateLogData for " +
+                               _url + ": " + e );
+            }
+            fireTableDataChanged();
             Debug.println("DSLogViewerModel done requesting");
         }
-	}
+    }
 
     public void updateLogLength() {
 	}
@@ -224,6 +229,7 @@
 	protected String _url;
 	String _username;
 	String _password;
+        private String _serverID = null;
 	private String _logName = null;
 	protected static ResourceSet _resource;
 	protected static String _section;




More information about the Fedora-directory-commits mailing list