Beispiel #1
0
 ExistsBuilderImpl(CuratorFrameworkImpl client)
 {
     this.client   = client;
     backgrounding = new Backgrounding();
     watching      = new Watching();
     createParentContainersIfNeeded = false;
 }
Beispiel #2
0
 internal CuratorEventImpl(CuratorFrameworkImpl client,
                           CuratorEventType type,
                           int resultCode,
                           String path,
                           String name,
                           Object context,
                           Stat stat,
                           byte[] data,
                           List <String> children,
                           WatchedEvent watchedEvent,
                           List <ACL> aclList)
 {
     this.type         = type;
     this.resultCode   = resultCode;
     this.path         = client.unfixForNamespace(path);
     this.name         = name;
     this.context      = context;
     this.stat         = stat;
     this.data         = data;
     this.children     = children;
     this.watchedEvent = (watchedEvent != null)
                             ? new NamespaceWatchedEvent(client, watchedEvent)
                             : watchedEvent;
     this.aclList = (aclList != null)
                         ? new ReadOnlyCollectionBuilder <ACL>(aclList).ToReadOnlyCollection()
                         : null;
 }
Beispiel #3
0
 internal NamespaceFacade(CuratorFrameworkImpl client, string @namespace)
     : base(client)
 {
     this.client         = client;
     this.@namespace     = new NamespaceImpl(client, @namespace);
     failedDeleteManager = new FailedDeleteManager(this);
 }
Beispiel #4
0
 internal Backgrounding(CuratorFrameworkImpl client,
                        IBackgroundCallback callback,
                        Object context,
                        IExecutor executor)
     : this(wrapCallback(client, callback, executor), context)
 {
 }
 SetACLBuilderImpl(CuratorFrameworkImpl client)
 {
     this.client   = client;
     backgrounding = new Backgrounding();
     acling        = new ACLing(client.getAclProvider());
     version       = -1;
 }
Beispiel #6
0
 internal CuratorEventImpl(CuratorFrameworkImpl client, 
                     CuratorEventType type, 
                     int resultCode, 
                     String path, 
                     String name, 
                     Object context, 
                     Stat stat, 
                     byte[] data, 
                     List<String> children, 
                     WatchedEvent watchedEvent, 
                     List<ACL> aclList)
 {
     this.type = type;
     this.resultCode = resultCode;
     this.path = client.unfixForNamespace(path);
     this.name = name;
     this.context = context;
     this.stat = stat;
     this.data = data;
     this.children = children;
     this.watchedEvent = (watchedEvent != null)
                             ? new NamespaceWatchedEvent(client, watchedEvent)
                             : watchedEvent;
     this.aclList = (aclList != null)
                         ? new ReadOnlyCollectionBuilder<ACL>(aclList).ToReadOnlyCollection()
                         : null;
 }
Beispiel #7
0
 internal Backgrounding(CuratorFrameworkImpl client, 
                         IBackgroundCallback callback, 
                         Object context, 
                         IExecutor executor)
     : this(wrapCallback(client, callback, executor), context)
 {
 }
Beispiel #8
0
 SetDataBuilderImpl(CuratorFrameworkImpl client)
 {
     this.client   = client;
     backgrounding = new Backgrounding();
     version       = -1;
     compress      = false;
 }
 GetChildrenBuilderImpl(CuratorFrameworkImpl client)
 {
     this.client   = client;
     watching      = new Watching();
     backgrounding = new Backgrounding();
     responseStat  = null;
 }
Beispiel #10
0
 internal FindAndDeleteProtectedNodeInBackground(CuratorFrameworkImpl client,
                                                 String namespaceAdjustedParentPath,
                                                 String protectedId)
 {
     this.client = client;
     this.namespaceAdjustedParentPath = namespaceAdjustedParentPath;
     this.protectedId = protectedId;
 }
Beispiel #11
0
 GetDataBuilderImpl(CuratorFrameworkImpl client)
 {
     this.client   = client;
     responseStat  = null;
     watching      = new Watching();
     backgrounding = new Backgrounding();
     decompress    = false;
 }
Beispiel #12
0
 DeleteBuilderImpl(CuratorFrameworkImpl client)
 {
     this.client              = client;
     version                  = -1;
     backgrounding            = new Backgrounding();
     deletingChildrenIfNeeded = false;
     isGuaranteed             = false;
 }
Beispiel #13
0
 public BackgroundCallback(CuratorFrameworkImpl client,
                           IBackgroundCallback callback,
                           IExecutor service)
 {
     _client   = client;
     _callback = callback;
     _service  = service;
 }
 internal CreateBuilderImpl(CuratorFrameworkImpl client)
 {
     this.client               = client;
     createMode                = CreateMode.PERSISTENT;
     backgrounding             = new Backgrounding();
     acling                    = new ACLing(client.getAclProvider());
     createParentsIfNeeded     = false;
     createParentsAsContainers = false;
     compress                  = false;
     doProtected               = false;
     protectedId               = null;
 }
