@Override public String toString() { return "server=" + getThisServer() + "; configDir=" + getConfigDir() + "; dataDir=" + getDataDir() ; } }
public String getProperty(String name, String defaultValue) { String value=getProperty(name); if (value == null) return defaultValue; else return value; }
/** * @return A {@link Map} of the exclusion patterns where key=the pattern * and value=a {@link Boolean} indicating if this is <U>global</U> pattern */ public Map<String,Boolean> getDesiredTraceFilterExclusions () { // we synchronize on local exclusions since the global exclusions never change synchronized(localExclusions) { return InsightConfig.getTraceFilterExclusions(globalExclusions, localExclusions); } }
public ThisServerResource getObject() throws Exception { ServerName serverName = getServerName(); ResourceKey key = serverName.makeKey(); ResourcePropertiesResolver propsResolver = new SysInfoPropertiesResolver(key); ResourceProperties props = propsResolver.getProperties(); ServerResource server = new ServerResource(key, getLabel(props)); return new ThisServerResource(server, propsResolver); }
@Override public String toString() { return getVersionString() + "@" + getBuildTimestampString(); }
@Override protected InsightConfig buildBeanFromProperties(Properties props) { InsightConfig config = new InsightConfig(props); for (String path : config.getExcludeTraceByPath()) { log.info("excluding path: " + path); } ServerName serverName=getServerName(); config.setThisServer(new ServerResource(serverName.makeKey(), serverName.getName())); return config; }
@Override public ThisServerResource getObject() throws Exception { ServerResource server = config.getThisServer(); return new ThisServerResource(server, new ResourceProperties(server.getKey())); }
public InsightVersion getBuildInfo () { synchronized(configLock) { if (buildInfo == null) { try { buildInfo = new InsightVersion(getClass()); } catch(Exception e) { buildInfo = InsightVersion.PLACEHOLDER; } } return buildInfo; } } public InsightVersion getInsightVersion () {
void connectLicenseManager() throws LicenseException { licenseManager = LicenseManagerFactory.getLicenseManager(COMPONENT_ID_INSIGHT, version.getVersionString(), (String[]) null, licenseStateDir); }
@Override public String toString() { return getServer() + ": " + getProperties(); } }
public InsightVersion (Manifest man) { this(resolveVersion(man), resolveTimestamp(man)); }
public static InsightConfig getInsightConfig() { InsightConfig config = new InsightConfig(); config.setExcludeTraceByPath(Arrays.asList("path1", "path2")); return config; }
@Override public ServerName getServerName() { return config.getThisServer().getServerName(); }
/** * @param props The {@link Properties} to use for loading the exclusion filters * @return A <U>"flipped"</U> {@link Map} of the exclusion filters * where key=the filter value, value=the key that was used to specify the * exclusion pattern. <B>Note:</B> We use a flipped version since we may * want to manipulate the original properties file - so we need to know * for each pattern which property name was used to hold it * @see #loadExclusionFilters(NamedPropertySource) */ public static final Map<String,String> loadExclusionFilters (Properties props) { return loadExclusionFilters(PropertiesUtil.toPropertySource(props)); }
public ThisServerResource(ServerResource myResource, ResourceProperties resProps) { this(myResource, new StaticResourcePropertiesResolver(resProps)); }
public ResourceProperties getProperties() { return props.getProperties(); }
public InsightConfig (NamedPropertySource props) { InsightConfig result=fromProperties(this, props); if (result != this) { throw new IllegalStateException("Mismatched initialized instances"); } } /**
/** * Create a new filter list based on the trace repo configuration. */ public TraceFilterList createFromRepoConfig(InsightConfig config) { return createFromList(config.getExcludeTraceByPath()); }
@SuppressWarnings("synthetic-access") public ResourceProperties getProperties() { SystemInformation sysInfo = getSysInfo(); return propFactory.createPropertiesForThisServer(key, sysInfo); } }
@Override public int hashCode() { return ObjectUtil.hashCode(getVersionString()) + ObjectUtil.hashCode(getBuildTimestampString()) ; }