//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.
//
[[provisioning-livesync]]
==== Live Sync

Live sync allows to acquire identity data from records published to queue systems, like as
https://kafka.apache.org/[Apache Kafka^], https://activemq.apache.org/[Apache ActiveMQ^],
https://cloud.google.com/pubsub/[Google PubSub^] or similar. +
Compared to <<provisioning-pull,pull>>, records are processed as soon as they are published in the queue system,
while the <<tasks-livesync,live sync task>> is running.

For each external resource, a single <<tasks-livesync,live sync task>> can be defined: once started, it will remain
active until stopped.

Live sync tasks will be triggered by the publication of matching records on the external resource for all
<<mapping,mapped>> <<anytype, any types>>, sorted according to the order defined by a custom implementation of
ifeval::["{snapshotOrRelease}" == "release"]
https://github.com/apache/syncope/blob/syncope-{docVersion}/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ProvisionSorter.java[ProvisionSorter^]
endif::[]
ifeval::["{snapshotOrRelease}" == "snapshot"]
https://github.com/apache/syncope/blob/4_0_X/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/ProvisionSorter.java[ProvisionSorter^]
endif::[]
or its default implementation
ifeval::["{snapshotOrRelease}" == "release"]
https://github.com/apache/syncope/blob/syncope-{docVersion}/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultProvisionSorter.java[DefaultProvisionSorter^]
endif::[]
ifeval::["{snapshotOrRelease}" == "snapshot"]
https://github.com/apache/syncope/blob/4_0_X/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/DefaultProvisionSorter.java[DefaultProvisionSorter^]
endif::[]
.

Once a record is received, the configured <<implementations,implementation>> of
ifeval::["{snapshotOrRelease}" == "release"]
https://github.com/apache/syncope/blob/syncope-{docVersion}/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/LiveSyncDeltaMapper.java[LiveSyncDeltaMapper^]
endif::[]
ifeval::["{snapshotOrRelease}" == "snapshot"]
https://github.com/apache/syncope/blob/4_0_X/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/pushpull/LiveSyncDeltaMapper.java[LiveSyncDeltaMapper^]
endif::[]
is invoked to transform the record into a format which is in turn provided to an internally created and processed
<<tasks-pull,pull task>>.
