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(false),

    /**
     * Bound transmitter, means bound transmit has been initiated.
     */
    BOUND_TX(true, true, false),

    /**
     * Bound receiver, means bound receive has been initiated.
     */
    BOUND_RX(true, false, true),

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

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

    /**
     * There is no connection at all.
     */
    CLOSED(false),

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

    private boolean bound;
    private boolean transmitable;
    private boolean receiveable;

    private SessionState(boolean bound, boolean transmitable,
            boolean receiveable) {
        this.bound = bound;
        this.transmitable = transmitable;
        this.receiveable = receiveable;
    }

    private SessionState(boolean bound) {
        this(bound, false, false);
    }

    /**
     * Check whether the session state is bound or not.
     * 
     * @return <tt>true</tt> if session state is bound state
     */
    public boolean isBound() {
        return bound;
    }

    /**
     * Check whether the session state is transmittable.
     * 
     * @return <tt>true</tt> if session is transmittable.
     */
    public boolean isTransmittable() {
        return transmitable;
    }

    /**
     * Check whether the session state is receivable.
     * 
     * @return <tt>true</tt> if session is receivable.
     */
    public boolean isReceivable() {
        return receiveable;
    }
}

@@ -241,23 +241,16 @@
     OPEN
-(false)
 ,%0A%0A    /
@@ -343,27 +343,8 @@
 D_TX
-(true, true, false)
 ,%0A%0A 
@@ -437,27 +437,8 @@
 D_RX
-(true, false, true)
 ,%0A%0A 
@@ -538,26 +538,8 @@
 _TRX
-(true, true, true)
 ,%0A%0A 
@@ -659,23 +659,16 @@
  UNBOUND
-(false)
 ,%0A%0A    /
@@ -726,23 +726,16 @@
   CLOSED
-(false)
 ,%0A%0A    /
@@ -850,409 +850,9 @@
 OUND
-(false);%0A%0A    private boolean bound;%0A    private boolean transmitable;%0A    private boolean receiveable;%0A%0A    private SessionState(boolean bound, boolean transmitable,%0A            boolean receiveable) %7B%0A        this.bound = bound;%0A        this.transmitable = transmitable;%0A        this.receiveable = receiveable;%0A    %7D%0A%0A    private SessionState(boolean bound) %7B%0A        this(bound, false, false);%0A    %7D
+;
 %0A%0A  
@@ -908,15 +908,8 @@
 ound
- or not
 .%0A  
@@ -1029,21 +1029,73 @@
  return 
-bound
+equals(BOUND_RX) %7C%7C equals(BOUND_TX) %7C%7C equals(BOUND_TRX)
 ;%0A    %7D%0A
@@ -1292,20 +1292,45 @@
 urn 
-transmitable
+equals(BOUND_TX) %7C%7C equals(BOUND_TRX)
 ;%0A  
@@ -1522,19 +1522,45 @@
 urn 
-receiveable
+equals(BOUND_RX) %7C%7C equals(BOUND_TRX)
 ;%0A  

Change the logic of SessionState enum