Example #1
0
        public ServiceList FindService(FindService fs)
        {
            Debug.Enter();
            ServiceList sl = null;

            try
            {
                sl = fs.Find();

                //
                // Maybe we could filter service projections out earlier, but this seems to be the
                // most readable place to do it.
                //
                if (1 == Context.ApiVersionMajor)
                {
                    sl.ServiceInfos = FilterServiceProjections(sl.ServiceInfos, fs.BusinessKey);
                }
            }
            catch (Exception e)
            {
                DispositionReport.Throw(e);
            }

            return(sl);
        }
        IEnumerable <IService> exec <TRegister, TResolve>()
        {
            Type registerType = typeof(TRegister);
            Type resolveType  = typeof(TResolve);

            ServicesGenerator generator = new ServicesGenerator(new TypeIsClassValidator(), new ImplementationsFinder(new TypeImplementsInterfaceValidator()),
                                                                new ServiceGenerator(
                                                                    new ServiceFlagsGenerator(new ServiceFlagsProvider(new AttributesFinder(), new MemberGenerator(new MemberFlagsGenerator())),
                                                                                              new ServiceFlagsIssuesResolver()),
                                                                    new ServiceRegistrationGenerator(new ServiceRegistrationFlagGenerator(new BaseTypeFinder(), new ServiceRegistrationInterfacesGenerator(new RegistrationInterfacesFilter(new NamespaceInterfaceValidator()), new TypeContainsGenericParametersChecker(), new TypeGenericParametersProvider(), new InterfaceGenerator(new TypeGenericParametersProvider(), new TypeContainsGenericParametersChecker())), new ConstructorGenerator(new ParametersGenerator(new ParameterGenerator())), new ConstructorInfoListGenerator(), new DefaultConstructorInfoProvider())),
                                                                    new ServiceInfoGenerator(), new ClassHasServiceFactoryChecker(),
                                                                    new ServiceFactoryProvider(new InstancesCreator(new ConstructorInstanceCreator(new ConstructorInvoker(),
                                                                                                                                                   new ConstructorParametersGenerator(new TypedMemberValueProvider(), new ConstructorParameterByTypeFinder(),
                                                                                                                                                                                      new ServiceHasConstructorParametersChecker()),
                                                                                                                                                   new ConstructorProvider(new ConstructorChecker(), new DefaultConstructorProvider(),
                                                                                                                                                                           new ConstructorGenerator(new ParametersGenerator(new ParameterGenerator()))), new ConstructorInfoListGenerator(),
                                                                                                                                                   new ConstructorFinder(), new ConstructorListGenerator(new ConstructorGenerator(new ParametersGenerator(new ParameterGenerator()))),
                                                                                                                                                   new ParametersValuesExtractor()))),
                                                                    new ServiceFactoryInvoker()
                                                                    ));

            IEnumerable <IService> services = generator.GenerateServices(registerType, new AssemblyList());
            ServiceList            list     = new ServiceList();

            list.AddServices(services.ToArray());

            GenericClassFinder finder = new GenericClassFinder(new TypeGenericParametersProvider());

            return(finder.FindClasses(list, resolveType));
        }
