code: public int getState()
     {
        if (isOffline)
        {
           return OFFLINE;
        }
        
        Integer state = null;
        for (String workspaceName : getWorkspaceNames())
        {
           int workspaceState = getWorkspaceContainer(workspaceName).getState();
           if (state == null)
           {
              state = workspaceState;
           }
           else if (state != workspaceState)
           {
              return UNDEFINED;
           }
        }
        
        return state == null ? ONLINE : state;
     }
docs: {@inheritDoc}