Inheritance: Stratosphere.Aws.AmazonWebService
コード例 #1
0
ファイル: SdbTable.cs プロジェクト: dfrandsen/Stratosphere
 private SdbTable(SdbService service, string domainName, bool withConsistency, int?selectLimit)
 {
     _service         = service;
     _domainName      = domainName;
     _withConsistency = withConsistency;
     _selectLimit     = selectLimit;
 }
コード例 #2
0
ファイル: SdbTable.cs プロジェクト: dfrandsen/Stratosphere
        private static IEnumerable <XElement> SelectElements(SdbService service, string selectExpression, bool withConsistency)
        {
            string nextToken = null;

            do
            {
                XElement responseElement = service.Execute(
                    new SelectBuilder(selectExpression, nextToken, withConsistency));

                foreach (XElement itemElement in responseElement.Descendants(Sdb + "Item"))
                {
                    yield return(itemElement);
                }

                XElement nextTokenElement = responseElement.Descendants(Sdb + "NextToken").FirstOrDefault();

                if (nextTokenElement == null)
                {
                    nextToken = null;
                }
                else
                {
                    nextToken = nextTokenElement.Value;
                }
            }while (nextToken != null);
        }
コード例 #3
0
ファイル: SdbTable.cs プロジェクト: petrohi/Stratosphere
 private SdbTable(SdbService service, string domainName, bool withConsistency, int? selectLimit)
 {
     _service = service;
     _domainName = domainName;
     _withConsistency = withConsistency;
     _selectLimit = selectLimit;
 }
コード例 #4
0
ファイル: SdbTable.cs プロジェクト: dfrandsen/Stratosphere
        public static IEnumerable <SdbTable> ListTables(string serviceId, string serviceSecret, bool withConsistency, int?selectLimit)
        {
            SdbService service         = new SdbService(serviceId, serviceSecret);
            XElement   responseElement = service.Execute(new ListDomainsBuilder());

            foreach (string domainName in responseElement.Descendants(Sdb + "DomainName").Select(n => n.Value))
            {
                yield return(new SdbTable(service, domainName, withConsistency, selectLimit));
            }
        }
コード例 #5
0
ファイル: SdbTable.cs プロジェクト: dfrandsen/Stratosphere
        public static bool TryCreate(string serviceId, string serviceSecret, string domainName, bool withConsistency, int?selectLimit, bool ensureDomain, out SdbTable table)
        {
            SdbService service         = new SdbService(serviceId, serviceSecret);
            XElement   responseElement = service.Execute(new ListDomainsBuilder());

            if (responseElement.Descendants(Sdb + "DomainName").Select(n => n.Value).Contains(domainName))
            {
                table = new SdbTable(service, domainName, withConsistency, selectLimit);
                return(true);
            }

            if (ensureDomain)
            {
                table = Create(service, domainName, withConsistency, selectLimit);
                return(true);
            }

            table = null;
            return(false);
        }
コード例 #6
0
ファイル: SdbTable.cs プロジェクト: dfrandsen/Stratosphere
        public static SdbTable Create(string serviceId, string serviceSecret, string domainName, bool withConsistency, int?selectLimit)
        {
            SdbService service = new SdbService(serviceId, serviceSecret);

            return(Create(service, domainName, withConsistency, selectLimit));;
        }
コード例 #7
0
ファイル: SdbTable.cs プロジェクト: dfrandsen/Stratosphere
 private static SdbTable Create(SdbService service, string domainName, bool withConsistency, int?selectLimit)
 {
     service.Execute(new CreateDomainBuilder(domainName));
     return(new SdbTable(service, domainName, withConsistency, selectLimit));
 }
コード例 #8
0
ファイル: SdbTable.cs プロジェクト: dfrandsen/Stratosphere
 public static void ResetBoxUsage()
 {
     SdbService.ResetBoxUsage();
 }
コード例 #9
0
ファイル: SdbTable.cs プロジェクト: petrohi/Stratosphere
 public static SdbTable Create(string serviceId, string serviceSecret, string domainName, bool withConsistency, int? selectLimit)
 {
     SdbService service = new SdbService(serviceId, serviceSecret);
     return Create(service, domainName, withConsistency, selectLimit); ;
 }
コード例 #10
0
ファイル: SdbTable.cs プロジェクト: petrohi/Stratosphere
        private static IEnumerable<XElement> SelectElements(SdbService service, string selectExpression, bool withConsistency)
        {
            string nextToken = null;

            do
            {
                XElement responseElement = service.Execute(
                    new SelectBuilder(selectExpression, nextToken, withConsistency));

                foreach (XElement itemElement in responseElement.Descendants(Sdb + "Item"))
                {
                    yield return itemElement;
                }

                XElement nextTokenElement = responseElement.Descendants(Sdb + "NextToken").FirstOrDefault();

                if (nextTokenElement == null)
                {
                    nextToken = null;
                }
                else
                {
                    nextToken = nextTokenElement.Value;
                }
            }
            while (nextToken != null);
        }
コード例 #11
0
ファイル: SdbTable.cs プロジェクト: petrohi/Stratosphere
 private static SdbTable Create(SdbService service, string domainName, bool withConsistency, int? selectLimit)
 {
     service.Execute(new CreateDomainBuilder(domainName));
     return new SdbTable(service, domainName, withConsistency, selectLimit);
 }
コード例 #12
0
ファイル: SdbTable.cs プロジェクト: petrohi/Stratosphere
        public static bool TryCreate(string serviceId, string serviceSecret, string domainName, bool withConsistency, int? selectLimit, bool ensureDomain, out SdbTable table)
        {
            SdbService service = new SdbService(serviceId, serviceSecret);
            XElement responseElement = service.Execute(new ListDomainsBuilder());

            if (responseElement.Descendants(Sdb + "DomainName").Select(n => n.Value).Contains(domainName))
            {
                table = new SdbTable(service, domainName, withConsistency, selectLimit);
                return true;
            }

            if (ensureDomain)
            {
                table = Create(service, domainName, withConsistency, selectLimit);
                return true;
            }

            table = null;
            return false;
        }
コード例 #13
0
ファイル: SdbTable.cs プロジェクト: petrohi/Stratosphere
        public static IEnumerable<SdbTable> ListTables(string serviceId, string serviceSecret, bool withConsistency, int? selectLimit)
        {
            SdbService service = new SdbService(serviceId, serviceSecret);
            XElement responseElement = service.Execute(new ListDomainsBuilder());

            foreach (string domainName in responseElement.Descendants(Sdb + "DomainName").Select(n => n.Value))
            {
                yield return new SdbTable(service, domainName, withConsistency, selectLimit);
            }
        }