Package org.jolokia.client.request

Examples of org.jolokia.client.request.J4pExecRequest


   * @param args    the arguments
   * @return      the request object
   * @throws MalformedObjectNameException  if the url of the mbean was malformed
   */
  public static J4pExecRequest createExecRequest(String mbean, String operation, Object... args) throws MalformedObjectNameException {
        J4pExecRequest rc = new J4pExecRequest(mbean, operation, args);
        rc.setPreferredHttpMethod("POST");
        return rc;
    }
View Full Code Here


     */
    @Override
    public List<ContainerDTO> getContainers() {
      List<ContainerDTO> containers = new ArrayList<ContainerDTO>();
      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "containers()");
            J4pExecResponse response = getJolokiaClient().execute(request);
            List<Map<String, Object>> values = response.getValue();
            for (Map<String, Object> value : values) {
                containers.add(new ContainerDTO(this.fabricFacade, value));
            }
View Full Code Here

     */
    @Override
    public ContainerDTO getContainer(String containerId) {
      ContainerDTO container = null;
      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "getContainer(java.lang.String)", containerId);
            J4pExecResponse response = getJolokiaClient().execute(request);
            Map<String, Object> values = response.getValue();
            container = new ContainerDTO(this.fabricFacade, values);
        } catch (Exception e) {
          Fabric8CorePlugin.getLogger().error("Failed to fetch container with ID '" + containerId + "' from fabric8.", e);
View Full Code Here

     */
    @Override
    public ContainerDTO getCurrentContainer() {
      ContainerDTO container = null;
      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "currentContainer()");
            J4pExecResponse response = getJolokiaClient().execute(request);
            Map<String, Object> values = response.getValue();
            container = new ContainerDTO(this.fabricFacade, values);
        } catch (Exception e) {
          Fabric8CorePlugin.getLogger().error("Failed to fetch current container from fabric8.", e);
View Full Code Here

     * @see org.fusesource.ide.fabric8.core.connector.Fabric8ConnectorType#startContainer(java.lang.String)
     */
    @Override
    public void startContainer(String containerId) {
      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "startContainer(java.lang.String)", containerId);
            getJolokiaClient().execute(request);
        } catch (Exception e) {
          Fabric8CorePlugin.getLogger().error("Failed to start container with id '" + containerId + "'.", e);
        }
    }
View Full Code Here

     * @see org.fusesource.ide.fabric8.core.connector.Fabric8ConnectorType#stopContainer(java.lang.String)
     */
    @Override
    public void stopContainer(String containerId) {
      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "stopContainer(java.lang.String)", containerId);
            getJolokiaClient().execute(request);
        } catch (Exception e) {
          Fabric8CorePlugin.getLogger().error("Failed to stop container with id '" + containerId + "'.", e);
        }
    }
View Full Code Here

     * @see org.fusesource.ide.fabric8.core.connector.Fabric8ConnectorType#destroyContainer(java.lang.String)
     */
    @Override
    public void destroyContainer(String containerId) {
      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "destroyContainer(java.lang.String)", containerId);
            getJolokiaClient().execute(request);
        } catch (Exception e) {
          Fabric8CorePlugin.getLogger().error("Failed to destroy container with id '" + containerId + "'.", e);
        }
    }
View Full Code Here

     */
    @Override
    public VersionDTO createVersion(String versionId) {
      VersionDTO version = null;
      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "createVersion()");
            J4pExecResponse response = getJolokiaClient().execute(request);
            Map<String, Object> values = response.getValue();
            version = new VersionDTO(this.fabricFacade, values);
        } catch (Exception e) {
          Fabric8CorePlugin.getLogger().error("Failed to create version with id '" + versionId + "'.", e);
View Full Code Here

     * @see org.fusesource.ide.fabric8.core.connector.Fabric8ConnectorType#deleteVersion(java.lang.String)
     */
    @Override
    public void deleteVersion(String versionId) {
      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "deleteVersion(java.lang.String)", versionId);
            getJolokiaClient().execute(request);
        } catch (Exception e) {
          Fabric8CorePlugin.getLogger().error("Failed to delete version with id '" + versionId + "'.", e);
        }
    }
View Full Code Here

     */
    @Override
    public List<VersionDTO> getVersions() {
      List<VersionDTO> versions = new ArrayList<VersionDTO>();
      try {
            J4pExecRequest request = JolokiaHelpers.createExecRequest(FABRIC_MBEAN_URL, "versions()");
            J4pExecResponse response = getJolokiaClient().execute(request);
            List<Map<String, Object>> values = response.getValue();
            for (Map<String, Object> value : values) {
              VersionDTO v = new VersionDTO(this.fabricFacade, value);
              if (v.getId().equalsIgnoreCase("master")) continue; // don't show "MASTER" version
View Full Code Here

TOP

Related Classes of org.jolokia.client.request.J4pExecRequest

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.