public TypedProperties copy() { return new TypedProperties(this); }
public static ISecurityService create(SecurityServiceType serviceType, TypedProperties properties) { try { if (properties == null) { properties = new TypedProperties(System.getProperties()); } String className = properties.get(SecurityConstants.CLASS_NAME_SECURITY_SERVICE, serviceType == SecurityServiceType.SERVER ? "org.jumpmind.security.BouncyCastleSecurityService" : SecurityService.class.getName()); ISecurityService securityService = (ISecurityService) Class.forName(className).newInstance(); securityService.init(); return securityService; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
protected TypedProperties rereadDatabaseParameters(String externalId, String nodeGroupId) { final TypedProperties properties = new TypedProperties(); sqlTemplate.query(sql.getSql("selectParametersSql"), new ISqlRowMapper<Object>() { public Object mapRow(Row row) { String value = row.getString("param_value"); if (value != null) { properties.setProperty(row.getString("param_key"), row.getString("param_value")); } return row; } }, externalId, nodeGroupId); return properties; }
protected TypedProperties rereadDatabaseParameters(Properties p) { if (databaseHasBeenInitialized) { TypedProperties properties = rereadDatabaseParameters(ParameterConstants.ALL, ParameterConstants.ALL); properties.putAll(rereadDatabaseParameters(ParameterConstants.ALL, p.getProperty(ParameterConstants.NODE_GROUP_ID))); properties.putAll(rereadDatabaseParameters( p.getProperty(ParameterConstants.EXTERNAL_ID), p.getProperty(ParameterConstants.NODE_GROUP_ID))); databaseHasBeenInitialized = true; return properties; } else { return new TypedProperties(); } }