Examples of ConfigurationResponse


Examples of com.cisco.oss.foundation.configuration.xml.jaxb.ConfigurationResponse

    protected String marshall(ConfigurationResponse jaxb) throws XmlException {
        return(parser.marshall(jaxb));
    }

    protected ConfigurationResponse unmarshall(String xml) throws XmlException {
        ConfigurationResponse jaxb = null;
        try {
            jaxb = (ConfigurationResponse)parser.unmarshall(xml);
        } catch(ClassCastException e) {
            throw new XmlException("The given message was not a ConfigurationResponse Message - ClassCastException: " + e.getMessage(), e);
        }
View Full Code Here

Examples of com.cloud.api.response.ConfigurationResponse

    public void execute() {
        List<? extends Configuration> result = _mgr.searchForConfigurations(this);
        ListResponse<ConfigurationResponse> response = new ListResponse<ConfigurationResponse>();
        List<ConfigurationResponse> configResponses = new ArrayList<ConfigurationResponse>();
        for (Configuration cfg : result) {
            ConfigurationResponse cfgResponse = _responseGenerator.createConfigurationResponse(cfg);
            cfgResponse.setObjectName("configuration");
            configResponses.add(cfgResponse);
        }

        response.setResponses(configResponses);
        response.setResponseName(getCommandName());
View Full Code Here

Examples of com.cloud.api.response.ConfigurationResponse

   
    @Override
    public void execute(){
        Configuration cfg = _configService.updateConfiguration(this);
        if (cfg != null) {
            ConfigurationResponse response = _responseGenerator.createConfigurationResponse(cfg);
            response.setResponseName(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to update config");
        }
    }
View Full Code Here

Examples of com.cloud.api.response.ConfigurationResponse

        return offeringResponse;
    }

    @Override
    public ConfigurationResponse createConfigurationResponse(Configuration cfg) {
        ConfigurationResponse cfgResponse = new ConfigurationResponse();
        cfgResponse.setCategory(cfg.getCategory());
        cfgResponse.setDescription(cfg.getDescription());
        cfgResponse.setName(cfg.getName());
        cfgResponse.setValue(cfg.getValue());
        cfgResponse.setObjectName("configuration");

        return cfgResponse;
    }
View Full Code Here

Examples of org.apache.ambari.server.controller.ConfigurationResponse

    Resource.Type type = Resource.Type.Configuration;

    AmbariManagementController managementController = createMock(AmbariManagementController.class);

    Set<ConfigurationResponse> allResponse = new HashSet<ConfigurationResponse>();
    allResponse.add(new ConfigurationResponse("Cluster100", "type", "tag1", null));
    allResponse.add(new ConfigurationResponse("Cluster100", "type", "tag2", null));
    allResponse.add(new ConfigurationResponse("Cluster100", "type", "tag3", null));

    // set expectations
    expect(managementController.getConfigurations(
        AbstractResourceProviderTest.Matcher.getConfigurationRequestSet(
            "Cluster100", null, null, Collections.<String, String>emptyMap()))).andReturn(allResponse).once();
View Full Code Here

Examples of org.apache.ambari.server.controller.ConfigurationResponse

    Resource.Type type = Resource.Type.Configuration;

    AmbariManagementController managementController = createMock(AmbariManagementController.class);

    Set<ConfigurationResponse> allResponse = new HashSet<ConfigurationResponse>();
    allResponse.add(new ConfigurationResponse("Cluster100", "type", "tag1", null));
    allResponse.add(new ConfigurationResponse("Cluster100", "type", "tag2", null));
    allResponse.add(new ConfigurationResponse("Cluster100", "type", "tag3", null));

    Set<ConfigurationResponse> orResponse = new HashSet<ConfigurationResponse>();
    orResponse.add(new ConfigurationResponse("Cluster100", "type", "tag1", null));
    orResponse.add(new ConfigurationResponse("Cluster100", "type", "tag2", null));

    Capture<Set<ConfigurationRequest>> configRequestCapture1 = new Capture<Set<ConfigurationRequest>>();
    Capture<Set<ConfigurationRequest>> configRequestCapture2 = new Capture<Set<ConfigurationRequest>>();

    // set expectations
View Full Code Here

Examples of org.apache.cloudstack.api.response.ConfigurationResponse

        return ApiDBUtils.newServiceOfferingResponse(vOffering);
    }

    @Override
    public ConfigurationResponse createConfigurationResponse(Configuration cfg) {
        ConfigurationResponse cfgResponse = new ConfigurationResponse();
        cfgResponse.setCategory(cfg.getCategory());
        cfgResponse.setDescription(cfg.getDescription());
        cfgResponse.setName(cfg.getName());
        cfgResponse.setValue(cfg.getValue());
        cfgResponse.setObjectName("configuration");

        return cfgResponse;
    }
View Full Code Here

Examples of org.apache.cloudstack.api.response.ConfigurationResponse

                    .thenReturn(cfg);
        }catch (Exception e){
            Assert.fail("Received exception when success expected " + e.getMessage());
        }

        ConfigurationResponse response = new ConfigurationResponse();
        response.setName("Test case");
        Mockito.when(responseGenerator.createConfigurationResponse(cfg)).thenReturn(response);

        updateCfgCmd.execute();
        Mockito.verify(responseGenerator).createConfigurationResponse(cfg);
        ConfigurationResponse actualResponse = (ConfigurationResponse) updateCfgCmd.getResponseObject();
        Assert.assertEquals(response, actualResponse);
        Assert.assertEquals("updateconfigurationresponse", response.getResponseName());
    }
View Full Code Here

Examples of org.apache.cloudstack.api.response.ConfigurationResponse

                    mgr.searchForConfigurations(listCfgsByCmd))
                    .thenReturn(result);
        }catch (Exception e){
            Assert.fail("Received exception when success expected " + e.getMessage());
        }
        ConfigurationResponse cfgResponse = new ConfigurationResponse();
        cfgResponse.setName("Test case");
        Mockito.when(responseGenerator.createConfigurationResponse(cfg)).thenReturn(cfgResponse);

        listCfgsByCmd.execute();
        Mockito.verify(responseGenerator).createConfigurationResponse(cfg);
View Full Code Here

Examples of org.apache.cloudstack.api.response.ConfigurationResponse

        return ApiDBUtils.newServiceOfferingResponse(vOffering);
    }

    @Override
    public ConfigurationResponse createConfigurationResponse(Configuration cfg) {
        ConfigurationResponse cfgResponse = new ConfigurationResponse();
        cfgResponse.setCategory(cfg.getCategory());
        cfgResponse.setDescription(cfg.getDescription());
        cfgResponse.setName(cfg.getName());
        cfgResponse.setValue(cfg.getValue());
        cfgResponse.setObjectName("configuration");

        return cfgResponse;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.