public ApplicationName getApplication() { if (StringUtil.isEmpty(appName)) return null; return ApplicationName.valueOf(appName); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; EndPointMemberAssocCacheKey other = (EndPointMemberAssocCacheKey) obj; return app.equals(other.app); } }
public static final CollectionSettingName getApplicationCollectionSettingName(ApplicationName appName) { return new CollectionSettingName(TYPE_NAME + "." + appName.getName(), GROUP_NAME); }
public ApplicationResource(ApplicationName name, String label) { super(name.makeKey(), label); this.applicationName = name; }
@Override public int hashCode() { return app.hashCode(); }
public ApplicationResource(ResourceKey key, String label) { super(key, label); this.applicationName = ApplicationName.fromResourceKey(key); }
public ApplicationEndPointResource(ApplicationName appName, EndPointName endPoint, String label, TraceSource source) { super(makeKey(appName, endPoint, source), label); this.applicationKey = appName.makeKey(); this.applicationName = appName; this.endPointName = endPoint; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((requiredServer == null) ? 0 : requiredServer.hashCode()); result = prime * result + ((requiredApp == null) ? 0 : requiredApp.hashCode()); result = prime * result + ((requiredEndPoint == null) ? 0 : requiredEndPoint.hashCode()); result = prime * result + ((requireExtResource == null) ? 0 : requireExtResource.hashCode()); result = prime * result + ((requiredType == null) ? 0 : requiredType.hashCode()); return result; }
public static ApplicationName applicationName(String host, String context) { StringBuilder id = new StringBuilder(); id.append(sanitize(host)).append(SEPARATOR); id.append(sanitize(context)); return ApplicationName.valueOf(id.toString()); }
public List<PersistedTraceSummary> findSummariesSortedByRangeLength(ApplicationName app, TimeRange range, int maxResults) { return entityManager.createNamedQuery(QUERY_SUMMARIES_BY_APP_AND_RANGE_LENGTH, PersistedTraceSummary.class) .setParameter("start", Long.valueOf(range.getStart())) .setParameter("end", Long.valueOf(range.getEnd())) .setParameter("app", app.getName()) .setMaxResults(maxResults) .getResultList(); }
public boolean filters(TraceInterface traceAccess) { ApplicationName appName = traceAccess.getAppName(); if (enabled.get() && ApplicationName.UNKOWN_APPLICATION.equals(appName)) { return true; } return false; }
public ApplicationServerResource(ApplicationName application, ServerName server, String label) { super(makeKey(application, server), label); this.applicationKey = application.makeKey(); this.serverKey = server.makeKey(); this.applicationName = application; this.serverName = server; }
protected ApplicationName fromServletContext (ServletContext context) { String path=context.getContextPath(), name=context.getServletContextName(); if (StringUtil.isEmpty(path) || "/".equals(path)) { name = "insight"; } else if (path.charAt(0) == '/') { name = path.substring(1); } else { name = path; } return ApplicationName.valueOf("localhost", name); }
public List<PersistedTraceSummary> findSummariesByApp(TimeRange range, ApplicationName app) { return entityManager.createNamedQuery(QUERY_SUMMARIES_IN_RANGE_BY_APP, PersistedTraceSummary.class) .setParameter("start", Long.valueOf(range.getStart())) .setParameter("end", Long.valueOf(range.getEnd())) .setParameter("app", app.getName()) .getResultList(); }
boolean queryMatchesApplication(ResourceQuery query, Resource resource) { ApplicationName app = query.getRequiredApplication(); if (app == null) { return true; } if (resource instanceof ApplicationAwareResource) { return ((ApplicationAwareResource) resource).getApplicationName().equals(app); } return false; }
private Map<ResourceType, Resource> addResources() { TraceSource traceSource = trace.getTraceSource(); ApplicationName appName=trace.getAppName(); String applicationLabel=applicationMetadata.getLabel(appName); ApplicationResource application = new ApplicationResource(appName.makeKey(), applicationLabel); ApplicationEndPointResource endpoint = new ApplicationEndPointResource(appName, endPointAnalysis.getEndPointName(), endPointAnalysis.getResourceLabel(), traceSource); resources.put(APPLICATION, application); resources.put(SERVER, server); resources.put(APPLICATION_SERVER, new ApplicationServerResource(application, server)); resources.put(APPLICATION_END_POINT, endpoint); resources.put(APPLICATION_SERVER_END_POINT, new ApplicationServerEndPointResource(application, server, endpoint, traceSource)); return resources; }
public static final ApplicationName restoreApplicationName(CollectionSettingName name) { if (name == null) { return null; } String key=name.getKey(); if (!StringUtil.isProperPrefix(key, KEY_NAME)) { return null; } if ((key.length() <= (KEY_NAME.length() + 1)) || (key.charAt(KEY_NAME.length()) != '.')) { return null; // make sure followed by '.' and not only '.' } String appName=key.substring(KEY_NAME.length() + 1); return ApplicationName.valueOf(appName); }
public static final ResourceKey makeKey(ApplicationName application, ServerName server) { return ResourceKey.valueOf(ApplicationServer, application.getName() + "-" + server, "Application=" + StringUtil.smartQuoteObjectName(application.getName()) + ",Server=" + StringUtil.smartQuoteObjectName(server.toString())); }
if (other.requiredApp != null) return false; } else if (!requiredApp.equals(other.requiredApp)) return false; if (requiredEndPoint == null) {
public ApplicationServerEndPointResource(final ApplicationName application, final ServerName server, final EndPointName endPoint, final String label, final TraceSource source) { super(makeKey(application, server, endPoint, source), label); applicationKey = application.makeKey(); applicationServerKey = ApplicationServerResource.makeKey(application, server); endPointKey = ApplicationEndPointResource.makeKey(application, endPoint, source); serverKey = server.makeKey(); applicationName = application; serverName = server; endPointName = endPoint; }