private static ConnectorInfo FindConnectorInfo
     (ConnectorInfoManager manager,
     string version,
     string connectorName)
 {
     foreach (ConnectorInfo info in manager.ConnectorInfos)
     {
         ConnectorKey key = info.ConnectorKey;
         if (version.Equals(key.BundleVersion) &&
             connectorName.Equals(key.ConnectorName))
         {
             //intentionally ineffecient to test
             //more code
             return(manager.FindConnectorInfo(key));
         }
     }
     return(null);
 }
        private APIOperation GetAPIOperation(OperationRequest request)
        {
            ConnectorInfoManager manager =
                GetConnectorInfoManager();
            ConnectorInfo info = manager.FindConnectorInfo(
                request.ConnectorKey);

            if (info == null)
            {
                throw new Exception("No such connector: "
                                    + request.ConnectorKey);
            }
            String connectorFacadeKey = request.ConnectorFacadeKey;

            ConnectorFacade facade =
                ConnectorFacadeFactory.GetManagedInstance().NewInstance(info, connectorFacadeKey);

            return(facade.GetOperation(request.Operation));
        }
        private APIOperation GetAPIOperation(OperationRequest request)
        {
            ConnectorInfoManager manager =
                GetConnectorInfoManager();
            ConnectorInfo info = manager.FindConnectorInfo(
                request.ConnectorKey);

            if (info == null)
            {
                throw new Exception("No such connector: "
                                    + request.ConnectorKey);
            }
            APIConfigurationImpl config =
                request.Configuration;

            //re-wire the configuration with its connector info
            config.ConnectorInfo = (AbstractConnectorInfo)info;

            ConnectorFacade facade =
                ConnectorFacadeFactory.GetInstance().NewInstance(config);

            return(facade.GetOperation(request.Operation));
        }
 private static ConnectorInfo FindConnectorInfo(ConnectorInfoManager manager,
     string version,
     string connectorName)
 {
     foreach (ConnectorInfo info in manager.ConnectorInfos)
     {
         ConnectorKey key = info.ConnectorKey;
         if (version.Equals(key.BundleVersion) &&
             connectorName.Equals(key.ConnectorName))
         {
             //intentionally ineffecient to test
             //more code
             return manager.FindConnectorInfo(key);
         }
     }
     return null;
 }