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

org.jsmpp.extra.SessionState Maven / Gradle / Ivy

There is a newer version: 15.0.0.1
Show newest version
package org.jsmpp.extra;

/**
 * Enum constant represent session state.
 * 
 * @author uudashr
 * @version 1.0
 * @since 1.0
 * 
 */
public enum SessionState {

    /**
     * Open, means connection has established but not bounded.
     */
    OPEN,

    /**
     * Bound transmitter, means bound transmit has been initiated.
     */
    BOUND_TX,

    /**
     * Bound receiver, means bound receive has been initiated.
     */
    BOUND_RX,

    /**
     * Bound transceiver, means bound transceive has been initiated.
     */
    BOUND_TRX,

    /**
     * Unbound, means unbound has been initiated but the connection hasn't been
     * closed.
     */
    UNBOUND,

    /**
     * There is no connection at all.
     */
    CLOSED,

    /**
     * Outbound, means the session is in outbound state, ready to initiate
     * bound.
     */
    OUTBOUND;

    /**
     * Check whether the session state is bound.
     * 
     * @return true if session state is bound state
     */
    public boolean isBound() {
        return equals(BOUND_RX) || equals(BOUND_TX) || equals(BOUND_TRX);
    }

    /**
     * Check whether the session state is transmittable.
     * 
     * @return true if session is transmittable.
     */
    public boolean isTransmittable() {
        return equals(BOUND_TX) || equals(BOUND_TRX);
    }

    /**
     * Check whether the session state is receivable.
     * 
     * @return true if session is receivable.
     */
    public boolean isReceivable() {
        return equals(BOUND_RX) || equals(BOUND_TRX);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy