public class SecurityService
extends java.lang.Object
implements org.aerogear.mobile.core.ServiceModule
check(SecurityCheckType). Security checks
can also be chained together to execute security checks synchronously or asynchronously. Invoking
getCheckExecutor() will return a SyncSecurityCheckExecutor where security checks
can be executed synchronously. Invoking getAsyncCheckExecutor() will return
AsyncSecurityCheckExecutor where security checks can be executed asynchronously.| Constructor and Description |
|---|
SecurityService() |
| Modifier and Type | Method and Description |
|---|---|
SecurityCheckResult |
check(SecurityCheck securityCheck)
Used with a custom check to perform a single
SecurityCheck and get the
result for it. |
SecurityCheckResult |
check(SecurityCheckType securityCheckType)
Used with enumeration to perform a single
SecurityCheckType and get the
result for it. |
SecurityCheckResult |
checkAndSendMetric(SecurityCheck securityCheck,
org.aerogear.mobile.core.metrics.MetricsService metricsService)
Perform a single
SecurityCheck and return a SecurityCheckResult. |
SecurityCheckResult |
checkAndSendMetric(SecurityCheckType securityCheckType,
org.aerogear.mobile.core.metrics.MetricsService metricsService)
Perform a single
SecurityCheckType , get the result and
publish a SecurityCheckResultMetric based on the result. |
void |
configure(org.aerogear.mobile.core.MobileCore core,
org.aerogear.mobile.core.configuration.ServiceConfiguration serviceConfiguration)
Configures the security service.
|
void |
destroy()
Invoked when security service needs to be destroyed.
|
AsyncSecurityCheckExecutor |
getAsyncCheckExecutor()
Retrieve a check executor that can asynchronously run multiple security checks.
|
SyncSecurityCheckExecutor |
getCheckExecutor()
Retrieve a check executor that can synchronously run multiple security checks.
|
boolean |
requiresConfiguration()
Checks if the service requires a service configuration.
|
java.lang.String |
type()
Gets the service type.
|
public java.lang.String type()
type in interface org.aerogear.mobile.core.ServiceModuleStringpublic void configure(@NonNull
org.aerogear.mobile.core.MobileCore core,
@Nullable
org.aerogear.mobile.core.configuration.ServiceConfiguration serviceConfiguration)
configure in interface org.aerogear.mobile.core.ServiceModulecore - MobileCore instanceserviceConfiguration - ServiceConfiguration for the security service. Can be
nullpublic boolean requiresConfiguration()
requiresConfiguration in interface org.aerogear.mobile.core.ServiceModulefalsepublic void destroy()
destroy in interface org.aerogear.mobile.core.ServiceModulepublic SyncSecurityCheckExecutor getCheckExecutor()
SyncSecurityCheckExecutorpublic AsyncSecurityCheckExecutor getAsyncCheckExecutor()
AsyncSecurityCheckExecutorpublic SecurityCheckResult check(@NonNull SecurityCheckType securityCheckType)
SecurityCheckType and get the
result for it.securityCheckType - The SecurityCheckType to executeSecurityCheckResultjava.lang.IllegalArgumentException - if securityCheckType is nullpublic SecurityCheckResult check(@NonNull SecurityCheck securityCheck)
SecurityCheck and get the
result for it.securityCheck - The SecurityCheck to executeSecurityCheckResultjava.lang.IllegalArgumentException - if securityCheck is nullpublic SecurityCheckResult checkAndSendMetric(SecurityCheckType securityCheckType, org.aerogear.mobile.core.metrics.MetricsService metricsService)
SecurityCheckType , get the result and
publish a SecurityCheckResultMetric based on the result.securityCheckType - The SecurityCheckType to executemetricsService - MetricsServiceSecurityCheckResultpublic SecurityCheckResult checkAndSendMetric(SecurityCheck securityCheck, @NonNull org.aerogear.mobile.core.metrics.MetricsService metricsService)
SecurityCheck and return a SecurityCheckResult.securityCheck - The SecurityCheck to executemetricsService - MetricsServiceSecurityCheckResultjava.lang.IllegalArgumentException - if metricsService is null