Exemplo n.º 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;
 }
  /**
   * 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;
  }
 @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;
 }
 private int getTimeoutFromConfig() {
   int timeout = 0;
   try {
     String sValue = PropertyAccessor.getInstance().getProperty(CONFIG_KEY_TIMEOUT);
     if (NullChecker.isNotNullish(sValue)) {
       timeout = Integer.parseInt(sValue);
     }
   } catch (PropertyAccessException ex) {
     LOG.warn(
         "Error occurred reading property value from config file ("
             + CONFIG_KEY_TIMEOUT
             + ").  Exception: "
             + ex.toString());
   } catch (NumberFormatException nfe) {
     LOG.warn(
         "Error occurred converting property value: "
             + CONFIG_KEY_TIMEOUT
             + ".  Exception: "
             + nfe.toString());
   }
   return timeout;
 }