Source Code Cross Referenced for WhoisClient.java in  » Net » Apache-commons-net-1.4.1 » org » apache » commons » net » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » Apache commons net 1.4.1 » org.apache.commons.net 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


01:        /*
02:         * Copyright 2001-2005 The Apache Software Foundation
03:         *
04:         * Licensed under the Apache License, Version 2.0 (the "License");
05:         * you may not use this file except in compliance with the License.
06:         * You may obtain a copy of the License at
07:         *
08:         *     http://www.apache.org/licenses/LICENSE-2.0
09:         *
10:         * Unless required by applicable law or agreed to in writing, software
11:         * distributed under the License is distributed on an "AS IS" BASIS,
12:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13:         * See the License for the specific language governing permissions and
14:         * limitations under the License.
15:         */
16:        package org.apache.commons.net;
17:
18:        import java.io.IOException;
19:        import java.io.InputStream;
20:
21:        /***
22:         * The WhoisClient class implements the client side of the Internet Whois
23:         * Protocol defined in RFC 954.   To query a host you create a
24:         * WhoisClient instance, connect to the host, query the host, and finally
25:         * disconnect from the host.  If the whois service you want to query is on
26:         * a non-standard port, connect to the host at that port.
27:         * Here's a sample use:
28:         * <pre>
29:         *    WhoisClient whois;
30:         *
31:         *    whois = new WhoisClient();
32:         *
33:         *    try {
34:         *      whois.connect(WhoisClient.DEFAULT_HOST);
35:         *      System.out.println(whois.query("foobar"));
36:         *      whois.disconnect();
37:         *    } catch(IOException e) {
38:         *      System.err.println("Error I/O exception: " + e.getMessage());
39:         *      return;
40:         *    }
41:         * </pre>
42:         *
43:         * <p>
44:         * <p>
45:         * @author Daniel F. Savarese
46:         ***/
47:
48:        public final class WhoisClient extends FingerClient {
49:            /***
50:             * The default whois host to query.  It is set to whois.internic.net.
51:             ***/
52:            public static final String DEFAULT_HOST = "whois.internic.net";
53:
54:            /***
55:             * The default whois port.  It is set to 43 according to RFC 954.
56:             ***/
57:            public static final int DEFAULT_PORT = 43;
58:
59:            /***
60:             * The default whois constructor.    Initializes the
61:             * default port to <code> DEFAULT_PORT </code>.
62:             ***/
63:            public WhoisClient() {
64:                setDefaultPort(DEFAULT_PORT);
65:            }
66:
67:            /***
68:             * Queries the connected whois server for information regarding
69:             * the given handle.  It is up to the programmer to be familiar with the
70:             * handle syntax of the whois server.  You must first connect to a whois
71:             * server before calling this method, and you should disconnect afterward.
72:             * <p>
73:             * @param handle  The handle to lookup.
74:             * @return The result of the whois query.
75:             * @exception IOException  If an I/O error occurs during the operation.
76:             ***/
77:            public String query(String handle) throws IOException {
78:                return query(false, handle);
79:            }
80:
81:            /***
82:             * Queries the connected whois server for information regarding
83:             * the given handle and returns the InputStream of the network connection.
84:             * It is up to the programmer to be familiar with the handle syntax
85:             * of the whois server.  You must first connect to a finger server before
86:             * calling this method, and you should disconnect after finishing reading
87:             * the stream.
88:             * <p>
89:             * @param handle  The handle to lookup.
90:             * @return The InputStream of the network connection of the whois query.
91:             *         Can be read to obtain whois results.
92:             * @exception IOException  If an I/O error occurs during the operation.
93:             ***/
94:            public InputStream getInputStream(String handle) throws IOException {
95:                return getInputStream(false, handle);
96:            }
97:
98:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.