org.sonatype.tests.http.server.api
Interface ServerProvider

All Known Implementing Classes:
JettyProxyProvider, JettyServerProvider

public interface ServerProvider


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 addUser(String user, Object password)
          Add the given user and password to the servers security realm.
 int getPort()
           
 URL getUrl()
           
 void initServer()
          Configure the underlying server instance.
 void setPort(int port)
          Set to -1 to auto-choose a free port.
 void setSSL(String keystore, String password)
           
 void start()
           
 void stop()
           
 

Method Detail

getUrl

URL getUrl()
           throws MalformedURLException
Returns:
the URL for the server
Throws:
MalformedURLException

stop

void stop()
          throws Exception
Throws:
Exception

addBehaviour

void addBehaviour(String pathspec,
                  Behaviour... behaviour)
Add the given chain of Behaviour to execute for the given pathspec.

Parameters:
pathspec - e.g. "/path/*"

start

void start()
           throws Exception
Throws:
Exception

initServer

void initServer()
                throws Exception
Configure the underlying server instance.

Throws:
Exception

setPort

void setPort(int port)
Set to -1 to auto-choose a free port.

Parameters:
port -

getPort

int getPort()

setSSL

void setSSL(String keystore,
            String password)
Parameters:
keystore - The keystore to use. (generated with e.g. 'keytool -keystore keystore -alias jetty -genkey -keyalg DSA')
password -

addAuthentication

void addAuthentication(String pathSpec,
                       String authName)
Add authentication handler to the given pathspec.

Parameters:
pathSpec - e.g. "/path/*"
authName - e.g. BASIC, DIGEST

addUser

void addUser(String user,
             Object password)
Add the given user and password to the servers security realm. The password may be any type supported by the authentication type (e.g. a certificate for client side certificate auth).



Copyright © 2010-2012 Sonatype, Inc.. All Rights Reserved.