Package org.jolokia.util

Examples of org.jolokia.util.RequestType


     */
    public synchronized void updateAndAdd(JmxRequest pJmxReq, JSONObject pJson) {
        long timestamp = System.currentTimeMillis() / 1000;
        pJson.put(KEY_TIMESTAMP,timestamp);

        RequestType type  = pJmxReq.getType();
        HistoryUpdater updater = historyUpdaters.get(type);
        if (updater != null) {
            updater.updateHistory(pJson,pJmxReq,timestamp);
        }
    }
View Full Code Here


                if (commandNode.getNodeType() != Node.ELEMENT_NODE) {
                    continue;
                }
                assertNodeName(commandNode,"command");
                String typeName = commandNode.getTextContent().trim();
                RequestType type = RequestType.getTypeByName(typeName);
                typeSet.add(type);
            }
        }
    }
View Full Code Here

     * @param pPathInfo path info of HTTP request
     * @param pParameterMap HTTP Query parameters
     * @return a newly created {@link JmxRequest}
     */
    public static <R extends JmxRequest> R createGetRequest(String pPathInfo, Map<String,String[]> pParameterMap) {
        RequestType type = null;
        try {
            String pathInfo = extractPathInfo(pPathInfo, pParameterMap);

            // Get all path elements as a reverse stack
            Stack<String> elements = PathUtil.extractElementsFromPath(pathInfo);
View Full Code Here

     */
    public static <R extends JmxRequest> R createPostRequest(Map<String, ?> pRequestMap, Map<String, String[]> pParameterMap) {
        try {
            Map<String,String> params = mergeMaps((Map<String,String>) pRequestMap.get("config"),
                                                  extractParameters(pParameterMap));
            RequestType type = RequestType.getTypeByName((String) pRequestMap.get("type"));
            return (R) getProcessor(type).process(pRequestMap,params);
        } catch (MalformedObjectNameException e) {
            throw new IllegalArgumentException("Invalid object name. " + e.getMessage(),e);
        }
    }
View Full Code Here

     */
    public synchronized void updateAndAdd(JmxRequest pJmxReq, JSONObject pJson) {
        long timestamp = System.currentTimeMillis() / 1000;
        pJson.put(KEY_TIMESTAMP,timestamp);

        RequestType type  = pJmxReq.getType();
        HistoryUpdater updater = historyUpdaters.get(type);
        if (updater != null) {
            updater.updateHistory(pJson,pJmxReq,timestamp);
        }
    }
View Full Code Here

     * @param pPathInfo path info of HTTP request
     * @param pProcessingParameters processing parameters. Must not be null/
     * @return a newly created {@link JmxRequest}
     */
    public static <R extends JmxRequest> R createGetRequest(String pPathInfo, ProcessingParameters pProcessingParameters) {
        RequestType type = null;
        try {
            String pathInfo = extractPathInfo(pPathInfo, pProcessingParameters);

            // Get all path elements as a reverse stack
            Stack<String> elements = EscapeUtil.extractElementsFromPath(pathInfo);
View Full Code Here

     * @return the created {@link JmxRequest}
     */
    public static <R extends JmxRequest> R createPostRequest(Map<String, ?> pRequestMap, ProcessingParameters pProcessingParams) {
        try {
            ProcessingParameters paramsMerged = pProcessingParams.mergedParams((Map<String,String>) pRequestMap.get("config"));
            RequestType type = RequestType.getTypeByName((String) pRequestMap.get("type"));
            return (R) getCreator(type).create(pRequestMap, paramsMerged);
        } catch (MalformedObjectNameException e) {
            throw new IllegalArgumentException("Invalid object name. " + e.getMessage(),e);
        }
    }
View Full Code Here

                if (commandNode.getNodeType() != Node.ELEMENT_NODE) {
                    continue;
                }
                assertNodeName(commandNode,"command");
                String typeName = commandNode.getTextContent().trim();
                RequestType type = RequestType.getTypeByName(typeName);
                typeSet.add(type);
            }
        }
    }
View Full Code Here

    public JmxRequestBuilder(RequestType pType, ObjectName pMBean) throws MalformedObjectNameException {
        this(pType,pMBean.getCanonicalName());
    }

    public <R extends JmxRequest> R build() throws MalformedObjectNameException {
        RequestType type = RequestType.getTypeByName((String) request.get("type"));
        ProcessingParameters params = new Configuration().getProcessingParameters(procConfig);
        switch (type) {
            case READ: return (R) new JmxReadRequest(request,params);
            case WRITE: return (R) new JmxWriteRequest(request,params);
            case EXEC: return (R) new JmxExecRequest(request,params);
View Full Code Here

TOP

Related Classes of org.jolokia.util.RequestType

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.