Example #3
0
        private void ExecuteInsertRSMethod(object obj)
        {
            if (SelectedService == null)
            {
                MessageBox.Show("추가할 서비스를 선택해주세요.");
                return;
            }
            List <ReservedServiceVo> list = _reservedServiceRepository.GetReservedServices(SelectedRes.ResNum);

            if (list.FirstOrDefault(x => (x.SerId == SelectedService.ServiceId)) != null)
            {
                MessageBox.Show("이미 존재하는 서비스입니다.");
                return;
            }
            ReservedServiceVo rv = new ReservedServiceVo();

            rv.ResNum = SelectedRes.ResNum;
            rv.SerId  = SelectedService.ServiceId;
            ServiceVo s           = ServiceList.Single(x => x.ServiceId == rv.SerId);
            ushort    serviceTime = s.ServiceTime;

            if (HasReservations(SelectedRes.StylistId, SelectedRes.EndAt, SelectedRes.EndAt + new TimeSpan(serviceTime / 60, serviceTime % 60, 0)))
            {
                MessageBox.Show("이미 예약이 존재한 시간대입니다.");
                return;
            }
            _reservedServiceRepository.InsertReservedService(rv);
            ServiceCommands.Add(new DataCommandViewModel <ReservedServiceVo>(SelectedService.ServiceName, new Command(RemoveRS), rv));
            TimeSpan ts = new TimeSpan(SelectedService.ServiceTime / 60, SelectedService.ServiceTime % 60, 0);

            SelectedRes.EndAt = SelectedRes.EndAt + ts;
            _reservationRepository.UpdateReservation(SelectedRes);
        }
        // {apiroot/id}
        /// <summary>
        ///  gets all the services with the EsdId provided
        /// 
        ///  this call, doesn't call the service cache, it calls
        ///  the umbraco objects and gets all teh info from there
        /// </summary>
        public HttpResponseMessage Get(string id)
        {
            var serviceList = new ServiceList();

            var roots = Umbraco.TypedContentAtRoot();

            foreach(var root in roots)
            {
                IEnumerable<IPublishedContent> nodes = null;
                if (Open311Settings.Current.useEsdAsId)
                {
                    nodes = root.Descendants()
                        .Where(x => x.IsVisible()
                        && x.GetPropertyValue<string>(Open311Settings.Current.Fields.EsdId) == id);
                }
                else
                {
                    nodes = root.Descendants()
                        .Where(x => x.IsVisible() && x.GetKey().ToString() == id);
                }

                if (nodes!= null && nodes.Any())
                {
                    foreach(var node in nodes)
                    {
                        serviceList.Add(GetServiceFromNode(node, true));
                    }
                    break;
                }
            }
            return GetReturnData(serviceList);
        }
        public void LoadOrRefresh()
        {
            try
            {
                StaticViewModel.AddLogMessage("Loading post install");
                StaticViewModel.IsLoading = true;
                LoadedPanelEnabled        = false;

                HostService.LoadOrRefresh();
                RadeonScheduledTaskList.LoadOrRefresh();
                ServiceList.LoadOrRefresh();
                InstalledList.LoadOrRefresh();
                TempFileList.LoadOrRefresh();

                StaticViewModel.AddLogMessage("Loading post install complete ");
                LoadedPanelEnabled = true;
            }
            catch (Exception ex)
            {
                StaticViewModel.AddLogMessage(ex);
            }
            finally
            {
                StaticViewModel.IsLoading = false;
            }
        }
        private void ApplyChanges()
        {
            try
            {
                StaticViewModel.IsLoading = true;
                LoadedPanelEnabled        = false;
                StaticViewModel.AddLogMessage("Applying changes post install");

                HostService.StopRadeonSoftware();

                HostService.ApplyChanges();
                RadeonScheduledTaskList.ApplyChanges();
                ServiceList.ApplyChanges();
                InstalledList.ApplyChanges();
                TempFileList.ApplyChanges();

                LoadOrRefresh();
                StaticViewModel.AddLogMessage("Changes applied to post install");
            }
            catch (Exception ex)
            {
                StaticViewModel.AddLogMessage(ex, "Failed to apply post install changes");
            }
            finally
            {
                StaticViewModel.IsLoading = false;
            }
        }
Example #7
0
        // Maps the paritions of the applications from primary cluster and secondary cluster
        public async Task MapPartitionsOfApplication(Uri applicationName, ClusterDetails primaryCluster, ClusterDetails secondaryCluster, String reliableDictionary)
        {
            FabricClient primaryFabricClient   = new FabricClient(primaryCluster.address + ':' + primaryCluster.clientConnectionEndpoint);
            FabricClient secondaryFabricClient = new FabricClient(secondaryCluster.address + ':' + secondaryCluster.clientConnectionEndpoint);

            IReliableDictionary <Guid, PartitionWrapper> myDictionary = await this.StateManager.GetOrAddAsync <IReliableDictionary <Guid, PartitionWrapper> >(reliableDictionary);

            ServiceList services = await primaryFabricClient.QueryManager.GetServiceListAsync(applicationName);

            foreach (Service service in services)
            {
                ServicePartitionList primaryPartitions = await primaryFabricClient.QueryManager.GetPartitionListAsync(service.ServiceName);

                ServicePartitionList secondaryPartitions = await secondaryFabricClient.QueryManager.GetPartitionListAsync(service.ServiceName);
                await MapPartitions(applicationName, service.ServiceName, primaryCluster, primaryPartitions, secondaryCluster, secondaryPartitions, reliableDictionary);

                using (var tx = this.StateManager.CreateTransaction())
                {
                    var result = await myDictionary.GetCountAsync(tx);

                    ServiceEventSource.Current.ServiceMessage(this.Context, "The number of items in dictionary are : {0}", result);
                    await tx.CommitAsync();
                }
            }
        }
