📄 gatewayconfigurationhandler.java
字号:
stackConfiguration.addListeningPoint(stackPort,stackTransport); } } if (element.compareToIgnoreCase("RANK") ==0 ) { String position=attrs.getValue("position"); if (position==null || position.trim().equals("")) { configurationMessage ("ERROR: the position rank is not set"); } Rank rank=new Rank(position); configuration.rankList.addElement(rank); } if (element.compareToIgnoreCase("LOCATION") ==0 ) { String name=attrs.getValue("name"); if (name==null || name.trim().equals("")) { configurationMessage ("ERROR: the name of the location is not set"); } Location location=new Location(name); configuration.locationList.addElement(location); } if (element.compareToIgnoreCase("LOGGING") ==0 ) { String remoteLogAccess = attrs.getValue("access_log_via_rmi"); if (remoteLogAccess != null && remoteLogAccess.equalsIgnoreCase("true")) { configurationMessage ("INFORMATION: RMI access to log file enabled"); configuration.accessLogViaRMI = true; String rmiPort = attrs.getValue("rmi_port"); if (rmiPort != null) { configuration.logRMIPort = rmiPort; configurationMessage ("INFORMATION: the RMI port for log file is: " + configuration.logRMIPort); } else { configuration.logRMIPort = "0"; } configurationMessage ("INFORMATION: the default RMI port for log file is: " + configuration.logRMIPort); configuration.logLifetime = attrs.getValue("log_lifetime"); if (configuration.logLifetime != null) configurationMessage ("INFORMATION: the log lifetime is: " + configuration.logLifetime); } else { configurationMessage ("INFORMATION: RMI access to log file disabled"); } String enableDebug=attrs.getValue("enable_debug"); if (enableDebug==null || enableDebug.trim().equals("") ) { configuration.enableDebug=false; configurationMessage ("INFORMATION: the Debug feature is not set"); } else { try{ boolean deb=Boolean.valueOf (enableDebug.trim()).booleanValue(); if ( deb) { configurationMessage ("INFORMATION: the Debug feature is set"); configuration.enableDebug=deb; } else { configuration.enableDebug=false; configurationMessage ("INFORMATION: the Debug feature is not set"); } } catch(Exception e) { configuration.enableDebug=false; configurationMessage ("INFORMATION: the Debug feature is not set"); } } String serverLogFile=attrs.getValue("server_log"); if (serverLogFile==null || serverLogFile.trim().equals("")) { configurationMessage ("INFORMATION: the server message log file is not set"); } else { configuration.serverLogFile=serverLogFile.trim(); configurationMessage ("INFORMATION: the server message log file is: " + configuration.serverLogFile); } String badMessageLog=attrs.getValue("bad_message_log"); if (badMessageLog==null || badMessageLog.trim().equals("")) { configurationMessage ("INFORMATION: the bad message log file is not set"); } else { configuration.badMessageLogFile= badMessageLog.trim(); configurationMessage ("INFORMATION: the bad message log is: " + configuration.badMessageLogFile); } String debugLog=attrs.getValue("debug_log"); if (debugLog==null || debugLog.trim().equals("")) { configurationMessage ("INFORMATION: the debug log file is not set"); } else { configuration.debugLogFile=debugLog.trim(); configurationMessage ("INFORMATION: the debug log file is: " + configuration.debugLogFile); } String outputProxy=attrs.getValue("output_launcher"); if (outputProxy==null || outputProxy.trim().equals("")) { configurationMessage ("INFORMATION: the output Proxy file is not set"); } else { configuration.outputProxy=outputProxy.trim(); configurationMessage ("INFORMATION: the output Proxy file is: " + configuration.outputProxy); } } if (element.compareToIgnoreCase("RTP_GATEWAY") ==0 ) { String enableRTPGateway=attrs.getValue("enable"); if (enableRTPGateway==null || enableRTPGateway.trim().equals("")) { configurationMessage ("INFORMATION: the RTP_GATEWAY is disabled"); configuration.enableRTPGateway=false; } else { try{ Boolean b=Boolean.valueOf (enableRTPGateway.trim()); if ( b.booleanValue() ) { configuration.enableRTPGateway=true; configurationMessage ("INFORMATION: the RTP_GATEWAY is enabled"); String minRTPHolePort=attrs.getValue("min_rtp_port"); if (minRTPHolePort==null || minRTPHolePort.trim().equals("")) { configurationMessage ("ERROR: the min_rtp_port is not set"); configuration.minRTPHolePort=-1; } else { try{ configuration.minRTPHolePort=Integer.valueOf(minRTPHolePort).intValue(); } catch(Exception e) { configurationMessage ("ERROR: the minRTPHolePort is not valid"); configuration.minRTPHolePort=-1; } } String maxRTPHolePort=attrs.getValue("max_rtp_port"); if (maxRTPHolePort==null || maxRTPHolePort.trim().equals("")) { configurationMessage ("ERROR: the maxRTPHolePort is not set"); configuration.maxRTPHolePort=-1; } else { try{ configuration.maxRTPHolePort=Integer.valueOf(maxRTPHolePort).intValue(); } catch(Exception e) { configurationMessage ("ERROR: the max_rtp_port is not valid"); configuration.maxRTPHolePort=-1; } } String maxPacketSize=attrs.getValue("max_packet_size"); if (maxPacketSize==null || maxPacketSize.trim().equals("")) { configurationMessage ("ERROR: the max_packet_size is not set"); configuration.maxRTPPacketSize=-1; } else { try{ configuration.maxRTPPacketSize=Integer.valueOf(maxPacketSize).intValue(); } catch(Exception e) { configurationMessage ("ERROR: the maxPacketSize is not valid"); configuration.maxRTPPacketSize=-1; } } } else { configuration.enableRTPGateway=false; configurationMessage ("INFORMATION: the RTP_GATEWAY is disabled"); } } catch(Exception e) { configuration.enableRTPGateway=false; configurationMessage ("INFORMATION: the RTP_GATEWAY is disabled"); } } } } public void endElement(String namespaceURI, String sName, // simple name String qName // qualified name ) throws SAXException { String element=qName; } public void characters(char buf[], int offset, int len) throws SAXException { String str = new String(buf, offset, len); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -