Class ClientPolicyService
-
- All Implemented Interfaces:
public final class ClientPolicyService extends MobileService
Represents the service to retrieve all client policies from server, like passcode, log settings, usage policy, etc.
-
-
Field Summary
Fields Modifier and Type Field Description private Applicationapplicationprivate StringapiKey
-
Constructor Summary
Constructors Constructor Description ClientPolicyService(SettingsTarget target, ServiceListener<ClientPolicies> autoRetrieveListener)ClientPolicyService(SettingsTarget target)ClientPolicyService()
-
Method Summary
Modifier and Type Method Description UnitonStateChange(ApplicationState state)Notified when application state changes. final JobretrieveClientPolicies(SettingsTarget target, ServiceListener<ClientPolicies> listener)Retrieves client policies from mobile server, notify the listener on the main thread. final ServiceResult<ClientPolicies>retrieveClientPolicies(SettingsTarget target)Retrieves client policies from mobile server final <T extends AbstractSettingsEntity> JobupdatePolicy(T policy, SettingsTarget target, ServiceListener<T> listener)Updates the given policy, the result will be notified with listener on main thread. final <T extends AbstractSettingsEntity> ServiceResult<T>updatePolicy(T policy, SettingsTarget target)Updates the given policy within a coroutine. -
Methods inherited from class com.sap.cloud.mobile.foundation.mobileservices.MobileService
enableNetworkPolicy, getApiKey, getApplication, init, isApplicationInitialized, mayStartNewProcess, reset, setApiKey, setApplication -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ClientPolicyService
ClientPolicyService(SettingsTarget target, ServiceListener<ClientPolicies> autoRetrieveListener)
-
ClientPolicyService
ClientPolicyService(SettingsTarget target)
-
ClientPolicyService
ClientPolicyService()
-
-
Method Detail
-
onStateChange
Unit onStateChange(ApplicationState state)
Notified when application state changes. This function will be called on Main thread.
-
retrieveClientPolicies
final Job retrieveClientPolicies(SettingsTarget target, ServiceListener<ClientPolicies> listener)
Retrieves client policies from mobile server, notify the listener on the main thread.
-
retrieveClientPolicies
final ServiceResult<ClientPolicies> retrieveClientPolicies(SettingsTarget target)
Retrieves client policies from mobile server
-
updatePolicy
final <T extends AbstractSettingsEntity> Job updatePolicy(T policy, SettingsTarget target, ServiceListener<T> listener)
- Parameters:
policy- The policy to be updatedtarget- The scope of this policy to be updated, 'application', 'device' or 'user' level.listener- The service result listener.
-
updatePolicy
final <T extends AbstractSettingsEntity> ServiceResult<T> updatePolicy(T policy, SettingsTarget target)
Updates the given policy within a coroutine.
- Parameters:
policy- The policy to be updatedtarget- The scope of the policy to be updated, either 'application', 'device' or 'user' level.
-
-
-
-