Example #8
0
        public void Stop_Clicked(object sender, RoutedEventArgs e)
        {
            var curItem = ServiceList.ContainerFromElement(sender as Button) as ListBoxItem;
            var service = curItem.DataContext as ServiceModel;

            service.RunStopCommand();
        }
        public CruisePriceModalsScreen CruisePriceModalsScreen(GetCruisePriceModalsScreen getCruisePriceModalsScreen)
        {
            _unitOfWorkManager.Current.DisableFilter(AbpDataFilters.MayHaveTenant);
            int workingYear = DateTime.Now.Year;

            try
            {
                IEnumerable <ISettingValue> listSettings = SettingManager.GetAllSettingValuesForUserAsync(AbpSession.ToUserIdentifier()).Result;
                if (listSettings != null)
                {
                    if (listSettings.Where(o => o.Name == AppSettings.UserManagement.WorkingYear).SingleOrDefault() != null)
                    {
                        workingYear = Convert.ToInt32(listSettings.Where(o => o.Name == AppSettings.UserManagement.WorkingYear).SingleOrDefault().Value);
                    }
                }
            }
            catch
            {
            }
            CruisePriceModalsScreen cruisePriceModalsScreen = new CruisePriceModalsScreen();
            var    cruises         = _cruisesRepository.GetAll().Where(x => x.Id == getCruisePriceModalsScreen.cruiseId).FirstOrDefault();
            string defaultCurrency = SettingManager.GetSettingValueForApplicationAsync(AppSettings.DefaultCurrency).Result;
            var    seasonGroups    = _lookup_cruiseDeparturesRepository.GetAll().Where(x => x.CruisesId == getCruisePriceModalsScreen.cruiseId && x.DepartureYear == workingYear).
                                     Select(m => new { m.SeasonGroup }).Distinct();
            var _lookupCruiseServices = _cruiseServicesRepository.FirstOrDefault((int)cruises.CruiseServicesId);
            var serviceUnit           = _cruiseServiceUnitsRepository.FirstOrDefault((int)_lookupCruiseServices.CruiseServiceUnitsId);
            var masterAmenities       = _cruiseMasterAmenitiesRepository.GetAll().Where(x => x.Id == serviceUnit.ServiceUnit.Value).FirstOrDefault();

            cruisePriceModalsScreen.CruiseId       = getCruisePriceModalsScreen.cruiseId;
            cruisePriceModalsScreen.CruiseShipsId  = cruises.CruiseShipsId.Value;
            cruisePriceModalsScreen.DefaultCurency = defaultCurrency;
            if (getCruisePriceModalsScreen.serviceGroupId == 5 || getCruisePriceModalsScreen.serviceGroupId == 7)
            {
                cruisePriceModalsScreen.DefaultCurency = "%";
            }
            cruisePriceModalsScreen.ServiceUnit = masterAmenities.DisplayName.ToString();
            // bind SeasonGroups
            cruisePriceModalsScreen.SeasonGroup = new List <SeasonGroups>();
            foreach (var item in seasonGroups)
            {
                SeasonGroups objSeasonGroup = new SeasonGroups();
                objSeasonGroup.SeasonGroupName = item.SeasonGroup;
                cruisePriceModalsScreen.SeasonGroup.Add(objSeasonGroup);
            }
            var _serviceList = _cruiseServicesRepository.GetAll().Where(x => x.CruiseServiceGroupsId == getCruisePriceModalsScreen.serviceGroupId);

            cruisePriceModalsScreen.ServiceList = new List <ServiceList>();
            foreach (var item in _serviceList)
            {
                ServiceList serviceList = new ServiceList();
                var         masterAmenities_ServiecName = _cruiseMasterAmenitiesRepository.GetAll().Where(x => x.Id == item.ServiceName).FirstOrDefault();
                serviceList.ServiceName           = masterAmenities_ServiecName.DisplayName;
                serviceList.ServiceId             = item.Id;
                serviceList.CruiseServiceGroupsId = getCruisePriceModalsScreen.serviceGroupId;

                cruisePriceModalsScreen.ServiceList.Add(serviceList);
            }

            return(cruisePriceModalsScreen);
        }
Example #10
0
        protected override void OnSearch(object sender, string query)
        {
            if (null == query)
            {
                return;
            }

            query = query.Trim();

            if (0 == query.Length)
            {
                return;
            }

            base.OnSearch(sender, query);

            if (query.IndexOf("%") < 0)
            {
                query += "%";
            }

            FindService find = new FindService();

            find.Names.Add(null, query);

            ServiceList list = find.Find();

            grid.DataSource = list.ServiceInfos;
            grid.DataBind();

            count.Text = String.Format(
                Localization.GetString("TEXT_QUERY_COUNT"),
                list.ServiceInfos.Count);
        }
