Examples of VerifyResult


Examples of co.cask.cdap.app.verification.VerifyResult

   * @param input to be verified
   * @return An instance of {@link VerifyResult} depending of status of verification.
   */
  @Override
  public VerifyResult verify(Id.Application appId, final ApplicationSpecification input) {
    VerifyResult verifyResult = super.verify(appId, input);

    if (!verifyResult.isSuccess()) {
      return verifyResult;
    }

    // Check if there is at least one of the following : Flow & Procedure or MapReduce or Workflow for now.
    // TODO (terence): Logic here is really not good. Need to refactor.
View Full Code Here

Examples of co.cask.cdap.app.verification.VerifyResult

   * @param input to be verified
   * @return An instance of {@link VerifyResult} depending of status of verification.
   */
  @Override
  public VerifyResult verify(Id.Application appId, final FlowSpecification input) {
    VerifyResult verifyResult = super.verify(appId, input);
    if (!verifyResult.isSuccess()) {
      return verifyResult;
    }

    String flowName = input.getName();

View Full Code Here

Examples of co.cask.cdap.app.verification.VerifyResult

    Preconditions.checkNotNull(input);

    ApplicationSpecification specification = input.getSpecification();
    Id.Application appId = input.getApplicationId();

    VerifyResult result = getVerifier(ApplicationSpecification.class).verify(appId, specification);
    if (!result.isSuccess()) {
      throw new RuntimeException(result.getMessage());
    }

    // NOTE: no special restrictions on dataset module names, etc

    for (DatasetCreationSpec dataSetCreateSpec : specification.getDatasets().values()) {
      result = getVerifier(DatasetCreationSpec.class).verify(appId, dataSetCreateSpec);
      if (!result.isSuccess()) {
        throw new RuntimeException(result.getMessage());
      }
      String dsName = dataSetCreateSpec.getInstanceName();
      DatasetSpecification existingSpec = dsFramework.getDatasetSpec(dsName);
      if (existingSpec != null && !existingSpec.getType().equals(dataSetCreateSpec.getTypeName())) {
          // New app trying to deploy an dataset with same instanceName but different Type than that of existing.
          throw new DataSetException
            (String.format("Cannot Deploy Dataset : %s with Type : %s : Dataset with different Type Already Exists",
                           dsName, dataSetCreateSpec.getTypeName()));
        }
    }

    for (StreamSpecification spec : specification.getStreams().values()) {
      result = getVerifier(StreamSpecification.class).verify(appId, spec);
      if (!result.isSuccess()) {
        throw new RuntimeException(result.getMessage());
      }
    }

    Iterable<ProgramSpecification> programSpecs = Iterables.concat(specification.getFlows().values(),
                                                                   specification.getMapReduce().values(),
                                                                   specification.getProcedures().values(),
                                                                   specification.getWorkflows().values());

    for (ProgramSpecification programSpec : programSpecs) {
      result = getVerifier(programSpec.getClass()).verify(appId, programSpec);
      if (!result.isSuccess()) {
        throw new RuntimeException(result.getMessage());
      }
    }

    // Emit the input to next stage.
    emit(input);
View Full Code Here

Examples of org.jboss.as.console.client.shared.subsys.jca.VerifyConnectionOp.VerifyResult

        operation.get(OP).set("test-connection-in-pool");

        dispatcher.execute(new DMRAction(operation), new AsyncCallback<DMRResponse>() {
            @Override
            public void onFailure(final Throwable caught) {
                show(new VerifyResult(caught));
            }

            @Override
            public void onSuccess(DMRResponse response) {
                VerifyResult verifyResult;
                ModelNode result = response.get();
                ResponseWrapper<Boolean> wrapped = new ResponseWrapper<Boolean>(!result.isFailure(), result);

                if (wrapped.getUnderlying()) {
                    verifyResult = new VerifyResult(true,
                            Console.MESSAGES.verify_datasource_successful_message(dsName));
                } else {
                    verifyResult = new VerifyResult(false, Console.MESSAGES.verify_datasource_failed_message(dsName),
                            result.getFailureDescription());
                }
                show(verifyResult);
            }
View Full Code Here

Examples of org.jboss.as.console.client.shared.subsys.jca.VerifyConnectionOp.VerifyResult

        operation.get(OP).set("test-connection-in-pool");

        dispatcher.execute(new DMRAction(operation), new AsyncCallback<DMRResponse>() {
            @Override
            public void onFailure(final Throwable caught) {
                show(new VerifyResult(caught));
            }

            @Override
            public void onSuccess(DMRResponse response) {
                VerifyResult verifyResult;
                ModelNode result = response.get();
                ResponseWrapper<Boolean> wrapped = new ResponseWrapper<Boolean>(!result.isFailure(), result);

                if (wrapped.getUnderlying()) {
                    verifyResult = new VerifyResult(true,
                            Console.MESSAGES.verify_datasource_successful_message(dsName));
                } else {
                    verifyResult = new VerifyResult(false, Console.MESSAGES.verify_datasource_failed_message(dsName),
                            result.getFailureDescription());
                }
                show(verifyResult);
            }
View Full Code Here

Examples of org.jboss.as.console.client.shared.subsys.jca.VerifyConnectionOp.VerifyResult

        operation.get(OP).set("test-connection-in-pool");

        dispatcher.execute(new DMRAction(operation), new AsyncCallback<DMRResponse>() {
            @Override
            public void onFailure(final Throwable caught) {
                show(new VerifyResult(caught));
            }

            @Override
            public void onSuccess(DMRResponse response) {
                VerifyResult verifyResult;
                ModelNode result = response.get();
                ResponseWrapper<Boolean> wrapped = new ResponseWrapper<Boolean>(!result.isFailure(), result);

                if (wrapped.getUnderlying()) {
                    verifyResult = new VerifyResult(true,
                            Console.MESSAGES.verify_datasource_successful_message(dsName));
                } else {
                    verifyResult = new VerifyResult(false, Console.MESSAGES.verify_datasource_failed_message(dsName),
                            result.getFailureDescription());
                }
                show(verifyResult);
            }
View Full Code Here

Examples of org.jboss.as.console.client.shared.subsys.jca.VerifyConnectionOp.VerifyResult

        operation.get(OP).set("test-connection-in-pool");

        dispatcher.execute(new DMRAction(operation), new AsyncCallback<DMRResponse>() {
            @Override
            public void onFailure(final Throwable caught) {
                show(new VerifyResult(caught));
            }

            @Override
            public void onSuccess(DMRResponse response) {
                VerifyResult verifyResult;
                ModelNode result = response.get();
                ResponseWrapper<Boolean> wrapped = new ResponseWrapper<Boolean>(!result.isFailure(), result);

                if (wrapped.getUnderlying()) {
                    verifyResult = new VerifyResult(true,
                            Console.MESSAGES.verify_datasource_successful_message(dsName));
                } else {
                    verifyResult = new VerifyResult(false, Console.MESSAGES.verify_datasource_failed_message(dsName),
                            result.getFailureDescription());
                }
                show(verifyResult);
            }
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.