All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alachisoft.ncache.client.CacheConnection Maven / Gradle / Ivy

package com.alachisoft.ncache.client;

/**
 * Instance of this class can be used to define the parameters to establish connection with cache.
 */
public class CacheConnection implements Cloneable {
    private String server;
    private int port;
    private Credentials userCredentials;

    /**
     * Initializes new instance of CacheConnection.
     * @param server Specifies the name of server on which cache is running.
     * @param port Specifies the port of server on which cache is running.
     */
    public CacheConnection(String server, int port) {
        setServer(server);
        setPort(port);
    }

    /**
     * Initializes new instance of CacheConnection.
     * @param server Specifies the name of server on which cache is running.
     */
    public CacheConnection(String server) {
        setServer(server);
        setPort(8250);
    }

    /**
     * Gets the name of server on which cache is running.
     * @return The name of server on which cache is running.
     */
    public String getServer() {
        return server;
    }

    /**
     * Sets the name of server on which cache is running.
     * @param value The name of server on which cache is running.
     */
    private void setServer(String value) {
        server = value;
    }

    /**
     * Gets the port of server on which cache is running.
     * @return The port of server on which cache is running.
     */
    public int getPort() {
        return port;
    }

    /**
     * Sets the port of server on which cache is running.
     * @param value The port of server on which cache is running.
     */
    private void setPort(int value) {
        port = value;
    }

    /**
     * Gets {@link Credentials} of the cache for authorization.
     * @return The credentials of the cache for authorization.
     */
    public Credentials getUserCredentials() {
        return userCredentials;
    }

    /**
     * Sets {@link Credentials} of the cache for authorization.
     * @param value The credentials of the cache for authorization.
     */
    public void setUserCredentials(Credentials value) {
        userCredentials = value;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy