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

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

There is a newer version: 5.3.0
Show newest version

/*
 * @(#)ClusterEvent.java
 *
 * Created on September 14, 2006, 11:53 AM
 *
 * Copyright 2005 Alachisoft, Inc. All rights reserved.
 * ALACHISOFT PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.alachisoft.ncache.client;

//~--- JDK imports ------------------------------------------------------------

import java.util.EventObject;

//~--- classes ----------------------------------------------------------------

/**
 * ClusterEvent is used to notify interested parties that
 * something has happened with respect to the cluster.
 *
 * @author Arif Iftikhar
 * @version 0.1
 */
public class ClusterEvent extends EventObject {

    //~--- fields -------------------------------------------------------------

    //~--- constructors -------------------------------------------------------

    private CacheStatusNotificationType type;
    private String ip;
    private int port;
    private String cacheId;

    /**
     * Creates a new object representing a cluster event.
     *
     * @param source the object responsible for the event
     * @param type   the event type
     * @param ip     the ip of the memeber.
     * @param port   the port of the memeber.
     */
    public ClusterEvent(Object source, CacheStatusNotificationType type, String ip, int port, String cacheId) {
        super(source);
        this.type = type;
        this.cacheId = cacheId;
        this.ip = ip;
        this.port = port;
    }

    /**
     * Creates a new object representing a cluster event.
     *
     * @param type    The type of cluster event.
     * @param source  the object responsible for the event
     * @param cacheId the cache-id of the stopped cache.
     */
    public ClusterEvent(Object source, CacheStatusNotificationType type, String cacheId) {
        super(source);
        this.type=type;
        this.cacheId = cacheId;
    }

    /**
     * Gets the type of event.
     *
     * @return the type
     */
    public CacheStatusNotificationType getEventType() {
        return type;
    }

    /**
     * Returns the NCache Socket Server port.
     *
     * @return Returns the NCache Socket Server port.
     */
    public long getPort() {
        return port;
    }

    /**
     * Returns IP of the member node.
     *
     * @return Returns IP of the member node.
     */
    public String getIp() {
        return ip;
    }

    /**
     * Returns cache-id of the stopped cache.
     *
     * @return Returns cache-id of the stopped cache.
     */
    public String getCacheId() {
        return cacheId;
    }

    /**
     * Defines the JOINED and LEFT event types, along
     * with their string representations, returned by toString().
     */


}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy