Package com.adobe.testing.s3mock
Class S3MockApplication
- java.lang.Object
-
- com.adobe.testing.s3mock.S3MockApplication
-
@Configuration @EnableAutoConfiguration(exclude=org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class, excludeName="org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration") @ComponentScan public class S3MockApplication extends java.lang.ObjectFile Store Application that mocks Amazon S3.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_HTTP_PORTstatic intDEFAULT_HTTPS_PORTstatic java.lang.StringDEFAULT_SERVER_SSL_KEY_ALIASstatic java.lang.StringDEFAULT_SERVER_SSL_KEY_PASSWORDstatic java.lang.StringDEFAULT_SERVER_SSL_KEY_STOREstatic java.lang.StringDEFAULT_SERVER_SSL_KEY_STORE_PASSWORDstatic java.lang.StringPROP_HTTP_PORTProperty name for passing the HTTP port to use.static java.lang.StringPROP_HTTPS_PORTProperty name for passing the HTTPS port to use.static java.lang.StringPROP_INITIAL_BUCKETSProperty name for passing a comma separated list of buckets that are to be created at startup.static java.lang.StringPROP_ROOT_DIRECTORYProperty name for passing a root directory to use.static java.lang.StringPROP_SECURE_CONNECTIONProperty name for using either HTTPS or HTTP connections.static java.lang.StringPROP_SILENTProperty name for enabling the silent mode with logging set at WARN and without banner.static intRANDOM_PORTstatic java.lang.StringSERVER_SSL_KEY_ALIASProperty name for specifying the key to use.static java.lang.StringSERVER_SSL_KEY_PASSWORDProperty name for passing the password for the key.static java.lang.StringSERVER_SSL_KEY_STOREProperty name for passing the path to the keystore to use.static java.lang.StringSERVER_SSL_KEY_STORE_PASSWORDProperty name for passing the password for the keystore.
-
Constructor Summary
Constructors Constructor Description S3MockApplication()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHttpPort()Gets the Http server port.intgetPort()Gets the Https server port.static voidmain(java.lang.String[] args)Main Class that starts the server usingstart(String...).voidregisterKMSKeyRef(java.lang.String keyRef)Registers a valid KMS key reference on the mock server.static S3MockApplicationstart(java.lang.String... args)Starts the server.static S3MockApplicationstart(java.util.Map<java.lang.String,java.lang.Object> properties, java.lang.String... args)Starts the server.voidstop()Stops the server.
-
-
-
Field Detail
-
DEFAULT_HTTPS_PORT
public static final int DEFAULT_HTTPS_PORT
- See Also:
- Constant Field Values
-
DEFAULT_HTTP_PORT
public static final int DEFAULT_HTTP_PORT
- See Also:
- Constant Field Values
-
RANDOM_PORT
public static final int RANDOM_PORT
- See Also:
- Constant Field Values
-
DEFAULT_SERVER_SSL_KEY_STORE
public static final java.lang.String DEFAULT_SERVER_SSL_KEY_STORE
- See Also:
- Constant Field Values
-
DEFAULT_SERVER_SSL_KEY_STORE_PASSWORD
public static final java.lang.String DEFAULT_SERVER_SSL_KEY_STORE_PASSWORD
- See Also:
- Constant Field Values
-
DEFAULT_SERVER_SSL_KEY_ALIAS
public static final java.lang.String DEFAULT_SERVER_SSL_KEY_ALIAS
- See Also:
- Constant Field Values
-
DEFAULT_SERVER_SSL_KEY_PASSWORD
public static final java.lang.String DEFAULT_SERVER_SSL_KEY_PASSWORD
- See Also:
- Constant Field Values
-
PROP_INITIAL_BUCKETS
public static final java.lang.String PROP_INITIAL_BUCKETS
Property name for passing a comma separated list of buckets that are to be created at startup.- See Also:
- Constant Field Values
-
PROP_ROOT_DIRECTORY
public static final java.lang.String PROP_ROOT_DIRECTORY
Property name for passing a root directory to use. If omitted a default temp-dir will be used.- See Also:
- Constant Field Values
-
PROP_HTTPS_PORT
public static final java.lang.String PROP_HTTPS_PORT
Property name for passing the HTTPS port to use. Defaults to 9191. If set to 0, a random port will be chosen.- See Also:
- Constant Field Values
-
PROP_HTTP_PORT
public static final java.lang.String PROP_HTTP_PORT
Property name for passing the HTTP port to use. Defaults to 9090. If set to 0, a random port will be chosen.- See Also:
- Constant Field Values
-
SERVER_SSL_KEY_STORE
public static final java.lang.String SERVER_SSL_KEY_STORE
Property name for passing the path to the keystore to use. Defaults to "classpath:s3mock.jks".- See Also:
- Constant Field Values
-
SERVER_SSL_KEY_STORE_PASSWORD
public static final java.lang.String SERVER_SSL_KEY_STORE_PASSWORD
Property name for passing the password for the keystore. Defaults to "password".- See Also:
- Constant Field Values
-
SERVER_SSL_KEY_ALIAS
public static final java.lang.String SERVER_SSL_KEY_ALIAS
Property name for specifying the key to use. Defaults to "selfsigned".- See Also:
- Constant Field Values
-
SERVER_SSL_KEY_PASSWORD
public static final java.lang.String SERVER_SSL_KEY_PASSWORD
Property name for passing the password for the key. Defaults to "password".- See Also:
- Constant Field Values
-
PROP_SECURE_CONNECTION
public static final java.lang.String PROP_SECURE_CONNECTION
Property name for using either HTTPS or HTTP connections.- See Also:
- Constant Field Values
-
PROP_SILENT
public static final java.lang.String PROP_SILENT
Property name for enabling the silent mode with logging set at WARN and without banner.- See Also:
- Constant Field Values
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
Main Class that starts the server usingstart(String...).- Parameters:
args- Default command args.
-
start
public static S3MockApplication start(java.lang.String... args)
Starts the server.- Parameters:
args- in program args format, e.g."--server.port=0".- Returns:
- the
S3MockApplication
-
start
public static S3MockApplication start(java.util.Map<java.lang.String,java.lang.Object> properties, java.lang.String... args)
Starts the server.- Parameters:
properties- properties to pass to the application in key-value format.args- in program args format, e.g."--server.port=0".- Returns:
- the
S3MockApplication
-
stop
public void stop()
Stops the server.
-
getPort
public int getPort()
Gets the Https server port.- Returns:
- Https server port.
-
getHttpPort
public int getHttpPort()
Gets the Http server port.- Returns:
- Http server port.
-
registerKMSKeyRef
public void registerKMSKeyRef(java.lang.String keyRef)
Registers a valid KMS key reference on the mock server.- Parameters:
keyRef- A KMS Key Reference
-
-