Java Doc for SimpleHttpServer.java in  » Web-Crawler » heritrix » org » archive » crawler » 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 » Web Crawler » heritrix » org.archive.crawler 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.archive.crawler.SimpleHttpServer

SimpleHttpServer
public class SimpleHttpServer (Code)
Wrapper for embedded Jetty server. Loads up all webapps under webapp directory.


Field Summary
final public static  intDEFAULT_PORT
     Default web port.

Constructor Summary
public  SimpleHttpServer()
    
public  SimpleHttpServer(int port, boolean expandWebapps)
    
public  SimpleHttpServer(boolean localhostOnly, String name, String context, int port, boolean expandWebapps)
    
Parameters:
  name - Name of webapp to load.
Parameters:
  context - Where to mount the webapp.
public  SimpleHttpServer(String name, String context, Collection<String> hosts, int port, boolean expandWebapps)
     Constructor.
Parameters:
  name - Name of webapp to load
Parameters:
  context - Where to mount the webap.
public  SimpleHttpServer(List webapps, int port, boolean expandWebapps)
    

Method Summary
protected  voidaddWebapp(String name, String context, boolean expand)
     Add a webapp.
protected  voidfinalize()
    
public  Collection<String>getHosts()
     Returns the hosts that the server is listening on.
public  intgetPort()
    
public static  StringgetRootWebappName()
    
public  HttpServergetServer()
    
protected  RequestLoggetServerLogging()
     Setup log files. RequestLog instance to add to a server.
public  FilegetWebappPath(String name)
     Get path to named webapp.
Parameters:
  name - Name of webpp.
protected  voidinitialize(int port, boolean localhostOnly)
     Initialize the server.
protected  voidinitialize(Collection<String> hosts, int port)
     Initialize the server.
public  voidresetAuthentication(String realmAndRoleName, String oldUsername, String newUsername, String newPassword)
     Reset the administrator login info.
public  HashUserRealmsetAuthentication(String realmName, String contextName, String authProperties)
     Setup a realm on the server named for the webapp and add to the passed webapp's context. Used by the selftest to check digest authentication is working. For this all to work, the web.xml needs to set with a security constraint that points to a realm named for the passed webapp, webappName.
Parameters:
  realmName - Name of realm to configure.
Parameters:
  contextName - Name of context we're using with this realm.If null, we'll use the realm name as context name.
Parameters:
  authProperties - Path to file that holds the auth login andpassword.
public  voidsetAuthentication(String realmName, String contextName, String username, String password, String role)
    
public synchronized  voidstartServer()
     Start the server.
public synchronized  voidstopServer()
     Stop the running server.

Field Detail
DEFAULT_PORT
final public static int DEFAULT_PORT(Code)
Default web port.




Constructor Detail
SimpleHttpServer
public SimpleHttpServer() throws Exception(Code)



SimpleHttpServer
public SimpleHttpServer(int port, boolean expandWebapps) throws Exception(Code)



SimpleHttpServer
public SimpleHttpServer(boolean localhostOnly, String name, String context, int port, boolean expandWebapps) throws Exception(Code)

Parameters:
  name - Name of webapp to load.
Parameters:
  context - Where to mount the webapp. If passed context isnull or empty string, we'll use '/' + name else ifpassed '/' then we'll add the webapp as the root webapp.
Parameters:
  port - Port to run on.
Parameters:
  expandWebapps - True if we're to expand the webapp passed.
throws:
  Exception -



SimpleHttpServer
public SimpleHttpServer(String name, String context, Collection<String> hosts, int port, boolean expandWebapps) throws Exception(Code)
Constructor.
Parameters:
  name - Name of webapp to load
Parameters:
  context - Where to mount the webap. If null or empty string,we'll use '/' + name; if passed '/'then we'll add the webapp as the root webapp
Parameters:
  hosts - list of hosts to bind to
Parameters:
  port - port to listen on
Parameters:
  expandWebapps - true to expand webapp passed
throws:
  Exception -



SimpleHttpServer
public SimpleHttpServer(List webapps, int port, boolean expandWebapps) throws Exception(Code)

Parameters:
  webapps - List of webapps to load.
Parameters:
  port - Port to run on.
Parameters:
  expandWebapps - True if we're to expand the webapps found.
throws:
  Exception -




Method Detail
addWebapp
protected void addWebapp(String name, String context, boolean expand) throws IOException(Code)
Add a webapp.
Parameters:
  name - Name of webapp to add.
Parameters:
  context - Context to add the webapp on.
Parameters:
  expand - True if we should expand the webapps.
throws:
  IOException -



finalize
protected void finalize() throws Throwable(Code)



getHosts
public Collection<String> getHosts()(Code)
Returns the hosts that the server is listening on. the hosts that the server is listening on.



getPort
public int getPort()(Code)
Port server is running on.



getRootWebappName
public static String getRootWebappName()(Code)
Returns the root webapp name.



getServer
public HttpServer getServer()(Code)
Server reference.



getServerLogging
protected RequestLog getServerLogging() throws Exception(Code)
Setup log files. RequestLog instance to add to a server.
throws:
  Exception -



getWebappPath
public File getWebappPath(String name)(Code)
Get path to named webapp.
Parameters:
  name - Name of webpp. Possible names are 'admin' or 'selftest'. Path to deployed webapp.



initialize
protected void initialize(int port, boolean localhostOnly)(Code)
Initialize the server. Called from constructors.
Parameters:
  port - Port to start the server on.



initialize
protected void initialize(Collection<String> hosts, int port)(Code)
Initialize the server. Called from constructors.
Parameters:
  hosts - the hostnames to bind to; if empty or null, will bindto all interfaces
Parameters:
  port - the port to listen on



resetAuthentication
public void resetAuthentication(String realmAndRoleName, String oldUsername, String newUsername, String newPassword)(Code)
Reset the administrator login info.
Parameters:
  realmAndRoleName - for our use, always 'admin'
Parameters:
  oldUsername - previous username to replace/disable
Parameters:
  newUsername - new username (may be same as old)
Parameters:
  newPassword - new password



setAuthentication
public HashUserRealm setAuthentication(String realmName, String contextName, String authProperties) throws IOException(Code)
Setup a realm on the server named for the webapp and add to the passed webapp's context. Used by the selftest to check digest authentication is working. For this all to work, the web.xml needs to set with a security constraint that points to a realm named for the passed webapp, webappName.
Parameters:
  realmName - Name of realm to configure.
Parameters:
  contextName - Name of context we're using with this realm.If null, we'll use the realm name as context name.
Parameters:
  authProperties - Path to file that holds the auth login andpassword. Hash of user realms.
throws:
  IOException -



setAuthentication
public void setAuthentication(String realmName, String contextName, String username, String password, String role) throws IOException(Code)



startServer
public synchronized void startServer() throws Exception(Code)
Start the server.
throws:
  Exception - if problem starting server or if server alreadystarted.



stopServer
public synchronized void stopServer() throws InterruptedException(Code)
Stop the running server.
throws:
  InterruptedException -



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.