• Webinars
  • Docs
  • Download
  • Blogs
  • Contact Us
Try Free
Show / Hide Table of Contents

Client Side API Prerequisites

In order to practically utilize the powerful features of Client Side NCache, make sure to implement the prerequisites discussed below.

Prerequisites

  • .NET/.NET Core
  • Java
  • Scala
  • Node.js
  • Python
  • Install either of the following NuGet packages in your application based on your NCache edition:
    • Enterprise: Alachisoft.NCache.SDK
    • Professional: Alachisoft.NCache.Professional.SDK
  • Include the following namespaces in your application:
    • Alachisoft.NCache.Client
    • Alachisoft.NCache.Runtime
    • Alachisoft.NCache.Runtime.Exceptions
  • The cache must be running.
  • Make sure that the data being added is serializable.
  • To ensure the operation is fail-safe, it is recommended to handle any potential exceptions within your application, as explained in Handling Failures.
  • To handle any unseen exceptions, refer to the Troubleshooting section.
  • Add the following Maven dependencies in your pom.xml file:
<dependency>
    <groupId>com.alachisoft.ncache</groupId>
    <!--for NCache Enterprise Edition-->
    <artifactId>ncache-client</artifactId>
    <!--for NCache Professional Edition-->
    <artifactId>ncache-professional-client</artifactId>
    <version>x.x.x</version>
</dependency>
  • Import the following packages in your application:
    • import com.alachisoft.ncache.client.*;
    • import com.alachisoft.ncache.runtime.*;
    • import com.alachisoft.ncache.runtime.exceptions.*;
  • The cache must be running.
  • Make sure that the data being added is serializable.
  • To ensure the operation is fail-safe, it is recommended to handle any potential exceptions within your application, as explained in Handling Failures.
  • To handle any unseen exceptions, refer to the Troubleshooting section.
  • Add the following Maven dependencies in your pom.xml file:
<dependency>
    <groupId>com.alachisoft.ncache</groupId>
    <!--for NCache Enterprise Edition-->
    <artifactId>ncache-scala-client</artifactId>
    <!--for NCache Professional Edition-->
    <artifactId>ncache-scala-professional-client</artifactId>
    <version>x.x.x</version>
</dependency>
  • Import the following packages in your application:
    • import com.alachisoft.ncache.scala.client.*;
    • import com.alachisoft.ncache.scala.runtime.*;
  • The cache must be running.
  • Make sure that the data being added is serializable.
  • To ensure the operation is fail safe, it is recommended to handle any potential exceptions within your application, as explained in Handling Failures.
  • To handle any unseen exceptions, refer to the Troubleshooting section.
  • Install and include either of the following modules in your application based on your NCache edition:
    • Enterprise: ncache-client
    • Professional: ncache-professional-client
  • Include the following class in your application:
    • Cache
  • The cache must be running.
  • The application must be connected to cache before performing the operation.
  • For API details refer to the links provided with every code snippet.
  • To ensure the operation is fail-safe, it is recommended to handle any potential exceptions within your application, as explained in Handling Failures.
  • To handle any unseen exceptions, refer to the Troubleshooting section.
  • Install either of the following Python packages in your application based on your NCache edition:
    • Enterprise: ncache-client
    • Professional: ncache-professional-client
  • Import the following packages in your application:
    • from ncache.client import *
    • from ncache.runtime import *
  • The cache must be running.
  • To ensure the operation is fail safe, it is recommended to handle any potential exceptions within your application, as explained in Handling Failures.
  • To handle any unseen exceptions, refer to the Troubleshooting section.

Feature Specific NuGet Packages

Aside from the NuGet Packages employed in most features, you should add the following packages based on the feature you intend to use.

Note

Any feature not mentioned in the list below either does not work with the specified feature or only requires the general NuGet Packages that we've previously discussed.

  • For CLR Procedures:
    • Enterprise: CLRStoredProcedure.NCache
  • For LINQ Queries:
    • Enterprise: Linq.NCache
  • For Full Text Searching with NCache Distributed Lucene:
    • Enterprise: Lucene.Net.NCache
    • Professional: Lucene.Net.NCache.Professional

Feature Specific Namespaces

Aside from the namespaces employed in most features, you should add the following namespaces/packages/classes based on the feature/API you intend to use and whether or not they require them.

Note

