Package com.springsource.insight.intercept.operation

Examples of com.springsource.insight.intercept.operation.OperationMap


            obfuscator.incrementalUpdate(HttpObfuscator.OBFUSCATED_HEADERS_SETTING, StringUtil.implode(headerSet, ","));
        }

        int response = httpClient.executeMethod(method);
        Operation op = assertExecutionResult(uri, method, response, false);
        OperationMap reqDetails = op.get("request", OperationMap.class);
        OperationList reqHeaders = reqDetails.get("headers", OperationList.class);
        Map<String, String> requestHeaders = toHeadersMap(reqHeaders);
        OperationMap rspDetails = op.get("response", OperationMap.class);
        OperationList rspHeaders = rspDetails.get("headers", OperationList.class);
        Map<String, String> responseHeaders = toHeadersMap(rspHeaders);
        Map<String, String> hdrsMap = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER);
        if (MapUtil.size(requestHeaders) > 0) {
            hdrsMap.putAll(requestHeaders);
        }
View Full Code Here


            return Collections.emptyMap();
        }

        Map<String, String> hdrsMap = new TreeMap<String, String>();
        for (int index = 0; index < headers.size(); index++) {
            OperationMap hdrValue = headers.get(index, OperationMap.class);
            String name = hdrValue.get(OperationUtils.NAME_KEY, String.class);
            String value = hdrValue.get(OperationUtils.VALUE_KEY, String.class);
            hdrsMap.put(name, value);
        }

        return hdrsMap;
    }
View Full Code Here

        assertEncodeModelValues(op, mapName, expected);
        return op;
    }

    protected static final OperationMap assertEncodeModelValues(Operation op, String mapName, Map<String, ?> expected) {
        OperationMap map = op.get(mapName, OperationMap.class);
        assertNotNull(mapName + ": missing encoding", map);
        return assertEncodeModelValues(map, mapName, expected);
    }
View Full Code Here

        return resSet;
    }

    ExternalResourceDescriptor extractExternalResourceDescriptor(Frame frame) {
        Operation op = (frame == null) ? null : frame.getOperation();
        OperationMap requestDetails = (op == null) ? null : op.get("request", OperationMap.class);
        String uriValue = (requestDetails == null) ? null : requestDetails.get(OperationFields.URI, String.class);
        if (StringUtil.getSafeLength(uriValue) <= 0) {
            return null;
        }

        try {
            URI uri = new URI(uriValue);
            String host = uri.getHost();
            int port = resolvePort(uri);

            String color = colorManager.getColor(op);
            String app = null;
            String ser = null;
            String ep = null;

            OperationMap responseDetails = (op == null) ? null : op.get("response", OperationMap.class);

            if (responseDetails != null) {
                OperationList headersList = responseDetails.get("headers", OperationList.class);

                if (headersList != null) {
                    for (int i = 0; i < headersList.size(); i++) {
                        OperationMap map = headersList.get(i, OperationMap.class);

                        String headerName = map.get(OperationUtils.NAME_KEY, String.class);
                        String headerValue = map.get(OperationUtils.VALUE_KEY, String.class);

                        if ((app == null) && EndPointAnalyzersRegistry.APP_TOKEN_NAME.equals(headerName)) {
                            app = headerValue;
                        } else if ((ser == null) && EndPointAnalyzersRegistry.SERVER_TOKEN_NAME.equals(headerName)) {
                            ser = headerValue;
View Full Code Here

    private OperationList assertMethodHeaders(String type, OperationList op, HttpHeaders hdrs) {
        assertEquals(type + ": mismatched num. of headers", op.size(), hdrs.size());

        for (int index = 0; index < op.size(); index++) {
            OperationMap nvp = op.get(index, OperationMap.class);
            assertNotNull(type + ": missing name-value pair for index=" + index, nvp);

            String key = nvp.get(OperationUtils.NAME_KEY, String.class);
            assertFalse(type + ": missing header name for index=" + index, StringUtil.isEmpty(key));

            String actual = nvp.get(OperationUtils.VALUE_KEY, String.class), expected = hdrs.getFirst(key);
            assertEquals(type + ": mismatched value for header=" + key, expected, actual);
        }

        return op;
    }
View Full Code Here

    @Override
    public TraceError locateFrameError(Frame httpFrame) {
        Operation op = (httpFrame == null) ? null : httpFrame.getOperation();
        // NOTE: if an IOException occurred we will not have a response either
        OperationMap response = (op == null) ? null : op.get("response", OperationMap.class);
        if (response == null) {
            return null;
        }

        int statusCode = response.getInt(STATUS_CODE_ATTR, (-1));
        if ((statusCode < 0) /* no code */ || (!httpStatusIsError(statusCode))) {
            return null;
        }

        String reasonPhrase = response.get(REASON_PHRASE_ATTR, String.class);
        return new TraceError(createErrorMessage(statusCode, reasonPhrase));
    }
View Full Code Here

        Axon20OperationUtils.addMetaDataTo(operation, commandMessage);
        return true;
    }

    private static void addMetaDataTo(Operation operation, MetaData metaData) {
        OperationMap map = operation.createMap("metaData");
        for (Entry<String, Object> entry : metaData.entrySet()) {
            map.put(entry.getKey(), entry.getValue().toString());
        }
    }
View Full Code Here

        return INSTANCE;
    }

    @Override
    protected String getRoutingKey(Operation op) {
        OperationMap envelopeMap = op.get("envelope", OperationMap.class);
        if (envelopeMap == null) {
            return null;
        } else {
            return envelopeMap.get("routingKey", String.class);
        }
    }
View Full Code Here

        }
    }

    @Override
    protected String getExchange(Operation op) {
        OperationMap envelopeMap = op.get("envelope", OperationMap.class);
        if (envelopeMap == null) {
            return null;
        } else {
            return envelopeMap.get("exchange", String.class);
        }
    }
View Full Code Here

        assert op.getType().getName().equals("wf-state");

        assert "ViewState".equals(op.get("stateType"));
        assert "dummy2".equals(op.get("stateId"));
        //assert "/dummyView".equals(op.get("view"));
        OperationMap map = (OperationMap) op.get("attribs");
        assertNotNull(map.get("model"));

        OperationList entryActions = (OperationList) op.get("entryActions");
        assert "personDao.save(person)".equals(entryActions.get(0));
        assert "flowScope.temp=1".equals(entryActions.get(1));
    }
View Full Code Here

TOP

Related Classes of com.springsource.insight.intercept.operation.OperationMap

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.