Beispiel #15
0
        private void openConnectionIfNeeded()
        {
            lock (_openConnectionLock)
            {
                if (client == null)
                {
                    client = (CuratorFrameworkImpl)factory.build(); // cast is safe - we control both sides of this
                    client.start();
                }
                cleanup = ThreadUtils.newSingleThreadScheduledExecutor("CuratorTempFrameworkImpl");

                IRunnable command = RunnableUtils.FromFunc(checkInactive);
                cleanup.scheduleAtFixedRate(command, inactiveThresholdMs, inactiveThresholdMs);
                updateLastAccess();
            }
        }
Beispiel #16
0
        private void closeClient()
        {
            lock (_closeLock)
            {
                if (cleanup != null)
                {
                    cleanup.shutdownNow();
                    cleanup = null;
                }

                if (client != null)
                {
                    CloseableUtils.closeQuietly(client);
                    client = null;
                }
            }
        }
Beispiel #17
0
        internal NamespaceImpl(CuratorFrameworkImpl client, String @namespace)
        {
            if (@namespace != null)
            {
                try
                {
                    PathUtils.validatePath("/" + @namespace);
                }
                catch (ArgumentException)
                {
                    throw new ArgumentException("Invalid namespace: " + @namespace);
                }
            }

            this.client      = client;
            this.@namespace  = @namespace;
            ensurePathNeeded = new AtomicBoolean(@namespace != null);
        }
Beispiel #18
0
 protected CuratorFrameworkImpl(CuratorFrameworkImpl parent)
 {
     client    = parent.client;
     listeners = parent.listeners;
     unhandledErrorListeners = parent.unhandledErrorListeners;
     maxCloseWaitMs          = parent.maxCloseWaitMs;
     backgroundOperations    = parent.backgroundOperations;
     connectionStateManager  = parent.connectionStateManager;
     defaultData             = parent.defaultData;
     failedDeleteManager     = parent.failedDeleteManager;
     compressionProvider     = parent.compressionProvider;
     aclProvider             = parent.aclProvider;
     namespaceFacadeCache    = parent.namespaceFacadeCache;
     @namespace = new NamespaceImpl(this, null);
     state      = parent.state;
     authInfos  = parent.authInfos;
     _useContainerParentsIfAvailable = parent._useContainerParentsIfAvailable;
 }
Beispiel #19
0
        internal NamespaceImpl(CuratorFrameworkImpl client, String @namespace)
        {
            if ( @namespace != null )
            {
                try
                {
                    PathUtils.validatePath("/" + @namespace);
                }
                catch (ArgumentException)
                {
                    throw new ArgumentException("Invalid namespace: " + @namespace);
                }
            }

            this.client = client;
            this.@namespace = @namespace;
            ensurePathNeeded = new AtomicBoolean(@namespace != null);
        }
Beispiel #20
0
 public void Dispose()
 {
     client = null;
     actualWatcher = null;
     curatorWatcher = null;
 }
Beispiel #21
0
 internal NamespaceWatcher(CuratorFrameworkImpl client, CuratorWatcher curatorWatcher)
 {
     this.client = client;
     this.actualWatcher = null;
     this.curatorWatcher = curatorWatcher;
 }
        private void closeClient()
        {
            lock (_closeLock)
            {
                if (cleanup != null)
                {
                    cleanup.shutdownNow();
                    cleanup = null;
                }

                if (client != null)
                {
                    CloseableUtils.closeQuietly(client);
                    client = null;
                }
            }
        }
Beispiel #23
0
 TempGetDataBuilderImpl(CuratorFrameworkImpl client)
 {
     this.client  = client;
     responseStat = null;
     decompress   = false;
 }
 internal NamespaceWatcher(CuratorFrameworkImpl client, CuratorWatcher curatorWatcher)
 {
     this.client         = client;
     this.actualWatcher  = null;
     this.curatorWatcher = curatorWatcher;
 }
 BackgroundSyncImpl(CuratorFrameworkImpl client, Object context)
 {
     this.client  = client;
     this.context = context;
 }
Beispiel #26
0
 public WatchedWatcher(CuratorFrameworkImpl curatorFrameworkImpl)
 {
     _curatorFrameworkImpl = curatorFrameworkImpl;
 }