Example #11
0
        public async Task GetServiceListTest()
        {
            int    pageNo    = 1;
            int    pageSize  = 2;
            string groupName = "test";

            ServiceList mockServiceList = new ServiceList();

            mockServiceList.Count = 336;
            mockServiceList.Doms.Add("tms_order_v1");
            mockServiceList.Doms.Add("tms_order_v2");

            var mockHttp = new MockHttpMessageHandler();
            var request  = mockHttp.When(HttpMethod.Get, _config.ServerAddr[0] + UtilAndComs.NACOS_URL_BASE + "/service/list")
                           .WithQueryString(NamingProxy.PAGE_NO_KEY, pageNo.ToString())
                           .WithQueryString(NamingProxy.PAGE_SIZE_KEY, pageSize.ToString())
                           .WithQueryString(NamingProxy.NAMESPACE_ID_KEY, _config.Namespace)
                           .WithQueryString(NamingProxy.GROUP_NAME_KEY, groupName)
                           .Respond("application/json", JsonConvert.SerializeObject(mockServiceList));

            var proxy    = CreateProxy(mockHttp);
            var response = await proxy.GetServiceList(pageNo, pageSize, groupName, null);

            Assert.Equal(1, mockHttp.GetMatchCount(request));
            Assert.Equal(mockServiceList.Count, response.Count);
            Assert.Equal(mockServiceList.Doms[0], response.Doms[0]);
            Assert.Equal(mockServiceList.Doms[1], response.Doms[1]);
        }
Example #12
0
        public async Task <IActionResult> Edit(Guid id, [Bind("ID,Name,BasePrice,Description")] ServiceList serviceList)
        {
            if (id != serviceList.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(serviceList);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ServiceListExists(serviceList.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(serviceList));
        }
        public void CalcUnitPriceTest()
        {
            var services = new ServiceList();

            // どのサービスにも入っていない
            services.Clear();
            Assert.AreEqual(20, services.CalcUnitPrice(new Record("5 2004/06/04 03:34 003 090-1234-0002")), "どのサービスにも入っていなければ20円");

            // 家族割引に加入している
            services.Clear();
            services.CheckService(new Record("2 C1 090-1234-0002"));
            Assert.AreEqual(10, services.CalcUnitPrice(new Record("5 2004/06/04 03:34 003 090-1234-0002")), "家族割引の対象の通話先ならば10円");
            Assert.AreEqual(20, services.CalcUnitPrice(new Record("5 2004/06/04 03:34 003 090-1234-9999")), "家族割引の対象外の通話先ならば20円");

            // 昼トク割引に加入している
            services.Clear();
            services.CheckService(new Record("2 E1"));
            Assert.AreEqual(15, services.CalcUnitPrice(new Record("5 2004/06/04 08:00 003 090-1234-0002")), "昼トク割引の対象の時間帯ならば15円");
            Assert.AreEqual(20, services.CalcUnitPrice(new Record("5 2004/06/04 18:00 003 090-1234-0002")), "昼トク割引の対象外の時間帯ならば20円");

            // 家族割引と昼トク割引に加入している
            services.Clear();
            services.CheckService(new Record("2 C1 090-1234-0002"));
            services.CheckService(new Record("2 E1"));
            Assert.AreEqual(7, services.CalcUnitPrice(new Record("5 2004/06/04 08:00 003 090-1234-0002")), "昼トク割引の対象で、家族割引の対象ならば7円");
            Assert.AreEqual(15, services.CalcUnitPrice(new Record("5 2004/06/04 08:00 003 090-1234-9999")), "昼トク割引の対象で、家族割引の対象外ならば15円");
            Assert.AreEqual(10, services.CalcUnitPrice(new Record("5 2004/06/04 18:00 003 090-1234-0002")), "昼トク割引の対象外で、家族割引の対象ならば10円");
            Assert.AreEqual(20, services.CalcUnitPrice(new Record("5 2004/06/04 18:00 003 090-1234-9999")), "昼トク割引の対象外で、家族割引の対象外ならば20円");
        }
Example #14
0
        public static void RemovePlugin <T>()
        {
            foreach (var item in CommandMap)
            {
                if (typeof(T) != item.Value.GetType())
                {
                    continue;
                }
                CommandMap.Remove(item.Key, out _);
            }

            foreach (var item in ServiceList)
            {
                if (typeof(T) != item.GetType())
                {
                    continue;
                }
                ServiceList.Remove(item);
            }

            foreach (var item in ApplicationList)
            {
                if (typeof(T) != item.GetType())
                {
                    continue;
                }
                ApplicationList.Remove(item);
            }
        }
Example #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    Butonvisible(true);
                    panelVisible(false, true, false, false);

                    List <string> languageList = (from l in db.Language
                                                  where l.IsActive == true
                                                  select l.LanguageName).ToList();
                    ddlLanguage.DataSource = languageList;
                    ddlLanguage.DataBind();
                    ddlFilterLanguage.DataSource = languageList;
                    ddlFilterLanguage.DataBind();
                    ddlFilterLanguage.Items.Insert(0, new ListItem("Dil Seçiniz..", "0"));
                    ddlFilterLanguage.SelectedIndex = 0;
                }
                ServiceList.DataSource = (from s in db.Services select s).ToList();
                ServiceList.DataBind();
                ((Master)this.Master).Path     = "Hizmetler";
                ((Master)this.Master).PathLink = "ServicesPage.aspx";
            }
            catch (Exception)
            {
                Uyari("Bir Hata Oluştu!", false);
                pnlAlert.Visible = true;
            }
        }
