Class AppConfig
-
- All Implemented Interfaces:
@Serializable() public final class AppConfigRepresents the application configuration
This class provides a builder method for client code to easily build an instance of application configuration, which will be used to construct settings parameter and http client.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classAppConfig.BuilderAppConfig builder
public enumAppConfig.ContentFormat
-
Field Summary
Fields Modifier and Type Field Description public final static StringATTR_AUTHprivate final transient List<Auth>authprivate final transient <Error class: unknown class>customizedPropertiesprivate final StringserviceUrlprivate final AuthprimaryAuthenticationConfigprivate final Stringhostprivate final Integerportprivate final Stringprotocolprivate final StringappIDprivate final StringapplicationVersionprivate final BooleanmultiUser
-
Method Summary
Modifier and Type Method Description final List<Auth>getAuth()The authentication method list final <Error class: unknown class>getCustomizedProperties()Customized properties defined when publishing application to discovery service final StringgetServiceUrl()final AuthgetPrimaryAuthenticationConfig()final StringgetHost()The host of the mobile application final IntegergetPort()The port final StringgetProtocol()The protocol final StringgetAppID()The application id final StringgetApplicationVersion()The application version final BooleangetMultiUser()Multiple user StringtoString()Converts the application configuration back to string format, it's the same as returned from discovery service. final AppConfigCustomizedPropertyfindCustomPropertyByName(String name)Finds a custom property by the given name. final UnitaddMandatoryValidationHeader(String key, String value)Adds custom headers into AppConfig, this is used in the case that AppConfig is retrieved with 'MDM' and the server side needs some mandatory headers for requests from the client. final List<Pair<String, String>>mandatoryValidationHeaders()Retrieves the custom validation headers from AppConfig. final BooleanisSame(AppConfig another)Checks if another is the same as the current com.sap.cloud.mobile.foundation.model.AppConfig final AppConfig.BuildernewBuilder()final static AppConfigcreateAppConfigFromSimplifiedJsonString(String str, String protocol)Creates AppConfig from the simplified QR code string. final static AppConfigcreateAppConfigFromJsonString(String str)Creates AppConfig from a json string final static AppConfigcreateAppConfigFromSignedJsonString(String str, String pubKey)Creates AppConfig from a json string which is signed final static AppConfigcreateAppConfigFromSignedString(String str, String pubKey, String appId)Creates AppConfig from a string which is signed final static AppConfigcreateAppConfigFromStringAllFormat(String str, String pubKey, String appId)Creates AppConfig from a string which may be signed or un-signed final static AppConfigcreateAppConfigFromString(String str, String appId)Creates AppConfig from a string, handle both Json and URL format -
-
Method Detail
-
getCustomizedProperties
final <Error class: unknown class> getCustomizedProperties()
Customized properties defined when publishing application to discovery service
-
getServiceUrl
final String getServiceUrl()
-
getPrimaryAuthenticationConfig
final Auth getPrimaryAuthenticationConfig()
-
getHost
final String getHost()
The host of the mobile application
-
getPort
final Integer getPort()
The port
-
getProtocol
final String getProtocol()
The protocol
-
getAppID
final String getAppID()
The application id
-
getApplicationVersion
final String getApplicationVersion()
The application version
-
getMultiUser
final Boolean getMultiUser()
Multiple user
-
toString
String toString()
Converts the application configuration back to string format, it's the same as returned from discovery service.
-
findCustomPropertyByName
final AppConfigCustomizedProperty findCustomPropertyByName(String name)
Finds a custom property by the given name.
-
addMandatoryValidationHeader
final Unit addMandatoryValidationHeader(String key, String value)
Adds custom headers into AppConfig, this is used in the case that AppConfig is retrieved with 'MDM' and the server side needs some mandatory headers for requests from the client. After adding these headers here, onboarding will add them into the headers when making http requests.
-
mandatoryValidationHeaders
final List<Pair<String, String>> mandatoryValidationHeaders()
Retrieves the custom validation headers from AppConfig.
-
isSame
final Boolean isSame(AppConfig another)
Checks if another is the same as the current com.sap.cloud.mobile.foundation.model.AppConfig
-
newBuilder
final AppConfig.Builder newBuilder()
-
createAppConfigFromSimplifiedJsonString
final static AppConfig createAppConfigFromSimplifiedJsonString(String str, String protocol)
Creates AppConfig from the simplified QR code string.
The schema of the simplified QR code JSON string is like this:
{ "mobileServicesHost": "mandatory service host", "other_properties": "primitive/object/array" }
For now, only 'mobileServicesHost' and 'schema' are mandatory, other properties are optional, which will be saved into AppConfigCustomizedProperty after retrieving the AppConfig from the well-known service deployed on 'mobileServicesHost'.
- Parameters:
str- The simplified QR string.protocol- reserved for test purpose, for production, only 'https' is used.- Returns:
The AppConfig instance which is retrieved from the well-known service.
-
createAppConfigFromJsonString
final static AppConfig createAppConfigFromJsonString(String str)
Creates AppConfig from a json string
-
createAppConfigFromSignedJsonString
final static AppConfig createAppConfigFromSignedJsonString(String str, String pubKey)
Creates AppConfig from a json string which is signed
-
createAppConfigFromSignedString
final static AppConfig createAppConfigFromSignedString(String str, String pubKey, String appId)
Creates AppConfig from a string which is signed
-
createAppConfigFromStringAllFormat
final static AppConfig createAppConfigFromStringAllFormat(String str, String pubKey, String appId)
Creates AppConfig from a string which may be signed or un-signed
-
createAppConfigFromString
final static AppConfig createAppConfigFromString(String str, String appId)
Creates AppConfig from a string, handle both Json and URL format
-
-
-
-