/**
   * It setups the rewrite rules in Virtuoso for dereferencing the dataset URI-s.
   *
   * @param jobConf the {@link eu.aliada.linkeddataserversetup.model.JobConfiguration} that contains
   *     information to setup the rewrite rules in Virtuoso
   * @param db The DDBB connection.
   * @return the {@link eu.aliada.linkedDataServerSetup.model.job} created.
   * @since 1.0
   */
  public Job setup(final JobConfiguration jobConf, final DBConnectionManager dbConn) {
    LOGGER.debug(MessageCatalog._00030_STARTING);
    // Update job start-date in DDBB
    dbConn.updateJobStartDate(jobConf.getId());
    // URLEncode and prepare some command parameters for Virtuoso Rewrite Rules
    LOGGER.debug(MessageCatalog._00037_ENCODE_PARAMS);
    final boolean encoded = encodeParams(jobConf);
    if (encoded) {
      // Execute global ISQL commands file for rewriting rules in Virtuoso
      final boolean success = executeGlobalIsqlCommands(jobConf);
      if (success) {
        // Get subset ISQL commands file for rewriting rules in Virtuoso and execute them
        for (final Iterator<Subset> iterSubsets = jobConf.getSubsets().iterator();
            iterSubsets.hasNext(); ) {
          final Subset subset = iterSubsets.next();
          executeSubsetIsqlCommands(jobConf, subset);
        }
      }
      // Create Dataset default HTML page
      createDatasetDefaultPage(jobConf, dbConn);
    } else {
      LOGGER.error(MessageCatalog._00039_INPUT_PARAMS_ERROR, jobConf.getId());
    }

    // Update job end_date of DDBB
    LOGGER.debug(MessageCatalog._00057_UPDATING_JOB_DDBB, jobConf.getId());
    dbConn.updateJobEndDate(jobConf.getId());
    final Job job = dbConn.getJob(jobConf.getId());
    LOGGER.debug(MessageCatalog._00041_STOPPED);
    return job;
  }