0
Completed

Introduce Synchronous connector operations

Tony Sheehy 8 years ago updated by anonymous 5 years ago 4

The current implementation of connector operations only allow for asynchronous calls; however the current implementation of Event Broker requires synchronous calls for the error event to function.

Either Identity Broker needs to support Synchronous/Like-Synchronous operations or a contract needs to be defined in EB to support an equivalent if timeouts are going to be a problem.

Affected Versions:
Fixed by Version:

This issue potentially has dependencies on ECMA2.0.

ECMA2.0 requires reporting of some description. This might be achieved with the following pattern.

http://www.developerdotstar.com/mag/articles/troche_taskpattern.html

If this is how it's done, then this might expose hooks that EB can use for synchronous operations.

Example code to run import all:

                <div>
                    <button id="Post">
                        Import
                    </button>
                    <script type="text/javascript">
                        $(document).ready(function () {
                            $('#Post').click(function () {
                                var start = new Date();

                                $.ajax({
                                    type: "POST",
                                    crossDomain: true,
                                    contentType: "application/json",
                                    data: {},
                                    url: "http://localhost:59991/IdentityBroker/api/1.0/Connector/ImportAll/81ad4447-a850-44b5-b370-2bb61aae63da",
                                    error: function (jqXHR, textStatus, errorThrown) {
                                        var failedEnd = new Date();
                                        var failedElapsed = failedEnd - start;
                                        alert(errorThrown);
                                        alert(failedElapsed + ' milliseconds');
                                    },
                                    success: function (msg) {
                                        var successEnd = new Date();
                                        var successElapsed = successEnd - start;
                                        alert(msg);
                                        alert(successElapsed + ' milliseconds');
                                    }
                                });
                            });
                        });
                    </script>
                </div>

Example code to run polling import:

                <div>
                    <button id="Post">
                        Import
                    </button>
                    <script type="text/javascript">
                        $(document).ready(function () {
                            $('#Post').click(function () {
                                var start = new Date();

                                $.ajax({
                                    type: "POST",
                                    crossDomain: true,
                                    contentType: "application/json",
                                    data: {},
                                    url: "http://localhost:59991/IdentityBroker/api/1.0/Connector/PollChanges/81ad4447-a850-44b5-b370-2bb61aae63da",
                                    error: function (jqXHR, textStatus, errorThrown) {
                                        var failedEnd = new Date();
                                        var failedElapsed = failedEnd - start;
                                        alert(errorThrown);
                                        alert(failedElapsed + ' milliseconds');
                                    },
                                    success: function (msg) {
                                        var successEnd = new Date();
                                        var successElapsed = successEnd - start;
                                        alert(msg);
                                        alert(successElapsed + ' milliseconds');
                                    }
                                });
                            });
                        });
                    </script>
                </div>

Adam, I believe this can be resolved.

The asynchronous connector methods exposed over the RESTful API seem to provide the functionality that will be required by EB-661.

Regarding the question of the Changes Available approach, the current method is now useless and can be safely replaced with the use of the LDAP Changes Operation (once the Sorting control is added to the LDAP Engine).

A question arose about the timeliness of operations and how that may affect changes, such as if a connector is importing and the adapter context is being updated. The LDAP Changes Operation uses the modified timestamp from the Changelog. The Changelog will only be updated once the adapter context has been updated for the entity. The Changes table itself will no longer be relevant or usable in presenting externally that the adapter should run an adapter import. In the case where a connector import is running, the adapter will complete its import, and the changelog will be updated with the missing entities afterwards, meaning nothing gets lost in processing.

Marked as resolved.