Class SecureStubServer
java.lang.Object
com.xebialabs.restito.server.StubServer
com.xebialabs.restito.server.secure.SecureStubServer
public class SecureStubServer
extends com.xebialabs.restito.server.StubServer
This class can be removed if pull request https://github.com/mkotsur/restito/pull/46 is merged
into master this just extends StubServer to adds the functionality present in that pull request
-
Field Summary
Fields inherited from class com.xebialabs.restito.server.StubServer
DEFAULT_PORT, secured -
Constructor Summary
ConstructorsConstructorDescriptionSecureStubServer(int portRangeStart, int portRangeEnd, com.xebialabs.restito.semantics.Stub... stubs) This constructor allows to specify the port range beside stubs.SecureStubServer(int port, com.xebialabs.restito.semantics.Stub... stubs) This constructor allows to specify the port beside stubs.SecureStubServer(com.xebialabs.restito.semantics.Stub... stubs) Creates a server based on stubs that are used to determine behavior. -
Method Summary
Modifier and TypeMethodDescriptionaddStub(com.xebialabs.restito.semantics.Stub s) It is possible to add a stub even after the server is startedList<com.xebialabs.restito.semantics.Call> getCalls()Returns calls performed to the server.intgetPort()Returns the port which the server is running atList<com.xebialabs.restito.semantics.Stub> getStubs()Returns stubs associated with the server.run()Starts the serversecured()Sets the Server in Secure mode.voidstart()Alias for StubServer.run()stop()Stops the serverMethods inherited from class com.xebialabs.restito.server.StubServer
clear, clearCalls, clearStubs, clientAuth, isRegisterCalls, setRegisterCalls
-
Constructor Details
-
SecureStubServer
public SecureStubServer(com.xebialabs.restito.semantics.Stub... stubs) Creates a server based on stubs that are used to determine behavior. -
SecureStubServer
public SecureStubServer(int portRangeStart, int portRangeEnd, com.xebialabs.restito.semantics.Stub... stubs) This constructor allows to specify the port range beside stubs. Grizzly will select the first available port. -
SecureStubServer
public SecureStubServer(int port, com.xebialabs.restito.semantics.Stub... stubs) This constructor allows to specify the port beside stubs. If the port is busy, Restito won't try to pick different one and java.net.BindException will be thrown.
-
-
Method Details
-
addStub
It is possible to add a stub even after the server is started- Overrides:
addStubin classcom.xebialabs.restito.server.StubServer
-
run
Starts the server- Overrides:
runin classcom.xebialabs.restito.server.StubServer
-
start
public void start()Alias for StubServer.run()- Overrides:
startin classcom.xebialabs.restito.server.StubServer
-
stop
Stops the server- Overrides:
stopin classcom.xebialabs.restito.server.StubServer
-
secured
Sets the Server in Secure mode. If it is already running, ignores the call.- Overrides:
securedin classcom.xebialabs.restito.server.StubServer
-
getPort
public int getPort()Returns the port which the server is running at- Overrides:
getPortin classcom.xebialabs.restito.server.StubServer
-
getCalls
Returns calls performed to the server. Returned list is actually a copy of the original one. This is done to prevent concurrency issues. See #33.- Overrides:
getCallsin classcom.xebialabs.restito.server.StubServer
-
getStubs
Returns stubs associated with the server. Returned list is actually a copy of the original one. This is done to prevent concurrency issues. See #33.- Overrides:
getStubsin classcom.xebialabs.restito.server.StubServer
-