Пример #1
0
 /**
  * Return gateway property key perf.monitor.expected.errors value
  *
  * @return String gateway property value
  */
 private static boolean isAllowSSNQuery() {
   boolean result = false;
   try {
     // Use CONNECT utility class to access gateway.properties
     String allowString =
         PropertyAccessor.getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, ALLOW_SSN_QUERY);
     if (allowString != null && allowString.equalsIgnoreCase("true")) {
       result = true;
     }
   } catch (PropertyAccessException pae) {
     log.error(
         "Error: Failed to retrieve "
             + ALLOW_SSN_QUERY
             + " from property file: "
             + NhincConstants.GATEWAY_PROPERTY_FILE);
     log.error(pae.getMessage());
   } catch (NumberFormatException nfe) {
     log.error(
         "Error: Failed to convert "
             + ALLOW_SSN_QUERY
             + " from property file: "
             + NhincConstants.GATEWAY_PROPERTY_FILE);
     log.error(nfe.getMessage());
   }
   return result;
 }
 @Override
 public final String getDefaultFileDestination() {
   String defaultFileLoc = null;
   try {
     defaultFileLoc =
         PropertyAccessor.getProperty(
             NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.LIFT_FILEDROP);
   } catch (PropertyAccessException ex) {
     log.error(ex.getMessage());
   }
   return defaultFileLoc;
 }
  /**
   * Determine if audit is enabled for the NwHIN interface
   *
   * @return Flag to indicate if audit logging is enabled for this interface
   */
  protected boolean isAuditEnabled(String propertyFile, String propertyName) {
    boolean isEnabled = false;
    try {
      isEnabled = PropertyAccessor.getInstance().getPropertyBoolean(propertyFile, propertyName);
    } catch (PropertyAccessException e) {
      LOG.error(
          "Error: Failed to retrieve " + propertyName + " from property file: " + propertyFile);
      LOG.error(e.getMessage(), e);
    }

    return isEnabled;
  }