Example #16
0
 private void ServiceList_CurrentCellDirtyStateChanged(object sender, EventArgs e)
 {
     if (ServiceList.IsCurrentCellDirty)
     {
         ServiceList.CommitEdit(DataGridViewDataErrorContexts.Commit);
     }
 }
Example #17
0
        public static void RunServicesFromInjector(string[] args)
        {
            InitDefaults();
            var services = Injector.GetAllInstances <IService>();
            var service  = new ServiceList(services);

            ServiceContainerFactory(service, null).Run(args);
        }
 public static DalList ToDalList(this ServiceList list)
 {
     return(new DalList
     {
         ID = list.ID,
         Name = list.Name
     });
 }
Example #19
0
 public static ListModel ToListModel(this ServiceList list)
 {
     return(new ListModel
     {
         ID = list.ID,
         Name = list.Name
     });
 }
        private async Task <List <ReplicaMonitoringInfo> > GetDeployedApplicationReplicaOrInstanceListAsync(Uri applicationNameFilter)
        {
            var deployedApps = await this.FabricClientInstance.QueryManager.GetDeployedApplicationListAsync(this.NodeName, applicationNameFilter).ConfigureAwait(true);

            var currentReplicaInfoList = new List <ReplicaMonitoringInfo>();

            foreach (var deployedApp in deployedApps)
            {
                var serviceList = await this.FabricClientInstance.QueryManager.GetServiceListAsync(deployedApp.ApplicationName).ConfigureAwait(true);

                ServiceList filteredServiceList = null;

                var app = this.targetList.Where(x => x.Target.ToLower() == deployedApp.ApplicationName.OriginalString.ToLower() &&
                                                (!string.IsNullOrEmpty(x.ServiceExcludeList) ||
                                                 !string.IsNullOrEmpty(x.ServiceIncludeList)))?.FirstOrDefault();
                if (app != null)
                {
                    filteredServiceList = new ServiceList();

                    if (!string.IsNullOrEmpty(app.ServiceExcludeList))
                    {
                        string[] list = app.ServiceExcludeList.Split(',');

                        // Excludes...?
                        foreach (var service in serviceList)
                        {
                            if (!list.Any(l => service.ServiceName.OriginalString.Contains(l)))
                            {
                                filteredServiceList.Add(service);
                            }
                        }
                    }
                    else if (!string.IsNullOrEmpty(app.ServiceIncludeList))
                    {
                        string[] list = app.ServiceIncludeList.Split(',');

                        // Includes...?
                        foreach (var service in serviceList)
                        {
                            if (list.Any(l => service.ServiceName.OriginalString.Contains(l)))
                            {
                                filteredServiceList.Add(service);
                            }
                        }
                    }
                }

                var replicasOrInstances = await this.GetDeployedPrimaryReplicaAsync(deployedApp.ApplicationName, filteredServiceList ?? serviceList).ConfigureAwait(true);

                currentReplicaInfoList.AddRange(replicasOrInstances);

                // This is for reporting...
                this.replicaOrInstanceList.AddRange(replicasOrInstances);
            }

            return(currentReplicaInfoList);
        }
Example #21
0
 public Order()
 {
     OwnerInfo       = new OrderSourceInfo();
     DateInfo        = new BookDateInfo();
     Travellers      = new TravellerList();
     Services        = new ServiceList();
     ServiceGroups   = new List <ServiceGroup>();
     DataItems       = new PNRDataItemList();
     PossibleActions = new PNRPossibleActionList();
 }
Example #22
0
        public static ListPageModel GetListPageModel(int id, int userID)
        {
            ListPageModel model = new ListPageModel();
            ServiceList   list  = manager.listService.GetListById(id);
            var           books = manager.listService.GetListBooks(list);

            model.List  = list.ToListModel();
            model.Books = books.Select(e => Book.GetBookShortModel(e, userID));
            return(model);
        }
