Report problems to ATLAS LXR Team (with time and IP address indicated) |
|
[ source navigation ] [ diff markup ] [ identifier search ] [ general search ] |
||||
|
||||||
Links to LXR source navigation pages for stable releases | [ 12.*.* ] [ 13.*.* ] [ 14.*.* ] |
001 import java.util.*; 002 import java.io.*; 003 import java.net.*; 004 import java.awt.*; 005 006 public class taginfo { 007 public static void main(String argv[]) { 008 boolean newRead = false; 009 010 if (argv.length == 0) { 011 012 System.out.println("TC2:"); 013 System.out.println("> taginfo AMI [command] [options]"); 014 015 System.exit(0); 016 017 } 018 019 StringBuffer request = new StringBuffer(); 020 021 int i = 0; 022 023 if (argv[i].equals("AMI")) { 024 newRead = true; 025 for (i = 1; i < argv.length; i++) { 026 if (i == 1) { 027 request.append("" + argv[i]); 028 } 029 else if (argv[i].startsWith("-")) { 030 request.append("+-"); 031 request.append(argv[i].substring(1).replaceAll("=", "%3D")); 032 } 033 } 034 } 035 else { 036 System.out.println("error : first command argument must be 'AMI' "); 037 System.exit(1); 038 } 039 040 readTC2(request.toString()); 041 } 042 043 private static void readTC2(String request) { 044 boolean isError = false; 045 String command = "SearchQuery+-project%3DDC1+-processingStep%3Dsimulation+-sql%3D%22select+*+from+partition+limit+0%2C4000"; 046 //String http_request = "http://atlastagcollector.in2p3.fr:8080/AMI/servlet/net.hep.atlas.Database.Bookkeeping.AMI.Servlet.Command?Command="+request+"&&Converter=%2Fusr%2Flocal%2Ftomcat-jwsdp-1.4%2Fwebapps%2FAMI%2FAMI%2Fxsl%2FAMIXmlTreeToCsv.xsl&Valider=Execute&gc=&ac="; 047 String http_request = "http://atlastagcollector.in2p3.fr:8080/AMI/servlet/net.hep.atlas.Database.Bookkeeping.AMI.Servlet.Command?Command=" + 048 request + "&&Converter=%2Fusr%2Flocal%2Fjakarta-tomcat-5.0.28%2Fwebapps%2FAMI%2FAMI%2Fxsl%2FAMIForNICOS.xsl&Valider=Execute&gc=&ac="; 049 //String http_request = "http://localhost.in2p3.fr:8080/AMI_Bak/servlet/net.hep.atlas.Database.Bookkeeping.AMI.Servlet.Command?Command="+command+"%22&Converter=&Valider=Execute&gc=&ac="; 050 //System.out.println ("Trying:" + http_request); 051 052 try { 053 URL url = new URL(http_request); 054 InputStream stream = url.openStream(); 055 BufferedReader file = new BufferedReader(new InputStreamReader(stream)); 056 StringBuffer result = new StringBuffer(); 057 String line = ""; 058 059 StringBuffer res = new StringBuffer(); 060 boolean validResult = false; 061 062 while (true) { 063 try { 064 line = file.readLine(); 065 if (line == null)break; 066 if (!line.startsWith("<a href")) { 067 if (line.trim().startsWith("taginfo_error")) { 068 isError = true; 069 res.append("\nerror : server side error"); 070 } 071 else { 072 if (line.contains("AMI_RESULT_END")) { 073 validResult = true; 074 } 075 else { 076 res.append("\n" + line); 077 } 078 } 079 } 080 } 081 catch (Exception e) { 082 System.out.println("\nerror : " + e.getMessage()); 083 System.exit(1); 084 085 } 086 } 087 088 if (!validResult) { 089 throw new Exception("result is not ended properly"); 090 } 091 092 System.out.println(res.toString()); 093 } 094 catch (Exception e) { 095 System.out.println("\nerror : " + e.getMessage()); 096 System.exit(1); 097 } 098 if (isError) 099 System.exit(1); 100 } 101 }
[ source navigation ] | [ diff markup ] | [ identifier search ] | [ general search ] |
Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems | |
This page was automatically generated by the LXR engine. |