@startuml

participant auth as ":b10-auth"
[-> auth: new/initial config\n(datasrc cfg)
activate auth

participant list as ":Configurable\nClientList"
create list
auth -> list: <<construct>>

auth -> list: configure(cfg)
activate list

participant CacheConfig as ":CacheConfig"
create CacheConfig
list -> CacheConfig: <<construct>> (cfg)

participant zt_segment as ":ZoneTable\nSegment\n(Mapped)"
create zt_segment
list -> zt_segment: <<construct>>

list -> zt_segment: isWritable()
activate zt_segment
note over zt_segment: Segment not writable\nwhen not reset
zt_segment --> list: false
deactivate zt_segment

deactivate list

auth -> list: getStatus()
activate list
list --> auth: DataSourceStatus[]
deactivate list

[<- auth: subscribe to\nmemmgr group

deactivate auth

...

[-> auth: command from\nmemmgr\n(datasrc_name,\nsegmentparam)
activate auth

auth -> list: resetMemorySegment\n(datasrc_name,\nREAD_ONLY,\nsegmentparam)
activate list

list -> zt_segment: reset\n(READ_ONLY,\nsegmentparam)
activate zt_segment

participant segment as "seg1:Memory\nSegment\n(Mapped)"
create segment
zt_segment -> segment: <<construct>>

deactivate zt_segment
deactivate list
deactivate auth

...

[-> auth: command from\nmemmgr\n(datasrc_name,\nsegmentparam)
activate auth

auth -> list: resetMemorySegment\n(datasrc_name,\nREAD_ONLY,\nsegmentparam)
activate list

list -> zt_segment: reset\n(READ_ONLY,\nsegmentparam)
activate zt_segment

zt_segment -> segment: <<destroy>>
destroy segment

participant segment2 as "seg2:Memory\nSegment\n(Mapped)"
create segment2
zt_segment -> segment2: <<construct>>

deactivate zt_segment
deactivate list
deactivate auth

...

[-> auth: reload\n(zonename)
activate auth

auth -> list: getCachedZoneWriter\n(zone_name)
activate list

list -> zt_segment: isWritable()
activate zt_segment
note over zt_segment: Segment not writable\nas it is READ_ONLY
zt_segment --> list: false
deactivate zt_segment

list --> auth: CACHE_NOT_WRITABLE
deactivate list

deactivate auth

@enduml