Beispiel #27
0
 internal NamespaceWatcherMap(CuratorFrameworkImpl client)
 {
     this.client = client;
 }
 protected CuratorFrameworkImpl(CuratorFrameworkImpl parent)
 {
     client = parent.client;
     listeners = parent.listeners;
     unhandledErrorListeners = parent.unhandledErrorListeners;
     maxCloseWaitMs = parent.maxCloseWaitMs;
     backgroundOperations = parent.backgroundOperations;
     connectionStateManager = parent.connectionStateManager;
     defaultData = parent.defaultData;
     failedDeleteManager = parent.failedDeleteManager;
     compressionProvider = parent.compressionProvider;
     aclProvider = parent.aclProvider;
     namespaceFacadeCache = parent.namespaceFacadeCache;
     @namespace = new NamespaceImpl(this, null);
     state = parent.state;
     authInfos = parent.authInfos;
     _useContainerParentsIfAvailable = parent._useContainerParentsIfAvailable;
 }
 internal NamespaceWatchedEvent(CuratorFrameworkImpl client, WatchedEvent @event)
     : base(@event.get_Type(), @event.getState(), client.unfixForNamespace(@event.getPath()))
 {
 }
Beispiel #30
0
 public InternalZookeeperFactory(CuratorFrameworkImpl factory, IZookeeperFactory zookeeperFactory)
 {
     _factory = factory;
     _actualZookeeperFactory = zookeeperFactory;
 }
Beispiel #31
0
 public BackgroundCallback(CuratorFrameworkImpl client, 
                             IBackgroundCallback callback, 
                             IExecutor service)
 {
     _client = client;
     _callback = callback;
     _service = service;
 }
 public void Dispose()
 {
     client         = null;
     actualWatcher  = null;
     curatorWatcher = null;
 }
Beispiel #33
0
        protected void internalSync(CuratorFrameworkImpl impl, String path, Object context)
        {
            IBackgroundOperation <String> operation = new BackgroundSyncImpl(impl, context);

            performBackgroundOperation(new OperationAndData <String>(operation, path, null, null, context));
        }
Beispiel #34
0
 private static IBackgroundCallback wrapCallback(CuratorFrameworkImpl client,
                                                 IBackgroundCallback callback,
                                                 IExecutor executor)
 {
     return(new BackgroundCallback(client, callback, executor));
 }
 TempGetDataBuilderImpl(CuratorFrameworkImpl client)
 {
     this.client = client;
     responseStat = null;
     decompress = false;
 }
 internal NamespaceWatcherMap(CuratorFrameworkImpl client)
 {
     this.client = client;
 }
Beispiel #37
0
 public SyncBuilderImpl(CuratorFrameworkImpl client)
 {
     //To change body of created methods use File | Settings | File Templates.
     this.client = client;
 }
 internal NamespaceFacadeCache(CuratorFrameworkImpl client)
 {
     this.client = client;
     nullNamespace = new NamespaceFacade(client, null);
 }
        private void openConnectionIfNeeded()
        {
            lock (_openConnectionLock)
            {
                if ( client == null )
                {
                    client = (CuratorFrameworkImpl)factory.build(); // cast is safe - we control both sides of this
                    client.start();
                }
                cleanup = ThreadUtils.newSingleThreadScheduledExecutor("CuratorTempFrameworkImpl");

                IRunnable command = RunnableUtils.FromFunc(checkInactive);
                cleanup.scheduleAtFixedRate(command, inactiveThresholdMs, inactiveThresholdMs);
                updateLastAccess();
            }
        }
Beispiel #40
0
 internal CuratorTransactionImpl(CuratorFrameworkImpl client)
 {
     this.client = client;
     transaction = new CuratorMultiTransactionRecord();
 }
Beispiel #41
0
 GetACLBuilderImpl(CuratorFrameworkImpl client)
 {
     this.client   = client;
     backgrounding = new Backgrounding();
     responseStat  = new Stat();
 }
Beispiel #42
0
 Watching(CuratorFrameworkImpl client, CuratorWatcher watcher)
 {
     this.watcher = (watcher != null) ? client.getNamespaceWatcherMap().getNamespaceWatcher(watcher) : null;
     this.watched = false;
 }
 internal NamespaceFacadeCache(CuratorFrameworkImpl client)
 {
     this.client   = client;
     nullNamespace = new NamespaceFacade(client, null);
 }
 internal NamespaceWatchedEvent(CuratorFrameworkImpl client, WatchedEvent @event)
     : base(@event.get_Type(), @event.getState(), client.unfixForNamespace(@event.getPath()))
 {
 }
Beispiel #45
0
 private static IBackgroundCallback wrapCallback(CuratorFrameworkImpl client, 
                                                 IBackgroundCallback callback, 
                                                 IExecutor executor)
 {
     return new BackgroundCallback(client,callback, executor);
 }