Package org.rhq.core.pluginapi.operation

Examples of org.rhq.core.pluginapi.operation.OperationResult


        scriptExe.addArguments(asList("-p", "cassandra.pid"));
        return scriptExe;
    }

    protected OperationResult restartNode() {
        OperationResult result = shutdownNode();

        if (result.getErrorMessage() == null) {
            result = startNode();
        }

        return result;
    }
View Full Code Here


    protected OperationResult updateSeedsList(Configuration params) {
        PropertyList list = params.getList("seedsList");
        List<String> addresses = getAddresses(list);

        OperationResult result = new OperationResult();
        try {
            updateSeedsList(addresses);
        catch (Exception e) {
            log.error("An error occurred while updating the seeds list property", e);
            Throwable rootCause = ThrowableUtil.getRootCause(e);
            result.setErrorMessage(ThrowableUtil.getStackAsString(rootCause));
        }
        return result;
    }
View Full Code Here

            log.info("The rogue component (op) has finished its sleep of " + sleep + "ms");
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        OperationResult result = new OperationResult();

        if (status.equalsIgnoreCase("success")) {
            // do nothing
        } else if (status.equalsIgnoreCase("failure")) {
            result.setErrorMessage("Rogue component was told to fail this operation");
        } else {
            throw new RuntimeException("Rogue component (op) was told to throw an exception (status=[" + status + "])");
        }

        return result;
View Full Code Here

    }

    public OperationResult invokeOperation(String name, Configuration parameters) throws InterruptedException,
        Exception {
        OperationResult result = null;

        try {
            EmsBean detailComponent = getEmsConnection().getBean(beanName);

            EmsOperation operation = detailComponent.getOperation(name);

            Object obj = operation.invoke(new Object[] {});

            if (obj != null) {
                result = new OperationResult();
                result.getComplexResults().put(
                    new PropertySimple(OperationResult.SIMPLE_OPERATION_RESULT_NAME, String.valueOf(obj)));
            }
        } catch (Exception e) {
            log.error("Failure to invoke operation " + name + " on bean " + beanName, e);
        }
View Full Code Here

            return takeSnapshot(parameters);
        } else if (name.equals("cleanup")) {
            return cleanup();
        }

        OperationResult failedOperation = new OperationResult();
        failedOperation.setErrorMessage("Operation not implemented.");

        return failedOperation;
    }
View Full Code Here

        long start = System.currentTimeMillis();
        keyspaceService.repair(keyspace, columnFamilies);
        long end = System.currentTimeMillis();
        log.info("Finished repair on keyspace [" + keyspace + "] in " + (end - start) + " ms");

        return new OperationResult();
    }
View Full Code Here

        long start = System.currentTimeMillis();
        keyspaceService.repairPrimaryRange(keyspace);
        long end = System.currentTimeMillis();
        log.info("Finished primary range repair on keyspace [" + keyspace + " in (" + (end - start) + " ms");

        return new OperationResult();
    }
View Full Code Here

        keyspaceService.cleanup(keyspace);
        long end = System.currentTimeMillis();

        log.info("Finished cleanup on keyspace [" + keyspace + "] in " + (end - start) + " ms");

        return new OperationResult();
    }
View Full Code Here

        long start = System.currentTimeMillis();
        keyspaceService.compact(keyspace, columnFamilies);
        long end = System.currentTimeMillis();
        log.info("Finished compaction on keysapce [" + keyspace + "] in " + (end - start) + " ms");

        return new OperationResult();
    }
View Full Code Here

        }

        long end = System.currentTimeMillis();
        log.info("Finished taking snapshot of keyspace [" + keyspace + "] in " + (end - start) + " ms");

        return new OperationResult();
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.pluginapi.operation.OperationResult

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.