Any feature not mentioned in the list below either does not work with the specified feature or only requires the general namespaces/packages/classes.

  • .NET/.NET Core
  • Java
  • Scala
  • Node.js
  • Python
  • For Tags, Named Tags, Locking, and Expirations:
    • Alachisoft.NCache.Runtime.Caching
  • For Cache Data Dependencies e.g. KeyDependency, FileDependency & Database Dependencies:
    • Alachisoft.NCache.Runtime.Dependencies
  • For JSON Data:
    • Alachisoft.NCache.Runtime.JSON
  • For Data Structures:
    • Alachisoft.NCache.Client.DataTypes
    • Alachisoft.NCache.Client.DataTypes.Collections
    • Alachisoft.NCache.Client.DataTypes.Counter
    • Alachisoft.NCache.Runtime.Caching
    • Alachisoft.NCache.Runtime.Events
  • For SQL Queries:
    • Alachisoft.NCache.Client.Services
    • Alachisoft.NCache.Runtime.Caching
  • For LINQ Queries:
    • Alachisoft.NCache.Linq
  • For Event Notifications & Continuous Query:
    • Alachisoft.NCache.Runtime.Events
  • For Pub/Sub:
    • Alachisoft.NCache.Runtime.Caching
  • For Full Text Searching with NCache Distributed Lucene:
    • For Lucene Search:
      • Lucene.Net.Analysis
      • Lucene.Net.Analysis.Standard
      • Lucene.Net.Documents
      • Lucene.Net.Index
      • Lucene.Net.QueryParsers.Classic
      • Lucene.Net.Search
      • Lucene.Net.Store
      • Lucene.Net.Util
    • For Lucene Facet:
      • Lucene.Net.Facet
      • Lucene.Net.Facet.Range
      • Lucene.Net.Facet.SortedSet
      • Lucene.Net.Facet.Taxonomy
      • Lucene.Net.Facet.Taxonomy.Directory
    • For Geo-Spatial API
      • DistributedLucene.Net.Spatial
      • Lucene.Net.Spatial
      • Lucene.Net.Spatial.Prefix
      • Lucene.Net.Spatial.Prefix.Tree
      • Lucene.Net.Spatial.Queries
      • Spatial4n.Core.Context
      • Spatial4n.Core.Distance
      • Spatial4n.Core.Shapes
  • For Tags, Named Tags, Locking, and Expirations:
    • import com.alachisoft.ncache.runtime.caching.*;
    • import com.alachisoft.ncache.runtime.caching.NamedTagsDictionary.*;
  • For Cache Data Dependencies e.g. KeyDependency, FileDependency & Database Dependencies:
    • import com.alachisoft.ncache.runtime.dependencies.*;
  • For JSON Data:
    • import com.alachisoft.ncache.runtime.json.*;
  • For SQL Queries:
    • import com.alachisoft.ncache.runtime.caching.*;
  • For Event Notifications & Continuous Query:
    • import com.alachisoft.ncache.events.*;
  • For Data Structures:

    • import com.alachisoft.ncache.client.datastructures.*;
    • import com.alachisoft.ncache.events.*;
    • import com.alachisoft.ncache.runtime.dependencies.*;
  • For Pub/Sub:

    • import com.alachisoft.ncache.runtime.caching.*;
  • For Tags, Named Tags, Locking, and Expirations:
    • import com.alachisoft.ncache.scala.runtime.caching.*;
  • For Cache Data Dependencies e.g. KeyDependency, FileDependency & Database Dependencies:
    • import com.alachisoft.ncache.scala.runtime.dependencies.*;
  • For JSON Data:
    • import com.alachisoft.ncache.scala.runtime.JSON.*;
  • For SQL Queries:
    • import com.alachisoft.ncache.scala.runtime.caching.*;
  • For Data Structures:
    • import com.alachisoft.ncache.scala.client.datastructures.*;
  • For Event Notifications & Continuous Query:
    • import com.alachisoft.ncache.scala.runtime.events.*;
  • For Pub/Sub:
    • import com.alachisoft.ncache.scala.runtime.caching.*;
  • For Tags & Named Tags, and Expirations:
    • Tag
    • NamedTagsDictionary
    • Expiration
  • For Cache Data Dependencies e.g. KeyDependency, FileDependency & Database Dependencies:
    • KeyDependency
    • SqlCacheDependency
    • OracleCacheDependency
    • FileDependency
  • For Data Structures:
    • Counter
    • DataStructureManager
    • DistributedList
    • DistributedQueue
  • For Event Notifications & Continuous Query:
    • EventCacheItem
    • ContinuousQuery
  • For Pub/Sub:
    • Topic
    • TopicSubscription
  • For Tags, Named Tags, Locking, Expirations:
    • from ncache.runtime.caching import *
  • For Cache Data Dependencies e.g. KeyDependency, FileDependency & Database Dependencies:
    • from ncache.runtime.dependencies import *
  • For SQL Queries:
    • from ncache.client.services import *
    • from ncache.runtime.caching import *
  • For Data Structures:
    • from ncache.client.datastructures import *
    • from ncache.client.datastructures.DistributedDictionary import *
    • from ncache.client.datastructures.DistributedHashSet import *
    • from ncache.client.datastructures.DistributedList import *
    • from ncache.client.datastructures.DistributedQueue import *
    • from ncache.runtime.caching import *
    • from ncache.runtime.dependencies import *
    • from ncache.runtime.caching.events import *
  • For Pub/Sub:
    • from ncache.runtime.caching import *
    • from ncache.client.services import *

See Also

How to Connect to Cache
Error Handling in Cache
Troubleshooting

Back to top Copyright © 2017 Alachisoft