public RavenCountersClient(string serverUrl, string counterStorageName, ICredentials credentials = null, string apiKey = null)
        {
            try
            {
                ServerUrl = serverUrl;
                if (ServerUrl.EndsWith("/"))
                    ServerUrl = ServerUrl.Substring(0, ServerUrl.Length - 1);

				CounterStorageName = counterStorageName;
                Credentials = credentials ?? CredentialCache.DefaultNetworkCredentials;
                ApiKey = apiKey;

				convention = new CounterConvention();
                //replicationInformer = new RavenFileSystemReplicationInformer(convention, JsonRequestFactory);
                //readStripingBase = replicationInformer.GetReadStripingBase();
	            //todo: implement remote counter changes
                //notifications = new RemoteFileSystemChanges(serverUrl, apiKey, credentials, jsonRequestFactory, convention, replicationInformer, () => { });
                               
                InitializeSecurity();
            }
            catch (Exception)
            {
                Dispose();
                throw;
            }
        }
			public AdminClient(RavenCountersClient countersClient, CounterConvention convention)
            {
				credentials = countersClient.PrimaryCredentials;
				jsonRequestFactory = countersClient.JsonRequestFactory;
				serverUrl = countersClient.ServerUrl;
				counterStorageName = countersClient.CounterStorageName;
				this.convention = convention;
            }
			    public CounterBatch(RavenCountersClient countersClient, CounterConvention convention)
			    {
				    credentials = countersClient.PrimaryCredentials;
				    jsonRequestFactory = countersClient.JsonRequestFactory;
					counterStorageUrl = countersClient.CounterStorageUrl;
				    this.convention = convention;
			    }