Skip to content
This repository was archived by the owner on Jul 30, 2019. It is now read-only.

Commit d4eab4e

Browse files
author
Laszlo Hordos
committedNov 10, 2015
Enable LoggingProxy for RemoteAsyncConnectorFacade
1 parent 4a7a01e commit d4eab4e

File tree

5 files changed

+341
-295
lines changed

5 files changed

+341
-295
lines changed
 

‎FrameworkInternal/Api.cs

100644100755
+4-5
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,8 @@ public bool IsSupportedOperation(SafeType<APIOperation> api)
371371

372372
public int GetTimeout(SafeType<APIOperation> operation)
373373
{
374-
return CollectionUtil.GetValue(_timeoutMap, operation,
375-
APIConstants.NO_TIMEOUT);
374+
return Math.Max(CollectionUtil.GetValue(_timeoutMap, operation,
375+
APIConstants.NO_TIMEOUT), APIConstants.NO_TIMEOUT);
376376
}
377377
public void SetTimeout(SafeType<APIOperation> operation, int timeout)
378378
{
@@ -898,11 +898,10 @@ protected APIOperation NewAPIOperationProxy(SafeType<APIOperation> api, Invocati
898898
return (APIOperation)Proxy.NewProxyInstance(api.RawType, handler);
899899
}
900900

901-
private static bool LOGGINGPROXY_ENABLED;
901+
protected readonly static bool LOGGINGPROXY_ENABLED;
902902
static AbstractConnectorFacade()
903903
{
904-
string enabled = System.Configuration.
905-
ConfigurationManager.AppSettings.Get("logging.proxy");
904+
string enabled = ConfigurationManager.AppSettings.Get("logging.proxy");
906905
LOGGINGPROXY_ENABLED = StringUtil.IsTrue(enabled);
907906
}
908907

‎FrameworkServer/Async.cs

+1-122
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
using Org.IdentityConnectors.Framework.Common;
3434
using Org.IdentityConnectors.Framework.Common.Exceptions;
3535
using Org.IdentityConnectors.Framework.Common.Objects;
36-
using Org.IdentityConnectors.Framework.Common.Objects.Filters;
3736
using Org.IdentityConnectors.Framework.Common.Serializer;
3837
using Org.IdentityConnectors.Framework.Spi;
3938

@@ -48,7 +47,7 @@ namespace Org.ForgeRock.OpenICF.Framework.Remote
4847
/// <remarks>since 1.5</remarks>
4948
public interface IAsyncConnectorFacade : ConnectorFacade, IAuthenticationAsyncApiOp, ICreateAsyncApiOp,
5049
IDeleteAsyncApiOp, IGetAsyncApiOp, IResolveUsernameAsyncApiOp, ISchemaAsyncApiOp, IScriptOnConnectorAsyncApiOp,
51-
IScriptOnResourceAsyncApiOp, ISearchAsyncApiOp, ISyncAsyncApiOp, ITestAsyncApiOp, IUpdateAsyncApiOp,
50+
IScriptOnResourceAsyncApiOp, ITestAsyncApiOp, IUpdateAsyncApiOp,
5251
IValidateAsyncApiOp
5352
{
5453
}
@@ -446,126 +445,6 @@ Task<object> RunScriptOnResourceAsync(ScriptContext request, OperationOptions op
446445

447446
#endregion
448447

449-
#region ISearchAsyncApiOp
450-
451-
public interface ISearchAsyncApiOp : SearchApiOp
452-
{
453-
/// <summary>
454-
/// Search the resource for all objects that match the object class and
455-
/// filter.
456-
/// </summary>
457-
/// <param name="objectClass">
458-
/// reduces the number of entries to only those that match the
459-
/// <seealso cref="ObjectClass" /> provided.
460-
/// </param>
461-
/// <param name="filter">
462-
/// Reduces the number of entries to only those that match the
463-
/// <seealso cref="Filter" /> provided, if any. May be null.
464-
/// </param>
465-
/// <param name="handler">
466-
/// class responsible for working with the objects returned from
467-
/// the search.
468-
/// </param>
469-
/// <param name="options">
470-
/// additional options that impact the way this operation is run.
471-
/// May be null.
472-
/// </param>
473-
/// <param name="cancellationToken"></param>
474-
/// <returns> The query result or {@code null}. </returns>
475-
/// <exception cref="Exception">
476-
/// if there is problem during the processing of the results.
477-
/// </exception>
478-
Task<SearchResult> SearchAsync(ObjectClass objectClass, Filter filter, ResultsHandler handler,
479-
OperationOptions options, CancellationToken cancellationToken);
480-
}
481-
482-
#endregion
483-
484-
#region ISyncAsyncApiOp
485-
486-
public interface ISyncAsyncApiOp : SyncApiOp
487-
{
488-
/// <summary>
489-
/// Request synchronization events--i.e., native changes to target objects.
490-
/// <para>
491-
/// This method will call the specified
492-
/// {@link Org.IdentityConnectors.Framework.Common.Objects.SyncResultsHandler#handle
493-
/// handler} once to pass back each matching
494-
/// {@link Org.IdentityConnectors.Framework.Common.Objects.SyncDelta
495-
/// synchronization event}. Once this method returns, this method will no
496-
/// longer invoke the specified handler.
497-
/// </para>
498-
/// <para>
499-
/// Each
500-
/// {@link Org.IdentityConnectors.Framework.Common.Objects.SyncDelta#getToken()
501-
/// synchronization event contains a token} that can be used to resume
502-
/// reading events <i>starting from that point in the event stream</i>. In
503-
/// typical usage, a client will save the token from the final
504-
/// synchronization event that was received from one invocation of this
505-
/// {@code sync()} method and then pass that token into that client's next
506-
/// call to this {@code sync()} method. This allows a client to
507-
/// "pick up where he left off" in receiving synchronization events. However,
508-
/// a client can pass the token from <i>any</i> synchronization event into a
509-
/// subsequent invocation of this {@code sync()} method. This will return
510-
/// synchronization events (that represent native changes that occurred)
511-
/// immediately subsequent to the event from which the client obtained the
512-
/// token.
513-
/// </para>
514-
/// <para>
515-
/// A client that wants to read synchronization events "starting now" can
516-
/// call <seealso cref="GetLatestSyncTokenAsync" /> and then pass that token into this
517-
/// {@code sync()} method.
518-
/// </para>
519-
/// </summary>
520-
/// <param name="objectClass">
521-
/// The class of object for which to return synchronization
522-
/// events. Must not be null.
523-
/// </param>
524-
/// <param name="token">
525-
/// The token representing the last token from the previous sync.
526-
/// The {@code SyncResultsHandler} will return any number of
527-
/// <seealso cref="Org.IdentityConnectors.Framework.Common.Objects.SyncDelta" />
528-
/// objects, each of which contains a token. Should be
529-
/// {@code null} if this is the client's first call to the
530-
/// {@code sync()} method for this connector.
531-
/// </param>
532-
/// <param name="handler">
533-
/// The result handler. Must not be null.
534-
/// </param>
535-
/// <param name="options">
536-
/// Options that affect the way this operation is run. May be
537-
/// null.
538-
/// </param>
539-
/// <param name="cancellationToken"></param>
540-
/// <returns> The sync token or {@code null}. </returns>
541-
/// <exception cref="ArgumentException">
542-
/// if {@code objectClass} or {@code handler} is null or if any
543-
/// argument is invalid.
544-
/// </exception>
545-
Task<SyncToken> SyncAsync(ObjectClass objectClass, SyncToken token, SyncResultsHandler handler,
546-
OperationOptions options, CancellationToken cancellationToken);
547-
548-
/// <summary>
549-
/// Returns the token corresponding to the most recent synchronization event
550-
/// for any instance of the specified object class.
551-
/// <para>
552-
/// An application that wants to receive synchronization events
553-
/// "starting now" --i.e., wants to receive only native changes that occur
554-
/// after this method is called-- should call this method and then pass the
555-
/// resulting token into <seealso cref="SyncAsync"> the sync() method</seealso>.
556-
/// </para>
557-
/// </summary>
558-
/// <param name="objectClass">
559-
/// the class of object for which to find the most recent
560-
/// synchronization event (if any).
561-
/// </param>
562-
/// <param name="cancellationToken"></param>
563-
/// <returns> A token if synchronization events exist; otherwise {@code null}. </returns>
564-
Task<SyncToken> GetLatestSyncTokenAsync(ObjectClass objectClass, CancellationToken cancellationToken);
565-
}
566-
567-
#endregion
568-
569448
#region ITestAsyncApiOp
570449

571450
public interface ITestAsyncApiOp : TestApiOp

‎FrameworkServer/AsyncImpl.cs

+231-50
Large diffs are not rendered by default.

‎FrameworkServer/ConnectorEventSubscriptionApiOpImpl.cs

+6-8
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public class ConnectorEventSubscriptionApiOpImpl : AbstractAPIOperation, IConnec
4747
public ConnectorEventSubscriptionApiOpImpl(
4848
IRequestDistributor<WebSocketConnectionGroup, WebSocketConnectionHolder, RemoteOperationContext>
4949
remoteConnection, Org.IdentityConnectors.Framework.Api.ConnectorKey connectorKey,
50-
Func<RemoteOperationContext, ByteString> facadeKeyFunction)
51-
: base(remoteConnection, connectorKey, facadeKeyFunction)
50+
Func<RemoteOperationContext, ByteString> facadeKeyFunction, long timeout)
51+
: base(remoteConnection, connectorKey, facadeKeyFunction, timeout)
5252
{
5353
}
5454

@@ -240,7 +240,6 @@ protected internal InternalLocalOperationProcessor(long requestId, WebSocketConn
240240
ConnectorEventSubscriptionOpRequest message)
241241
: base(requestId, socket, message)
242242
{
243-
StickToConnection = false;
244243
}
245244

246245
protected override RPCResponse CreateOperationResponse(RemoteOperationContext remoteContext,
@@ -317,7 +316,7 @@ public void OnError(Exception error)
317316
try
318317
{
319318
byte[] responseMessage = MessagesUtil.CreateErrorResponse(RequestId, error).ToByteArray();
320-
TrySendBytes(responseMessage, true).ConfigureAwait(false);
319+
TrySendBytes(responseMessage, true);
321320
}
322321
catch (Exception t)
323322
{
@@ -342,8 +341,8 @@ public class SyncEventSubscriptionApiOpImpl : AbstractAPIOperation, ISyncEventSu
342341
public SyncEventSubscriptionApiOpImpl(
343342
IRequestDistributor<WebSocketConnectionGroup, WebSocketConnectionHolder, RemoteOperationContext>
344343
remoteConnection, Org.IdentityConnectors.Framework.Api.ConnectorKey connectorKey,
345-
Func<RemoteOperationContext, ByteString> facadeKeyFunction)
346-
: base(remoteConnection, connectorKey, facadeKeyFunction)
344+
Func<RemoteOperationContext, ByteString> facadeKeyFunction, long timeout)
345+
: base(remoteConnection, connectorKey, facadeKeyFunction, timeout)
347346
{
348347
}
349348

@@ -528,7 +527,6 @@ protected internal InternalLocalOperationProcessor(long requestId, WebSocketConn
528527
SyncEventSubscriptionOpRequest message)
529528
: base(requestId, socket, message)
530529
{
531-
StickToConnection = false;
532530
}
533531

534532
protected override RPCResponse CreateOperationResponse(RemoteOperationContext remoteContext,
@@ -605,7 +603,7 @@ public void OnError(Exception error)
605603
try
606604
{
607605
byte[] responseMessage = MessagesUtil.CreateErrorResponse(RequestId, error).ToByteArray();
608-
TrySendBytes(responseMessage, true).ConfigureAwait(false);
606+
TrySendBytes(responseMessage, true);
609607
}
610608
catch (Exception t)
611609
{

‎FrameworkServer/Remote.cs

+99-110
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
This repository has been archived.