Esempio n. 1
0
 public CmdVerbs()
 {
     GetToolVersion          = new CmdArgsGetToolVersion();
     NewSubscriber           = new CmdArgsNewSub();
     GetSubscriber           = new CmdArgsSubIdOpt();
     RemoveSubscriber        = new CmdArgsSubIdReq();
     SyncSubscriber          = new CmdArgsSubIdOpt();
     PublishDirectory        = new CmdArgsPublishDirectory();
     SyncDirectory           = new CmdArgsSyncDirectory();
     InitalizeSyncState      = new CmdArgsInitalizeSyncState();
     KuduSync                = new KuduSyncOptions();
     GetHelp                 = new CmdArgsGetHelpCommand();
     SetSubscriberSiteStatus = new CmdArgsSetSubscriberSiteStatus();
     WatchSyncState          = new CmdArgsWatchSyncState();
 }
Esempio n. 2
0
        public SubscriberState NewSubscriber(CmdArgsNewSub args)
        {
            var ops = GetOperations();
            var sub = args.Id;
            var publicUpdateNotifyUri  = new Uri(args.PublicUpdateNotifyUrl, UriKind.Absolute);
            var privateUpdateNotifyUri = !String.IsNullOrEmpty(args.PrivateUpdateNotifyUrl) ? new Uri(args.PrivateUpdateNotifyUrl, UriKind.Absolute) : null;

            var init = new SubscriberState()
            {
                Id = args.Id,
                PrivateUpdateNotifyUri = privateUpdateNotifyUri,
                PublicUpdateNotifyUri  = publicUpdateNotifyUri,
                SubscribedToPublisher  = Config.DefaultPublisherId
            };

            if (!ops.CreateSubscriber(init))
            {
                return(null);
            }
            return(init);
        }