|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sonatype.tests.http.server.jetty.impl.JettyServerProvider
public class JettyServerProvider
Nested Class Summary | |
---|---|
static class |
JettyServerProvider.CertificateHolder
|
static class |
JettyServerProvider.CustomTrustManager
|
Field Summary | |
---|---|
protected int |
port
|
protected org.eclipse.jetty.server.Server |
server
|
protected boolean |
ssl
|
Constructor Summary | |
---|---|
JettyServerProvider()
|
Method Summary | |
---|---|
void |
addAuthentication(String pathSpec,
String authName)
Add authentication handler to the given pathspec. |
void |
addBehaviour(String pathspec,
Behaviour... behaviour)
Add the given chain of Behaviour to execute for the given pathspec. |
void |
addCertificate(String alias,
JettyServerProvider.CertificateHolder certHolder)
Adds the given certificate to the keystore for use with AUTH-CERT. |
void |
addDefaultServices()
|
void |
addServlet(TestServlet servlet)
|
void |
addUser(String user,
Object password)
Add the given user to the LoginService. |
protected org.eclipse.jetty.server.Connector |
connector()
|
org.eclipse.jetty.server.Server |
createServer()
|
int |
getPort()
|
org.eclipse.jetty.security.ConstraintSecurityHandler |
getSecurityHandler()
|
void |
getServer()
|
URL |
getUrl()
|
org.eclipse.jetty.servlet.ServletContextHandler |
getWebappContext()
|
void |
initServer()
Configure the underlying server instance. |
protected void |
initWebappContext(org.eclipse.jetty.server.Server s)
|
void |
setPort(int port)
Set to -1 to auto-choose a free port. |
void |
setSecurityHandler(org.eclipse.jetty.security.ConstraintSecurityHandler securityHandler)
|
void |
setSSL(String keystore,
String password)
|
void |
setWebappContext(org.eclipse.jetty.servlet.ServletContextHandler webappContext)
|
protected org.eclipse.jetty.server.Connector |
sslConnector()
|
void |
start()
|
void |
stop()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.eclipse.jetty.server.Server server
protected int port
protected boolean ssl
Constructor Detail |
---|
public JettyServerProvider() throws Exception
Exception
Method Detail |
---|
public void setSSL(String keystore, String password)
setSSL
in interface ServerProvider
keystore
- The keystore to use. (generated with e.g. 'keytool -keystore keystore -alias jetty -genkey
-keyalg DSA')public void setPort(int port)
ServerProvider
setPort
in interface ServerProvider
public void initServer() throws Exception
ServerProvider
initServer
in interface ServerProvider
Exception
public void getServer() throws Exception
Exception
public org.eclipse.jetty.server.Server createServer() throws URISyntaxException
URISyntaxException
public void addAuthentication(String pathSpec, String authName)
ServerProvider
addAuthentication
in interface ServerProvider
pathSpec
- e.g. "/path/*"authName
- e.g. BASIC, DIGESTpublic void addUser(String user, Object password)
JettyServerProvider.CertificateHolder
,
addCertificate(String, CertificateHolder)
is called. For any other class, the String representation of
the object is used as a password.
addUser
in interface ServerProvider
user
- the username, may not be null
.password
- The password to use, may not be null
.public void addCertificate(String alias, JettyServerProvider.CertificateHolder certHolder) throws Exception
alias
- The alias to use for the key in the keystore.certHolder
- The key and certificate to use.
Exception
public void addDefaultServices()
public void addServlet(TestServlet servlet)
protected void initWebappContext(org.eclipse.jetty.server.Server s) throws URISyntaxException
URISyntaxException
protected org.eclipse.jetty.server.Connector connector()
protected org.eclipse.jetty.server.Connector sslConnector()
public void start() throws Exception
start
in interface ServerProvider
Exception
public void addBehaviour(String pathspec, Behaviour... behaviour)
ServerProvider
addBehaviour
in interface ServerProvider
pathspec
- e.g. "/path/*"public void stop() throws Exception
stop
in interface ServerProvider
Exception
public URL getUrl() throws MalformedURLException
getUrl
in interface ServerProvider
MalformedURLException
public org.eclipse.jetty.servlet.ServletContextHandler getWebappContext()
public void setWebappContext(org.eclipse.jetty.servlet.ServletContextHandler webappContext)
public int getPort()
getPort
in interface ServerProvider
public org.eclipse.jetty.security.ConstraintSecurityHandler getSecurityHandler()
public void setSecurityHandler(org.eclipse.jetty.security.ConstraintSecurityHandler securityHandler)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |