Ejemplo n.º 1
0
 internal EnumerationResultEnumerator(WsEnumerationClient client, RmResourceFactory factory, String filter, String[] attributes)
 {
     results              = new List <RmResource>();
     this.client          = client;
     this.filter          = filter;
     this.resourceFactory = factory;
     this.attributes      = attributes;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 public DefaultClient()
 {
     this.wsTransferClient        = new WsTransferClient();
     this.wsTransferFactoryClient = new WsTransferFactoryClient();
     this.wsEnumerationClient     = new WsEnumerationClient();
     this.mexClient       = new MexClient();
     this.alternateClient = new AlternateClient();
     this.resourceFactory = new RmResourceFactory();
     this.requestFactory  = new RmRequestFactory();
 }
Ejemplo n.º 3
0
 public DefaultClient(string fimUrl, TimeSpan?receiveTimeout = null, int?maxReceivedMessageSize = null)
 {
     this.wsTransferClient        = new WsTransferClient(Bindings.ServiceMultipleTokenBinding_Common(receiveTimeout, maxReceivedMessageSize), DefaultEndpoints.WsTransfer(fimUrl));
     this.wsTransferFactoryClient = new WsTransferFactoryClient(Bindings.ServiceMultipleTokenBinding_Common(receiveTimeout, maxReceivedMessageSize), DefaultEndpoints.WsTransferFactory(fimUrl));
     this.wsEnumerationClient     = new WsEnumerationClient(Bindings.ServiceMultipleTokenBinding_Common(receiveTimeout, maxReceivedMessageSize), DefaultEndpoints.WsEnumeration(fimUrl));
     this.mexClient       = new MexClient(Bindings.MetadataExchangeHttpBinding_IMetadataExchange(receiveTimeout, maxReceivedMessageSize), DefaultEndpoints.Mex(fimUrl));
     this.alternateClient = new AlternateClient(Bindings.ServiceMultipleTokenBinding_Common(receiveTimeout, maxReceivedMessageSize), DefaultEndpoints.Alternate(fimUrl));
     this.resourceFactory = new RmResourceFactory();
     this.requestFactory  = new RmRequestFactory();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 public DefaultClient()
 {
     this.wsTransferClient = new WsTransferClient();
     this.wsTransferFactoryClient = new WsTransferFactoryClient();
     this.wsEnumerationClient = new WsEnumerationClient();
     this.mexClient = new MexClient();
     this.alternateClient = new AlternateClient();
     this.resourceFactory = new RmResourceFactory();
     this.requestFactory = new RmRequestFactory();
 }
Ejemplo n.º 5
0
 public DefaultClient(string fimUrl, TimeSpan? receiveTimeout = null, int? maxReceivedMessageSize = null)
 {
     this.wsTransferClient = new WsTransferClient(Bindings.ServiceMultipleTokenBinding_Common(receiveTimeout, maxReceivedMessageSize), DefaultEndpoints.WsTransfer(fimUrl));
     this.wsTransferFactoryClient = new WsTransferFactoryClient(Bindings.ServiceMultipleTokenBinding_Common(receiveTimeout, maxReceivedMessageSize), DefaultEndpoints.WsTransferFactory(fimUrl));
     this.wsEnumerationClient = new WsEnumerationClient(Bindings.ServiceMultipleTokenBinding_Common(receiveTimeout, maxReceivedMessageSize), DefaultEndpoints.WsEnumeration(fimUrl));
     this.mexClient = new MexClient(Bindings.MetadataExchangeHttpBinding_IMetadataExchange(receiveTimeout, maxReceivedMessageSize), DefaultEndpoints.Mex(fimUrl));
     this.alternateClient = new AlternateClient(Bindings.ServiceMultipleTokenBinding_Common(receiveTimeout, maxReceivedMessageSize), DefaultEndpoints.Alternate(fimUrl));
     this.resourceFactory = new RmResourceFactory();
     this.requestFactory = new RmRequestFactory();
 }
Ejemplo n.º 6
0
 public DefaultClient(string fimUrl)
 {
     this.wsTransferClient = new WsTransferClient(Bindings.ServiceMultipleTokenBinding_Common, DefaultEndpoints.WsTransfer(fimUrl));
     this.wsTransferFactoryClient = new WsTransferFactoryClient(Bindings.ServiceMultipleTokenBinding_Common, DefaultEndpoints.WsTransferFactory(fimUrl));
     this.wsEnumerationClient = new WsEnumerationClient(Bindings.ServiceMultipleTokenBinding_Common, DefaultEndpoints.WsEnumeration(fimUrl));
     this.mexClient = new MexClient(Bindings.MetadataExchangeHttpBinding_IMetadataExchange, DefaultEndpoints.Mex(fimUrl));
     this.alternateClient = new AlternateClient(Bindings.ServiceMultipleTokenBinding_Common, DefaultEndpoints.Alternate(fimUrl));
     this.resourceFactory = new RmResourceFactory();
     this.requestFactory = new RmRequestFactory();
 }
Ejemplo n.º 7
0
        public void Dispose()
        {
            if (_isDisposed)
            {
                throw new ObjectDisposedException("FimClient");
            }
            _isDisposed = true;

            _log.Debug("Disposing FIM client by user {0}", System.Threading.Thread.CurrentPrincipal.Identity.Name);

            _defaultClient.Dispose();
            _defaultClient = null;
            _pagedQueriesClient.Close();
            _pagedQueriesClient = null;
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="wsTransferConfigurationName">Name of the ws transfer endpoint configuration.</param>
        /// <param name="wsTransferFactoryConfigurationName">Name of the ws transfer factory endpoint configuration.</param>
        /// <param name="wsEnumerationConfigurationName">Name of the ws enumeration endpoint configuration.</param>
        /// <param name="mexConfigurationName">Name of the mex endpoint configuration.</param>
        public DefaultClient(
            String wsTransferConfigurationName,
            String wsTransferFactoryConfigurationName,
            String wsEnumerationConfigurationName,
            String mexConfigurationName,
            String alternateClientConfigurationName
            )
        {
            this.wsTransferClient        = new WsTransferClient(wsTransferConfigurationName);
            this.wsTransferFactoryClient = new WsTransferFactoryClient(wsTransferFactoryConfigurationName);
            this.wsEnumerationClient     = new WsEnumerationClient(wsEnumerationConfigurationName);
            this.mexClient       = new MexClient(mexConfigurationName);
            this.alternateClient = new AlternateClient(alternateClientConfigurationName);

            this.resourceFactory = new RmResourceFactory();
            this.requestFactory  = new RmRequestFactory();
        }
Ejemplo n.º 9
0
        public static void MyClassInitialize(TestContext testContext)
        {
            NetworkCredential credential = GetCredential();
            transferFactoryClient = new WsTransferFactoryClient();
            transferFactoryClient.ClientCredentials.Windows.ClientCredential = credential;

            enumerationClient = new WsEnumerationClient();
            enumerationClient.ClientCredentials.Windows.ClientCredential = credential;

            transferClient = new WsTransferClient();
            transferClient.ClientCredentials.Windows.ClientCredential = credential;

            mexClient = new MexClient();
            schema = mexClient.Get();
            resourceFactory = new RmResourceFactory(schema);
            requestFactory = new RmRequestFactory(schema);
        }
Ejemplo n.º 10
0
        public static void MyClassInitialize(TestContext testContext)
        {
            NetworkCredential credential = GetCredential();

            transferFactoryClient = new WsTransferFactoryClient();
            transferFactoryClient.ClientCredentials.Windows.ClientCredential = credential;

            enumerationClient = new WsEnumerationClient();
            enumerationClient.ClientCredentials.Windows.ClientCredential = credential;

            transferClient = new WsTransferClient();
            transferClient.ClientCredentials.Windows.ClientCredential = credential;

            mexClient       = new MexClient();
            schema          = mexClient.Get();
            resourceFactory = new RmResourceFactory(schema);
            requestFactory  = new RmRequestFactory(schema);
        }
Ejemplo n.º 11
0
        private void Initialize()
        {
            if (_isDisposed)
            {
                throw new ObjectDisposedException("FimClient");
            }

            if (_isInitialized)
            {
                return;
            }
            lock (_initializationSyncRoot)
            {
                if (_isInitialized)
                {
                    return;
                }

                var ctx = LogContext.WithConfigFormat();

                _log.Debug(ctx.Format("Initializing FIM client for user {0}"), System.Threading.Thread.CurrentPrincipal.Identity.Name);

                // client used for paged queries
                _pagedQueriesClient = _fimUrl == null
                    ? new WsEnumerationClient()
                    : new WsEnumerationClient(Bindings.ServiceMultipleTokenBinding_Common(_receiveTimeout, _maxReceivedMessageSize), DefaultEndpoints.WsEnumeration(_fimUrl));

                // client used for all other operations
                _defaultClient = _fimUrl == null
                    ? new DefaultClient()
                    : new DefaultClient(_fimUrl, _receiveTimeout, _maxReceivedMessageSize);

                if (_credential != null)
                {
                    _pagedQueriesClient.ClientCredentials.Windows.ClientCredential = _credential;
                    _defaultClient.ClientCredential = _credential;
                }

                // reusing schema for all subsequent instances for performance reasons
                // each schema-refresh operation downloads ~1MB of xml that never changes
                if (_schema == null)
                {
                    lock (_schemaSyncRoot)
                    {
                        if (_schema == null)
                        {
                            _log.Debug(ctx.Format("Downloading FIM schema..."));

                            _schema = _defaultClient.RefreshSchema();

                            _log.Debug(ctx.Format("FIM schema downloaded"));
                        }
                    }
                }

                var resourceTypeFactory = CreateResourceTypeFactory();
                _defaultClient.ResourceFactory = new RmResourceFactory(_schema, resourceTypeFactory);
                _defaultClient.RequestFactory  = new RmRequestFactory(_schema);

                _isInitialized = true;

                _log.Debug(ctx.Format("FIM client initialized for user {0}"), System.Threading.Thread.CurrentPrincipal.Identity.Name);
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="wsTransferConfigurationName">Name of the ws transfer endpoint configuration.</param>
        /// <param name="wsTransferFactoryConfigurationName">Name of the ws transfer factory endpoint configuration.</param>
        /// <param name="wsEnumerationConfigurationName">Name of the ws enumeration endpoint configuration.</param>
        /// <param name="mexConfigurationName">Name of the mex endpoint configuration.</param>
        public DefaultClient(
            String wsTransferConfigurationName,
            String wsTransferFactoryConfigurationName,
            String wsEnumerationConfigurationName,
            String mexConfigurationName,
            String alternateClientConfigurationName
            )
        {
            this.wsTransferClient = new WsTransferClient(wsTransferConfigurationName);
            this.wsTransferFactoryClient = new WsTransferFactoryClient(wsTransferFactoryConfigurationName);
            this.wsEnumerationClient = new WsEnumerationClient(wsEnumerationConfigurationName);
            this.mexClient = new MexClient(mexConfigurationName);
            this.alternateClient = new AlternateClient(alternateClientConfigurationName);

            this.resourceFactory = new RmResourceFactory();
            this.requestFactory = new RmRequestFactory();
        }
Ejemplo n.º 13
0
 public virtual IEnumerable <RmResource> CreateEnumeration(WsEnumerationClient client, RmResourceFactory factory, String filter, String[] attributes)
 {
     return(new EnumerationResultEnumerator(client, factory, filter, attributes));
 }
Ejemplo n.º 14
0
 public virtual IEnumerable<RmResource> CreateEnumeration(WsEnumerationClient client, RmResourceFactory factory, String filter, String[] attributes)
 {
     return new EnumerationResultEnumerator(client, factory, filter, attributes);
 }