Beispiel #1
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 #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
        private CuratorTransactionResult makeCuratorResult(OpResult opResult,
                                                           CuratorMultiTransactionRecord.TypeAndPath metadata)
        {
            String resultPath = null;
            Stat   resultStat = null;

            if (opResult is OpResult.CreateResult)
            {
                OpResult.CreateResult createResult = (OpResult.CreateResult)opResult;
                resultPath = client.unfixForNamespace(createResult.getPath());
            }
            else if (opResult is OpResult.SetDataResult)
            {
                OpResult.SetDataResult setDataResult = (OpResult.SetDataResult)opResult;
                resultStat = setDataResult.getStat();
            }
            return(new CuratorTransactionResult(metadata.type, metadata.forPath, resultPath, resultStat));
        }
Beispiel #4
0
            public override Task process(WatchedEvent watchedEvent)
            {
                string        unfixForNs = _curatorFrameworkImpl.unfixForNamespace(watchedEvent.getPath());
                ICuratorEvent @event     = new CuratorEventImpl(_curatorFrameworkImpl,
                                                                CuratorEventType.WATCHED,
                                                                (int)watchedEvent.getState(),
                                                                unfixForNs,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                watchedEvent,
                                                                null);

                processEvent(@event);
                return(Task.FromResult <object>(null));
            }
        public String forPath(String givenPath, byte[] data)
        {
            if (compress)
            {
                data = client.getCompressionProvider().compress(givenPath, data);
            }

            String adjustedPath = adjustPath(client.fixForNamespace(givenPath, createMode.isSequential()));

            String returnPath = null;

            if (backgrounding.inBackground())
            {
                pathInBackground(adjustedPath, data, givenPath);
            }
            else
            {
                String path = protectedPathInForeground(adjustedPath, data);
                returnPath = client.unfixForNamespace(path);
            }
            return(returnPath);
        }
 internal NamespaceWatchedEvent(CuratorFrameworkImpl client, WatchedEvent @event)
     : base(@event.get_Type(), @event.getState(), client.unfixForNamespace(@event.getPath()))
 {
 }
 internal NamespaceWatchedEvent(CuratorFrameworkImpl client, WatchedEvent @event)
     : base(@event.get_Type(), @event.getState(), client.unfixForNamespace(@event.getPath()))
 {
 }