Example #23
0
        public static EditListModel GetEditListModel(int listID)
        {
            ServiceList   list   = manager.listService.GetListById(listID);
            var           books  = manager.listService.GetListBooks(list);
            EditListModel result = new EditListModel();

            result.List      = list.ToListModel();
            result.ListBooks = books.Select(e => e.ToBookShortModel());
            return(result);
        }
Example #24
0
            public RegisterServicesBody(RegisterServicesBody value)
            {
                /// Initiliaze the protected variables
                m_ServiceList = new ServiceList();
                m_ServiceList.setParent(this);

                /// Copy the values
                m_ServiceList = value.m_ServiceList;
                m_ServiceList.setParent(this);
                /// This code is currently not supported
            }
Example #25
0
        private void onSelectedResChanged(uint resNum)
        {
            List <ReservedServiceVo> list = _reservedServiceRepository.GetReservedServices(resNum);

            ServiceCommands.Clear();
            foreach (var v in list)
            {
                string serviceName = ServiceList.Single(x => (x.ServiceId == v.SerId)).ServiceName;
                ServiceCommands.Add(new DataCommandViewModel <ReservedServiceVo>(serviceName, new Command(RemoveRS), v));
            }
        }
Example #26
0
        /// <summary>
        /// Gets the service key from service name.
        /// </summary>
        /// <param name="UDDIConnection">The UDDI connection.</param>
        /// <param name="sName">Name of the service.</param>
        /// <returns></returns>
        public static string GetServiceKey(UddiConnection UDDIConnection, string sName)
        {
            FindService findService = new FindService(sName);
            ServiceList bList       = findService.Send(UDDIConnection);

            if (bList.ServiceInfos.Count > 0)
            {
                return(bList.ServiceInfos[0].ServiceKey);
            }
            return(String.Empty);
        }
Example #27
0
 private void ExecuteDeleteMethod(object obj)
 {
     if (SelectedService.ServiceId == 0)
     {
         MessageBox.Show("서비스를 선택해주세요");
         return;
     }
     _serviceRepository.DeleteService(SelectedService.ServiceId);
     ServiceList.Remove(SelectedService);
     SelectedService = new ServiceVo();
 }
Example #28
0
        public async Task <IActionResult> Get()
        {
            ServiceList services = await this.fabric.QueryManager.GetServiceListAsync(new Uri(applicationName));

            return(this.Ok(services
                           .Where(x => x.ServiceTypeName == Constants.TOPIC_SERVICE_TYPE_NAME)
                           .Select(x => new
            {
                ServiceName = x.ServiceName.ToString(),
                ServiceStatus = x.ServiceStatus.ToString()
            })));
        }
Example #29
0
        public async Task <ClusterInfo> Info()
        {
            NodeList nodes = await this.query.GetNodesAsync();

            ApplicationTypeList appTypes = await this.query.GetApplicationTypesAsync();

            ApplicationList applications = await this.query.GetApplicationsAsync();

            ClusterLoadInformation clusterLoadInfo = await this.query.GetClusterLoadAsync();

            ClusterHealth clusterHealth = await this.query.GetClusterHealthAsync();

            ProvisionedFabricCodeVersion version = await this.query.GetFabricVersion();

            long serviceCount   = 0;
            long partitionCount = 0;
            long replicaCount   = 0;

            foreach (Node node in nodes)
            {
                DeployedApplicationList deployedApplicationList = await this.query.GetDeployedApplicationsAsync(node.NodeName);

                foreach (DeployedApplication deployedApplication in deployedApplicationList)
                {
                    DeployedServiceReplicaList deployedReplicas =
                        await this.query.GetDeployedReplicasAsync(node.NodeName, deployedApplication.ApplicationName);

                    replicaCount += deployedReplicas.Count;
                }
            }

            foreach (Application application in applications)
            {
                ServiceList services = await this.query.GetServicesAsync(application.ApplicationName);

                serviceCount += services.Count;
            }

            return(new ClusterInfo(
                       clusterHealth.AggregatedHealthState.ToString(),
                       version != null ? version.CodeVersion : "not based",
                       nodes.Select(x => x.NodeType).Distinct().Count(),
                       appTypes.Count(),
                       nodes.Select(x => x.FaultDomain.ToString()).Distinct().Count(),
                       nodes.Select(x => x.UpgradeDomain).Distinct().Count(),
                       nodes.Count,
                       applications.Count,
                       serviceCount,
                       partitionCount, // TODO: partition count
                       replicaCount,
                       clusterLoadInfo.LastBalancingStartTimeUtc,
                       clusterLoadInfo.LastBalancingEndTimeUtc));
        }
