Package com.springsource.insight.intercept.topology

Examples of com.springsource.insight.intercept.topology.ExternalResourceDescriptor


        return errors;
    }

    protected static ExternalResourceDescriptor assertExternalResource(Operation op) {
        Frame frame = createMockOperationWrapperFrame(op);
        ExternalResourceDescriptor desc = extresAnalyzer.extractExternalResourceDescriptor(frame);
        Boolean directCall = op.get(HttpInvokerRequestExecutorExternalResourceAnalyzer.DIRECT_CALL_ATTR, Boolean.class);
        if ((directCall != null) && directCall.booleanValue()) {
            String label = TEST_HOST + ":" + TEST_PORT;
            assertNotNull("No resource", desc);
            assertSame("Mismatched external resource frame", frame, desc.getFrame());
            assertEquals("Mismatched external resource host", TEST_HOST, desc.getHost());
            assertEquals("Mismatched external resource port", TEST_PORT, desc.getPort());
            assertEquals("Mismatched external resource name", MD5NameGenerator.getName(label), desc.getName());
            assertEquals("Mismatched external resource label", label, desc.getLabel());
            assertEquals("Mismatched external resource type", ExternalResourceType.WEB_SERVER.name(), desc.getType());
            assertFalse("Unexpected as parent external resource", desc.isParent());
            assertFalse("Not outgoing external resource", desc.isIncoming());
        } else {
            assertNull("Unexpected external resource: " + desc, desc);
        }

        return desc;
View Full Code Here


        int port = portProperty == null ? -1 : portProperty.intValue();

        String color = colorManager.getColor(op);
        String hashString = buildNameHash(label, host, port);

        return new ExternalResourceDescriptor(queueFrame,
                JMS + ":" + hashString,
                JMS + "-" + label,
                ExternalResourceType.QUEUE.name(),
                JMS,
                host,
View Full Code Here

            Frame frame = builder.exit();
            Trace trace = Trace.newInstance(ApplicationName.valueOf("app"), TraceId.valueOf("0"), frame);

            List<ExternalResourceDescriptor> externalResourceDescriptors = (List<ExternalResourceDescriptor>) analyzer.locateExternalResourceName(trace);
            assertNotNull("No descriptors extracted", externalResourceDescriptors);
            ExternalResourceDescriptor descriptor = externalResourceDescriptors.get(0);
            assertSame("Mismatched operation instance", op, descriptor.getFrame().getOperation());
            assertDescriptorContents("testExactlyTwoDifferentExternalResourceNames", expTemplate, descriptor);

            return op;
        } finally {
            testService.destroy();
View Full Code Here

            return Collections.emptyList();
        }

        Set<ExternalResourceDescriptor> resSet = new HashSet<ExternalResourceDescriptor>(framesList.size());
        for (Frame frame : framesList) {
            ExternalResourceDescriptor res = extractExternalResourceDescriptor(frame);
            if (res == null) {  // can happen if failed to parse the URI somehow
                continue;
            }

            if (!resSet.add(res))
View Full Code Here

        int port = op.getInt(SocketDefinitions.PORT_ATTR, (-1));
        String uri = op.get(OperationFields.URI, String.class);
        ExternalResourceType type = (uri == null) ? ExternalResourceType.SERVER : ExternalResourceType.WEB_SERVER;
        String color = colorManager.getColor(op);

        return new ExternalResourceDescriptor(frame,
                MD5NameGenerator.getName(addr + ":" + port),
                op.getLabel(),
                type.name(),
                null,
                addr,
View Full Code Here

            return Collections.emptyList();
        }

        Set<ExternalResourceDescriptor> resSet = new HashSet<ExternalResourceDescriptor>(externalFrames.size());
        for (Frame frame : externalFrames) {
            ExternalResourceDescriptor res = extractExternalResourceDescriptor(frame);
            if (res == null) {  // can happen if failed to parse the URI somehow
                continue;
            }

            if (!resSet.add(res)) {
View Full Code Here

        }

        int port = op.getInt(TcpConnectionOperationCollector.PORT_ATTR, (-1));
        String uri = op.get(OperationFields.URI, String.class);
        String color = colorManager.getColor(op);
        return new ExternalResourceDescriptor(frame,
                MD5NameGenerator.getName(uri),
                op.getLabel() + " " + uri,
                ExternalResourceType.SERVER.name(),
                null,
                addr,
View Full Code Here

                continue;
            }

            String hashString = MD5NameGenerator.getName(path);
            String color = colorManager.getColor(op);
            ExternalResourceDescriptor desc = new ExternalResourceDescriptor(frame,
                    JaxrsDefinitions.TYPE.getName() + ":" + hashString,
                    path,
                    ExternalResourceType.WEB_SERVICE.name(),
                    JaxrsDefinitions.TYPE.getName(),
                    color,
View Full Code Here

        ColorManager colorManager = ColorManager.getInstance();
        Operation op = frame.getOperation();
        String color = colorManager.getColor(op);

        // for  Non-URI based and special cases the host and port remain default
        ExternalResourceDescriptor hashed =
                new ExternalResourceDescriptor(frame, jdbcScheme + ":1:" + jdbcHash, "", ExternalResourceType.DATABASE.name(), jdbcScheme, host, port, color, false);
        return Collections.singletonList(hashed);
    }
View Full Code Here

            String vendor = urlMetaData.getVendorName();
            String host = urlMetaData.getHost();
            int port = urlMetaData.getPort();
            String jdbcHash = MD5NameGenerator.getName(connectionString);

            ExternalResourceDescriptor descriptor = new ExternalResourceDescriptor(frame,
                    vendor + ":" + instance + ":" + jdbcHash,
                    databaseName,
                    ExternalResourceType.DATABASE.name(),
                    vendor,
                    host,
View Full Code Here

TOP

Related Classes of com.springsource.insight.intercept.topology.ExternalResourceDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.