UpdateServer class abstract

The object that can be used to update the Server associated with a given user account.

This is a local-only operation: no network calls are made.

This operation can be used in different scenarios:

  • Domain migration: when the domain of the server where the account is stored changes, the operation can be used to use the new domain (see newBaseUrl).
  • High availability scenarios: when you want to allow the SDK to perform its out-of-band operations in multiple servers, the operation can be used to define all the base URLs accepted by the SDK for a given account (see newAlternativeBaseUrls).
  • Use separate domains for out-of-band registration and authentication: by using newAlternativeBaseUrls, the SDK will support the case where different domains are used in the redemption URLs defined in nevisFIDO. The SDK will use the redemption URL to perform the out-of-band operation.

Usage example:

  await client.localData.updateServerOperation
    .username(username)
    .newBaseUrl(newBaseUrl)
    .newAlternativeBaseUrls(alternativeBaseUrls)
    .execute();

NOTE
The old base URL is not added to the alternative base URLs automatically. If out-of-band links with the old domain must still be accepted after changing the base URL with newBaseUrl, include it in newAlternativeBaseUrls.

NOTE
The update is applied to the registrations of the account and to its device information. If it fails, the registrations are restored, so both keep referring to the same server. Concurrent executions are serialized.

See: LocalData.updateServerOperation, Server

Constructors

UpdateServer()
Default constructor for UpdateServer.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

execute() → Future<void>
Executes the update asynchronously.
newAlternativeBaseUrls(Set<String> newAlternativeBaseUrls) → UpdateServer
Specifies the alternative base URLs of the server. If not provided, the alternative base URLs of the Server associated with the account will not be changed.
newBaseUrl(String newBaseUrl) → UpdateServer
Specifies the new base URL of the server. If not provided, the base URL of the Server associated with the account will not be changed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
username(String username) → UpdateServer
Specifies the username whose Server must be updated.

Operators

operator ==(Object other) → bool
The equality operator.
inherited