Пример #1
0
        public static TimelineDomain GenerateDomain()
        {
            TimelineDomain domain = new TimelineDomain();

            domain.SetId("namesapce id");
            domain.SetDescription("domain description");
            domain.SetOwner("domain owner");
            domain.SetReaders("domain_reader");
            domain.SetWriters("domain_writer");
            domain.SetCreatedTime(0L);
            domain.SetModifiedTime(1L);
            return(domain);
        }
Пример #2
0
        private static TimelineDomain CreateTimelineDomain(string id, string description,
                                                           string owner, string readers, string writers, long createdTime, long modifiedTime
                                                           )
        {
            TimelineDomain domainToStore = new TimelineDomain();

            domainToStore.SetId(id);
            domainToStore.SetDescription(description);
            domainToStore.SetOwner(owner);
            domainToStore.SetReaders(readers);
            domainToStore.SetWriters(writers);
            domainToStore.SetCreatedTime(createdTime);
            domainToStore.SetModifiedTime(modifiedTime);
            return(domainToStore);
        }
Пример #3
0
        /// <exception cref="System.Exception"/>
        protected override void ServiceInit(Configuration conf)
        {
            TimelineDomain domain = store.GetDomain("DEFAULT");

            // it is okay to reuse an existing domain even if it was created by another
            // user of the timeline server before, because it allows everybody to access.
            if (domain == null)
            {
                // create a default domain, which allows everybody to access and modify
                // the entities in it.
                domain = new TimelineDomain();
                domain.SetId(DefaultDomainId);
                domain.SetDescription("System Default Domain");
                domain.SetOwner(UserGroupInformation.GetCurrentUser().GetShortUserName());
                domain.SetReaders("*");
                domain.SetWriters("*");
                store.Put(domain);
            }
            base.ServiceInit(conf);
        }