Example #30
0
        public async Task <IEnumerable <SubscriberInfo> > GetSubscribers(string topic, string applicationName)
        {
            ServiceList services = await fabric.QueryManager.GetServiceListAsync(new Uri(applicationName));

            return(services.
                   Where(x => x.ServiceTypeName == Constants.SUBSCRIBER_SERVICE_TYPE_NAME && x.ServiceName.IsTopic(topic))
                   .Select(x => new SubscriberInfo
            {
                ServiceName = x.ServiceName.ToString(),
                ServiceStatus = x.ServiceStatus.ToString()
            }));
        }
Example #31
0
        public async Task <IActionResult> Create([Bind("ID,Name,BasePrice,Description")] ServiceList serviceList)
        {
            if (ModelState.IsValid)
            {
                serviceList.ID = Guid.NewGuid();
                _context.Add(serviceList);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(serviceList));
        }
Example #32
0
		/// <summary>
		/// 在指定的路径中查找服务提供者
		/// </summary>
		/// <param name="loaderPath">文件夹列表</param>
		/// <returns>查找的结果</returns>
		public static ServiceList GetServices(params string[] loaderPath)
		{
			ServiceList list = new ServiceList();
			Action<string> loader = s =>
			{
				ServiceInfo[] slist = GetServicesInAssembly(s);
				if (slist != null) list.AddRange(slist);
			};
			Action<string> folderLoader = s =>
			{
				if (!System.IO.Path.IsPathRooted(s))
					s = System.IO.Path.Combine(
						System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location), s);

				string[] files = System.IO.Directory.GetFiles(s, "*.exe");
				Array.ForEach(files, loader);

				files = System.IO.Directory.GetFiles(s, "*.dll");
				Array.ForEach(files, loader);
			};

			folderLoader(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location));
			Array.ForEach(loaderPath, folderLoader);

			return list;
		}
Example #33
0
 private void GetAllServers(ServiceList sl)
 {
     try
     {
         foreach (Server leaf in leafs)
         {
             sl.Add(leaf);
             leaf.GetAllServers(sl);
         }
     }
     catch (Exception ex)
     {
         p_core.SendLogMessage("Server", "GetAllServers(2)", BlackLight.Services.Error.Errors.ERROR, "Problem", "", ex.Message, ex.StackTrace);
     }
 }
Example #34
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Returns a list of all servers linked to this instance
 /// </summary>
 /// <returns></returns>
 /// <remarks>
 /// </remarks>
 /// <history>
 /// 	[Caleb]	6/18/2005	Created
 /// </history>
 /// -----------------------------------------------------------------------------
 public ServiceList GetAllServers()
 {
     try
     {
         ServiceList sl = new ServiceList();
         foreach (Server leaf in leafs)
         {
             sl.Add(leaf);
             leaf.GetAllServers(sl);
         }
         return sl;
     }
     catch (Exception ex)
     {
         p_core.SendLogMessage("Server", "GetAllServers", BlackLight.Services.Error.Errors.ERROR, "Problem", "", ex.Message, ex.StackTrace);
     return null;
     }
 }
