public async Task <IHttpActionResult> GetAllTerritoryHandles()
        {
            ICollection <iS3TerritoryHandle> result = null;

            result = await MiniServer.GetAllTerritoryHandles();

            return(Ok(result));
        }
        public async Task <IHttpActionResult> AddDomain(iS3DomainHandle handle)
        {
            if (handle == null)
            {
                return(BadRequest("Argument Null"));
            }

            iS3DomainHandle newHandle = await MiniServer.AddDomain(handle);

            return(Ok(newHandle));
        }
        public async Task <IHttpActionResult> GetDomainHandle(string nameOrID, string parentNameOrID)
        {
            if (nameOrID == null)
            {
                return(BadRequest("Argument Null"));
            }

            iS3DomainHandle result = null;

            result = await MiniServer.GetDomainHandle(nameOrID, parentNameOrID);

            return(Ok(result));
        }
        public async Task <IHttpActionResult> GetTerritoryHandle(string nameOrID)
        {
            if (nameOrID == null)
            {
                return(BadRequest("Argument Null"));
            }

            iS3TerritoryHandle result = null;

            result = await MiniServer.getTerritoryHandle(nameOrID);

            return(Ok(result));
        }
Exemple #5
0
        // Add territory using the corresponding information in handle
        // Returns the newly added territory handle (not the input one).
        //
        public static async Task <iS3TerritoryHandle> AddTerritory(
            iS3TerritoryHandle territoryHandle)
        {
            iS3TerritoryHandle newHandle =
                await MiniServer.AddTerritoryHandle(territoryHandle.Name,
                                                    territoryHandle.Type, territoryHandle.DbName);

            Type         t         = MiniServer.GetType(newHandle.Type);
            iS3Territory territory = (iS3Territory)
                                     Activator.CreateInstance(t, newHandle);

            MiniServer.AddTerritory(territory);

            return(newHandle);
        }
Exemple #6
0
        // Add domain using the corresponding information in handle
        // Returns the newly added domain handle (not the input one).
        //
        public static async Task <iS3DomainHandle> AddDomain(
            iS3DomainHandle domainHandle)
        {
            iS3DomainHandle newHandle =
                await MiniServer.AddDomainHandle(domainHandle.Name, domainHandle.Type,
                                                 domainHandle.ParentID, domainHandle.DbName);

            iS3Territory territory = MiniServer.GetTerritory(newHandle.ParentID);

            Type      t      = MiniServer.GetType(newHandle.Type);
            iS3Domain domain = (iS3Domain)
                               Activator.CreateInstance(t, newHandle);

            territory.Domains.Add(domain);

            return(newHandle);
        }
        public ICollection <string> SupportedProjects()
        {
            ICollection <string> result = MiniServer.GetSubClasses <iS3Project>();

            return(result);
        }
        public ICollection <string> SupportedDomains()
        {
            ICollection <string> result = MiniServer.GetSubClasses <iS3Domain>();

            return(result);
        }
        public ICollection <string> SupportedTerritories()
        {
            ICollection <string> result = MiniServer.GetSubClasses <iS3Territory>();

            return(result);
        }