Package org.rhq.core.domain.configuration

Examples of org.rhq.core.domain.configuration.Configuration$Builder$MapInList


     * @return
     */
    @Override
    public CreateResourceReport createResource(CreateResourceReport report) {

        Configuration config = report.getResourceConfiguration();
        String flavor = config.getSimpleValue(FLAVOR, null);
        if (flavor==null) {
            report.setStatus(CreateResourceStatus.INVALID_CONFIGURATION);
            report.setErrorMessage("No flavor given");

            return report;
        }
        String newName = report.getUserSpecifiedResourceName();
        Address address = new Address(this.getAddress());
        address.add(flavor,newName);
        Operation add = new Operation("add",address);
        for (Property prop: config.getProperties()) {
            if (prop.getName().equals(FLAVOR)) {
                continue;
            }
            PropertySimple ps = (PropertySimple) prop;
            add.addAdditionalProperty(prop.getName(),ps.getStringValue()); // TODO format conversion?
View Full Code Here


*
* @author Tom Cunningham
*/
public class ESB5DeploymentComponent extends AbstractDeploymentComponent {
  public void deleteResource() throws Exception {
        Configuration pluginConfiguration = getResourceContext().getPluginConfiguration();
        String fullFileName = pluginConfiguration.getSimple("deployment").getStringValue();
       
        ESB5Component jbossASComponent = (ESB5Component) getResourceContext().getParentResourceComponent();
        ProfileServiceConnection profileServiceConnection = jbossASComponent.getConnection();
        DeploymentManager deployMgr = profileServiceConnection.getDeploymentManager();

View Full Code Here

    public Set<ResourcePackageDetails> discoverDeployedPackages(PackageType type) {
        final Set<ResourcePackageDetails> packages = new HashSet<ResourcePackageDetails>();
       
        final ResourceContext<JMXComponent> resourceContext = getResourceContext();
        final Configuration pluginConfiguration = resourceContext.getPluginConfiguration();

        final String fullFileName = pluginConfiguration.getSimple("deployment").getStringValue();
       
        if (fullFileName == null) {
            throw new IllegalStateException("Plugin configuration does not contain the deployment name of the ESB file.");
        }
       
View Full Code Here

        this.context = context;
    }

    @Override
    public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) {
      Configuration pluginConfig = this.context.getPluginConfiguration();
      pluginConfig.put(new PropertySimple("type", "service"));
        for (MeasurementScheduleRequest request : requests) {
          String metricName = request.getName();
          if (metricName.equals(MEP)) {
            EmsAttribute attribute = getEmsBean().getAttribute(MEP);
            String processed = new String();
View Full Code Here

  
   @Override
   public void start(ResourceContext context) {
     super.start(context);
     Configuration pluginConfig = context.getPluginConfiguration();

     this.configPath = getConfigurationPath();
     if (!this.configPath.exists()) {
       throw new InvalidPluginConfigurationException("Configuration path '" + configPath + "' does not exist.");
     }
     this.configSet = pluginConfig.getSimpleValue(CONFIGURATION_SET_CONFIG_PROP, this.configPath.getName());
   }
View Full Code Here

          if (attr.getName().endsWith(MESSAGES_SUCCESSFULLY_PROCESSED)) {
            String actionName = attr.getName().replaceAll(MESSAGES_SUCCESSFULLY_PROCESSED, "");
                DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(), actionName,
                        actionName, null, "Action Entity", null, null);
               
                Configuration pc = detail.getPluginConfiguration();
                ArrayList<Property> props = new ArrayList<Property>();
                detail.setResourceVersion(versionNumber);
                entities.add(detail);
          }
        }
View Full Code Here

        this.bean = context.getParentResourceComponent().getEmsBean();
    }

    @Override
    public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) {
      Configuration pluginConfig = this.context.getPluginConfiguration();
      pluginConfig.put(new PropertySimple("type", "action"));
      //String actionName = pluginConfig.getActionName();
 
      String actionName = this.context.getResourceKey();
      actionName = actionName.trim();
        //Object entityStatistics = operation.invoke(context.getResourceKey());
View Full Code Here

        }
    }

    @Override
    public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) {
      Configuration pluginConfig = this.context.getPluginConfiguration();
      pluginConfig.put(new PropertySimple("type", "service"));
      Integer overallMessages = new Integer(0);
     
      long bytesProcessed = 0;
      long bytesFailed = 0;
        for (MeasurementScheduleRequest request : requests) {
View Full Code Here

              report.setErrorMessage("Incorrect extension specified on filename [" + archiveName + "]. Expected ["
                + expectedExtension + "]");
              return;
          }

            Configuration deployTimeConfiguration = details.getDeploymentTimeConfiguration();
            String deployDirectory = deployTimeConfiguration.getSimple("deployDirectory").getStringValue();

            // Verify the user did not enter a path that represents a security issue:
            // - No absolute directories; must be relative to the configuration path
            // - Cannot contain parent directory references
            File testPath = new File(deployDirectory);

            if (testPath.isAbsolute()) {
              throw new RuntimeException("Path to deploy (deployDirectory) must be a relative path. Path specified: "
                      + deployDirectory);
            }
           
            if (deployDirectory.contains("..")) {
            throw new RuntimeException(
                "Path to deploy (deployDirectory) may not reference the parent directory. Path specified: "
                    + deployDirectory);
          }

          // Perform the deployment
            FileContentDelegate deployer = new FileContentDelegate(new File(getConfigurationPath(), deployDirectory),
                    "", details.getPackageTypeName());

            PropertySimple zipProperty = deployTimeConfiguration.getSimple("deployZipped");

          if (zipProperty != null && zipProperty.getBooleanValue() != null) {
            boolean zip = zipProperty.getBooleanValue();

              File tempDir = resourceContext.getTemporaryDirectory();
View Full Code Here

* @author Tom Cunningham
* @param <T>
*/
public class ESBDeploymentComponent extends AbstractDeploymentComponent {
  public void deleteResource() throws Exception {
        Configuration pluginConfiguration = getResourceContext().getPluginConfiguration();
        String fullFileName = pluginConfiguration.getSimple("deployment").getStringValue();
       
        ESBComponent jbossASComponent = (ESBComponent) getResourceContext().getParentResourceComponent();
        //File deploymentFile = jbossASComponent.getDeploymentFilePath(super.resourceContext.getResourceKey());

        final File deploy = new File(jbossASComponent.getConfigurationPath(), "deploy");
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.configuration.Configuration$Builder$MapInList

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.