Journal class Client-Server API Journal
Journal of services.
The Journal class is a member of Worker, it manage worker's input(ServiceOfJournal), and provides access to them via lists of services ServiceOfJournal.
The purpose of the Journal class is to:
- store services in Hive(via hiveRepository),
- make network requests(add/delete via httpInterface),
- change state of ServiceOfJournal,
- move old
finishedandoutDatedservices into JournalArchive, - export services into file.ais_json.
The JournalArchive class is a cut version of Journal,
it store old finished and `outDated services.
Each instance of Worker can access Journal classes via providers:
Client can access both Journal classes at once via allServicesOfClient.

- Inheritance
-
- Object
- BaseJournal
- Journal
- Implementers
Constructors
Properties
- aData → DateTime?
-
At what date is journal, if null - load all values.
finalinherited
-
added
→ List<
ServiceOfJournal> -
read-only
-
all
→ List<
ServiceOfJournal> -
read-only
- apiKey ↔ String
-
read / writeinherited
-
finished
→ List<
ServiceOfJournal> -
read-only
- hashCode → int
-
The hash code for this object.
read-onlyinherited
-
hive
→ Box<
ServiceOfJournal> -
read-only
- hiveRepository → HiveRepository
-
read-only
- httpInterface → JournalHttpInterface
-
read-only
- journalHiveName → String
-
read-only
-
outDated
→ List<
ServiceOfJournal> -
read-only
-
ref
→ Ref<
Object?> -
final
-
rejected
→ List<
ServiceOfJournal> -
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
-
servicesForSync
→ List<
ServiceOfJournal> -
read-only
- servicesOf → HiveRepositoryProvider
-
read-only
- state → AppState
-
final
- today → DateTime
-
read-onlyinherited
- worker → Worker
-
read-onlyoverride
- workerDepId → int
-
read-onlyoverride
Methods
-
archiveOldServices(
) → Future< void> -
This function move old finished(and outDated) services to
hiveArchive.override -
commitAll(
[JournalHttpInterface? httpClient, List< ServiceOfJournal> ? forSync]) → Future<void> -
Try to commit all servicesForSync.
override
-
delete(
{ServiceOfJournal? serv, String? uuid}) → Future< bool> -
Delete service
serv(or find serv byuuid) from journal.override -
exportToFile(
DateTime start, DateTime end) → Future< void> -
getUuidOfLastService(
{required int servId, required int contractId}) → String? - Helper, only used in ClientService, it delete last ServiceOfJournal.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
post(
ServiceOfJournal se) → Future< bool> -
Add new ServiceOfJournal to Journal and call commitAll.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
updateBasedOnNewPlanDate(
) → Future< void> -
Mark all finished service as ServiceState.outDated
after Worker.clientsPlanOf synchronized.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited