public EndPointName getEndPoint() { if (endpointName == null) return null; return EndPointName.valueOf(endpointName); }
public static ColorCommand getColorCommand () { return new ColorCommand(EndPointName.valueOf("getColorCommand").makeKey(), "inputId", "rootId", "7.3.6.5"); } }
public static SyncResourceCommand getApplicationEndpointResourceCommand() { ApplicationEndPointResource appEndPointRes = new ApplicationEndPointResource(ApplicationName.valueOf("appName"), EndPointName.valueOf("endPoint"),"a label"); return new SyncResourceCommand(appEndPointRes); }
@Override protected EndPointAnalysis makeEndPoint(Frame dispatchFrame, int depth) { Operation op=dispatchFrame.getOperation(); String label=op.getLabel(); EndPointName name=EndPointName.valueOf(label.replace('/', '_')); return new EndPointAnalysis(name, label, label, getOperationScore(op, depth), op); } }
public static SyncResourceCommand getApplicationServerEndpointResourceCommand() { ApplicationServerEndPointResource appEndPointServerRes = new ApplicationServerEndPointResource(ApplicationName.valueOf("appName"), ServerName.valueOf("myserver"), EndPointName.valueOf("endPoint"),"a label"); return new SyncResourceCommand(appEndPointServerRes); }
@Override protected EndPointAnalysis makeEndPoint(Frame frame, int depth) { Operation op=frame.getOperation(); return new EndPointAnalysis(EndPointName.valueOf(op), op.getLabel(), op.getLabel(), getOperationScore(op, depth), op); }
@Override protected EndPointAnalysis makeEndPoint(Frame frame, int depth) { Operation op=frame.getOperation(); EndPointName endPointName=EndPointName.valueOf(op); String example=EndPointAnalysis.getHttpExampleRequest(frame); return new EndPointAnalysis(endPointName, op.getLabel(), example, getOperationScore(op, depth), op); } }
@Override protected EndPointAnalysis makeEndPoint(Frame blazeFrame, int depth) { Operation blazeOp = blazeFrame.getOperation(); String examplePath = getExamplePath(FrameUtil.getLastParentOfType(blazeFrame, OperationType.HTTP), blazeOp); String endPointLabel = "BlazeDS: " + blazeOp.getLabel(); // The logical thing would be for the endPointName to be equals to the endPointLabel (or operationLabel) // but when the op label contains a url (as in the case of HTTPProxyService) // the endPointName ends up containing special characters which interfere with displaying it in the UI // So - we have the operations themselves report what the endPointName should be // (which is the operation label minus the url if exists) String endPointNameString = blazeOp.get("endPointName", String.class); EndPointName endPointName=StringUtil.isEmpty(endPointNameString) ? EndPointName.valueOf(blazeOp) : EndPointName.valueOf(endPointNameString) ; return new EndPointAnalysis(endPointName, endPointLabel, examplePath, getOperationScore(blazeOp, depth), blazeOp); }
@Override protected EndPointAnalysis makeEndPoint(Frame si, int depth) { Operation op = si.getOperation(); String exampleRequest = op.get(SpringIntegrationDefinitions.SI_COMPONENT_TYPE_ATTR, String.class); String opLabel = op.getLabel(); EndPointName name = EndPointName.valueOf(opLabel); String label = name.getName(); return new EndPointAnalysis(name, label, exampleRequest, ANALYSIS_SCORE, op); } }
@Override protected EndPointAnalysis makeEndPoint(Frame controllerFrame, int depth) { Operation controllerOp = controllerFrame.getOperation(); String examplePath = EndPointAnalysis.getHttpExampleRequest(controllerFrame); EndPointName endPointName = EndPointName.valueOf(controllerOp); String endPointLabel = controllerOp.getLabel(); return new EndPointAnalysis(endPointName, endPointLabel, examplePath, getOperationScore(controllerOp, depth), controllerOp); } }
public Collection<ResourceKey> findResourcesWithTraces() { Session s = (Session)entityManager.getDelegate(); @SuppressWarnings("unchecked") Collection<Object[]> objs = s.createSQLQuery("SELECT distinct t.EXTERNAL_RESOURCE_NAME, t.EXTERNAL_RESOURCE_SUBTYPE, t.EXTERNAL_RESOURCE_HOST, t.EXTERNAL_RESOURCE_PORT, t.EXTERNAL_RESOURCE_VENDOR, t.EXTERNAL_RESOURCE_IS_INCOMING, t.ENDPOINT_NAME, t.SERVER_NAME, t.APP_NAME FROM TRACE_SUMMARIES t").list(); if (ListUtil.size(objs) <= 0) { return Collections.emptyList(); } Collection<ResourceKey> res = new ArrayList<ResourceKey>(objs.size()); for (Object[] o: objs) { EndPointName epName = EndPointName.valueOf((String)o[6]); ServerName serverName = ServerName.valueOf((String)o[7]); ApplicationName appName = ApplicationName.valueOf((String)o[8]); final ResourceKey k; if (StringUtil.isEmpty((String) o[0])) { k = ApplicationServerEndPointResource.makeKey(appName, serverName, epName); } else { ExternalResourceName extName = ExternalResourceName.valueOf((String)o[0]); String subtype = (String)o[1]; String host = (String)o[2]; String port = String.valueOf(o[3]); String vendor = (String)o[4]; Boolean incoming = (Boolean)o[5]; k = EndpointApplicationServerExternalResource.makeKey(epName, appName, serverName, extName, subtype, vendor, host, port, incoming.booleanValue()); } res.add(k); } return res; } }
public static SyncResourceCommand getExternalResourceCommand() { EndpointApplicationServerExternalResource extern = new EndpointApplicationServerExternalResource( EndPointName.valueOf("FooEndPoint"), ApplicationName.valueOf("FooApplication"), ServerName.valueOf("FooServer"), ExternalResourceName.valueOf("mysql:FooExternalResource"), "mysql:jdbc-subtype", "mysql", "Some sort of fancy label", "127.0.0.1", 8080, "blue", false, null); return new SyncResourceCommand(extern); }
public static ResourceKey makeDestinationKey(String destApp, String destSer, String destEp, TraceSource source) { if (StringUtil.isEmpty(destApp) || StringUtil.isEmpty(destSer) || StringUtil.isEmpty(destEp)) { return null; } return ApplicationServerEndPointResource.makeKey(ApplicationName.valueOf(destApp), ServerName.valueOf(destSer), EndPointName.valueOf(destEp), source); }
@Override protected EndPointAnalysis makeEndPoint(Frame annotatedFrame, int depth) { EndPointAnalysis result=super.makeEndPoint(annotatedFrame, depth); Operation operation=annotatedFrame.getOperation(); String annotatedName=operation.get(ENDPOINT_NAME_OVERRIDE_PROP, String.class); if (!StringUtil.isEmpty(annotatedName)) { result.setEndPoint(EndPointName.valueOf(annotatedName)); } Boolean useDepthScore=operation.get(DEPTH_SCORE_PROP, Boolean.class); if ((useDepthScore != null) && useDepthScore.booleanValue()) { result.setScore(EndPointAnalysis.depth2score(depth)); } return result; }
@Override protected EndPointAnalysis makeEndPoint(Frame grailsFrame, int depth) { Operation operation = grailsFrame.getOperation(); String resourceKey = makeResourceKey(operation.getSourceCodeLocation()); String resourceLabel = operation.getLabel(); String exampleRequest = EndPointAnalysis.getHttpExampleRequest(grailsFrame); return new EndPointAnalysis(EndPointName.valueOf(resourceKey), resourceLabel, exampleRequest, getOperationScore(operation, depth), operation); }
@Override protected EndPointAnalysis makeEndPoint(Frame httpFrame, int depth) { Operation op = httpFrame.getOperation(); OperationMap request = op.get("request", OperationMap.class); String servletName=(request == null) ? null : request.get("servletName", String.class); String endPointKey=sanitizeEndPointKey(servletName); String endPointLabel = "Servlet: " + servletName; String example=EndPointAnalysis.createHttpExampleRequest(request); if (StringUtil.isEmpty(example)) { example = op.getLabel(); } return new EndPointAnalysis(EndPointName.valueOf(endPointKey), endPointLabel, example, getOperationScore(op, depth), op); }