public synchronized boolean isConnectionOk(String portName){
  String stateText=getConnectionState(portName);
  if (stateText.equals(CONNECTION_DOWN)) {
    return false;
  }
 else {
    return true;
  }
}

public synchronized boolean isConnectionOk ( String portName ) { String stateText = getConnectionState ( portName ) ; if ( stateText . equals ( CONNECTION_DOWN ) ) { return false ; } else { return true ; } }
returns status of a communication port
