Github user cammckenzie commented on a diff in the pull request:

    https://github.com/apache/curator/pull/9#discussion_r13368056
  
    --- Diff: 
curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionState.java
 ---
    @@ -57,5 +57,15 @@
          * <a 
href="http://wiki.apache.org/hadoop/ZooKeeper/GSoCReadOnlyMode";>http://wiki.apache.org/hadoop/ZooKeeper/GSoCReadOnlyMode</a>.
          * The connection will remain in read only mode until another state 
change is sent.
          */
    -    READ_ONLY
    +    READ_ONLY;
    +    
    +    /**
    +     * Check if this state indicates that Curator has a connection to 
ZooKeeper
    +     * 
    +     * @return True if connected, false otherwise
    +     */
    +    public boolean isConnected()
    +    {
    +        return this == CONNECTED || this == RECONNECTED || this == 
READ_ONLY;
    --- End diff --
    
    I have updated the connection state to have an abstract isConnected()
    method and added this to the pull request.
    cheers
    
    
    On Wed, Jun 4, 2014 at 9:37 AM, Jordan Zimmerman <[email protected]>
    wrote:
    
    > In
    > 
curator-framework/src/main/java/org/apache/curator/framework/state/ConnectionState.java:
    >
    > > @@ -57,5 +57,15 @@
    > >       * <a 
href="http://wiki.apache.org/hadoop/ZooKeeper/GSoCReadOnlyMode";>http://wiki.apache.org/hadoop/ZooKeeper/GSoCReadOnlyMode</a>.
    > >       * The connection will remain in read only mode until another 
state change is sent.
    > >       */
    > > -    READ_ONLY
    > > +    READ_ONLY;
    > > +
    > > +    /**
    > > +     * Check if this state indicates that Curator has a connection to 
ZooKeeper
    > > +     *
    > > +     * @return True if connected, false otherwise
    > > +     */
    > > +    public boolean isConnected()
    > > +    {
    > > +        return this == CONNECTED || this == RECONNECTED || this == 
READ_ONLY;
    >
    > Actually, i think you're right. isLost() isn't necessary as it's implied
    > as the opposite if isConnected().
    >
    > —
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/curator/pull/9/files#r13365204>.
    >


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to