static public ResourceState replicatorStateToResourceState(String state){
  if (state.startsWith(REPLICATOR_STATE_ONLINE))   return ResourceState.ONLINE;
 else   if (state.startsWith(REPLICATOR_STATE_STOPPED)) {
    return ResourceState.STOPPED;
  }
 else   if (state.startsWith(REPLICATOR_STATE_OFFLINE)) {
    if (state.equals(REPLICATOR_STATE_ERROR)) {
      return ResourceState.SUSPECT;
    }
 else     if (state.equals(REPLICATOR_STATE_BACKUP)) {
      return ResourceState.BACKUP;
    }
 else     if (state.equals(REPLICATOR_STATE_RESTORING)) {
      return ResourceState.RESTORING;
    }
 else {
      return ResourceState.OFFLINE;
    }
  }
 else   if (state.contains(REPLICATOR_STATE_SYNCHRONIZING))   return ResourceState.SYNCHRONIZING;
 else   return ResourceState.UNKNOWN;
}

static public ResourceState replicatorStateToResourceState ( String state ) { if ( state . startsWith ( REPLICATOR_STATE_ONLINE ) ) return ResourceState . ONLINE ; else if ( state . startsWith ( REPLICATOR_STATE_STOPPED ) ) { return ResourceState . STOPPED ; } else if ( state . startsWith ( REPLICATOR_STATE_OFFLINE ) ) { if ( state . equals ( REPLICATOR_STATE_ERROR ) ) { return ResourceState . SUSPECT ; } else if ( state . equals ( REPLICATOR_STATE_BACKUP ) ) { return ResourceState . BACKUP ; } else if ( state . equals ( REPLICATOR_STATE_RESTORING ) ) { return ResourceState . RESTORING ; } else { return ResourceState . OFFLINE ; } } else if ( state . contains ( REPLICATOR_STATE_SYNCHRONIZING ) ) return ResourceState . SYNCHRONIZING ; else return ResourceState . UNKNOWN ; }
parses the given state provided by the replicator and guess a generic resourcestate from it