Example #35
0
        /// <summary>
        ///   Cauta servicii pe baza informatiilor specificate pornind de la BusinessService.
        /// </summary>
        /// /// <param name="list">Lista cu informatii despre servicii, in care se fac adaugari</param>
        /// /// <param name="serviceList">Lista de grupuri de servicii</param>
        private void exploreServices(List<WSInfo> list, ServiceList serviceList)
        {
            WSInfo wsInfo;

            foreach (ServiceInfo serviceInfo in serviceList.ServiceInfos) {

                GetBusinessDetail getBusinessDetail = new GetBusinessDetail(serviceInfo.BusinessKey);
                BusinessDetail businessDetail       = getBusinessDetail.Send(uddiConnection);

                GetServiceDetail getServiceDetail = new GetServiceDetail(serviceInfo.ServiceKey);
                ServiceDetail serviceDetail       = getServiceDetail.Send(uddiConnection);

                foreach (BindingTemplate bindingTemplate in serviceDetail.BusinessServices[0].BindingTemplates) {

                    if (ontologyAttributes != null  && bindingTemplate.TModelInstanceInfos.Count !=0 ) {

                        Boolean stop = false;

                        for (int i=0;i < ontologyAttributes.Length && !stop; i = i+2) {

                            for(int j=0;j < bindingTemplate.TModelInstanceInfos.Count && !stop; ++j) {

                                if(bindingTemplate.TModelInstanceInfos[j].TModelKey == ontologyAttributes[i]) {

                                    wsInfo = new WSInfo(businessDetail.BusinessEntities[0].AuthorizedName,
                                                         serviceInfo.BusinessKey,
                                                         businessDetail.BusinessEntities[0].Names[0].Text,
                                                         serviceInfo.ServiceKey,
                                                         serviceInfo.Names[0].Text,
                                                         bindingTemplate.BindingKey,
                                                         bindingTemplate.AccessPoint.Text,
                                                         ontologyAttributes[i + 1]);

                                    list.Add(wsInfo);

                                    stop = true;
                                }
                            }
                        }
                    }

                    if (ontologyAttributes == null) {

                        wsInfo = new WSInfo( businessDetail.BusinessEntities[0].AuthorizedName,
                                             serviceInfo.BusinessKey,
                                             businessDetail.BusinessEntities[0].Names[0].Text,
                                             serviceInfo.ServiceKey,
                                             serviceInfo.Names[0].Text,
                                             bindingTemplate.BindingKey,
                                             bindingTemplate.AccessPoint.Text,
                                             "");

                        list.Add(wsInfo);
                    }
                }
            }
        }
 public FloodServService(LocalClient tMyClient, ServicesCore tMyCore, DataBase tFloodDB, ModuleList Modules)
 {
     this.MyClient = tMyClient;
     this.MyCore = tMyCore;
     this.FloodDB = tFloodDB;
     this.Modules = Modules;
     Help = ((Help.Help) this.Modules["Help"]);
     m_NPWatches = new ArrayList();
     m_NSWatches = new ArrayList();
     m_RegWatches = new ArrayList();
     m_Recent = new ServiceList();
     updateWatchList(0);
     updateWatchList(1);
     updateWatchList(2);
 }
        /// <summary>
        ///  gets the service list from either the cache or umbraco.
        /// </summary>
        /// <returns></returns>
        private ServiceList GetServiceList()
        {
            var cache = ApplicationContext.Current.ApplicationCache.RuntimeCache;

            ServiceList serviceList = cache.GetCacheItem<ServiceList>(Open311Settings.Current.CacheName);

            if (serviceList == null)
            {
                serviceList = new ServiceList();

                var siteRoots = Umbraco.TypedContentAtRoot();
                foreach(var root in siteRoots)
                {
                    IEnumerable<IPublishedContent> nodes = null;
                    if (Open311Settings.Current.useEsdAsId)
                    {
                        nodes = root.Descendants()
                            .Where(x => x.IsVisible() && x.HasValue(Open311Settings.Current.Fields.EsdId));
                    }
                    else
                    {
                        nodes = root.Descendants()
                            .Where(x => x.IsVisible());
                    }

                    if (nodes != null && nodes.Any())
                    {
                        foreach (var node in nodes)
                        {
                            serviceList.Add(GetServiceFromNode(node));
                        }
                    }
                }

                cache.InsertCacheItem<ServiceList>(Open311Settings.Current.CacheName,
                    () => serviceList, priority: CacheItemPriority.Default);

            }

            return serviceList;
        }
 private HttpResponseMessage GetReturnData(ServiceList services)
 {
     XmlMediaTypeFormatter xmlFormatter = new XmlMediaTypeFormatter();
     xmlFormatter.UseXmlSerializer = true;
     var content = new ObjectContent<ServiceList>(services, xmlFormatter);
     return new HttpResponseMessage()
     {
         Content = content
     };
 }
Example #39
0
 public Server(string name, ServicesCore core)
     : base(name, core)
 {
     users = new ServiceList();
     leafs = new ServiceList();
 }
Example #40
0
 protected override void Dispose(bool disposing)
 {
     Server tLeaf;
     Client tUser;
     while (leafs.Count > 0)
     {
         tLeaf = ((Server) leafs[0]);
         tLeaf.Dispose();
     }
     while (users.Count > 0)
     {
         tUser = ((Client) users[0]);
         p_core.Raise_Quit(tUser.nick, "Lost in netsplit");
         tUser.Dispose();
     }
     tLeaf = null;
     tUser = null;
     users = null;
     if (p_hostServer != null && p_hostServer.leafs.Contains(this))
     {
         p_hostServer.leafs.Remove(this);
         p_hostServer = null;
     }
     else
     {
         p_core.SendLogMessage("Server", "Dispose", BlackLight.Services.Error.Errors.DEBUG, "Host server is nothing or does not contain me", "", "", "");
     }
     leafs = null;
     p_description = null;
     p_name = null;
 }