All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.marklogic.hub.dataservices.CustomStepService Maven / Gradle / Ivy

There is a newer version: 6.1.1
Show newest version
package com.marklogic.hub.dataservices;

// IMPORTANT: Do not edit. This file is generated.

import com.marklogic.client.DatabaseClient;
import com.marklogic.client.impl.BaseProxy;
import com.marklogic.client.io.Format;
import com.marklogic.client.io.marker.JSONWriteHandle;

/**
 * Provides a set of operations on the database server
 */
public interface CustomStepService {
    /**
     * Creates a CustomStepService object for executing operations on the database server.
     *
     * The DatabaseClientFactory class can create the DatabaseClient parameter. A single
     * client object can be used for any number of requests and in multiple threads.
     *
     * @param db	provides a client for communicating with the database server
     * @return	an object for executing database operations
     */
    static CustomStepService on(DatabaseClient db) {
      return on(db, null);
    }
    /**
     * Creates a CustomStepService object for executing operations on the database server.
     *
     * The DatabaseClientFactory class can create the DatabaseClient parameter. A single
     * client object can be used for any number of requests and in multiple threads.
     *
     * The service declaration uses a custom implementation of the same service instead
     * of the default implementation of the service by specifying an endpoint directory
     * in the modules database with the implementation. A service.json file with the
     * declaration can be read with FileHandle or a string serialization of the JSON
     * declaration with StringHandle.
     *
     * @param db	provides a client for communicating with the database server
     * @param serviceDeclaration	substitutes a custom implementation of the service
     * @return	an object for executing database operations
     */
    static CustomStepService on(DatabaseClient db, JSONWriteHandle serviceDeclaration) {
        final class CustomStepServiceImpl implements CustomStepService {
            private final DatabaseClient dbClient;
            private final BaseProxy baseProxy;

            private final BaseProxy.DBFunctionRequest req_updateCustomStep;
            private final BaseProxy.DBFunctionRequest req_getCustomStep;
            private final BaseProxy.DBFunctionRequest req_getCustomSteps;

            CustomStepServiceImpl(DatabaseClient dbClient, JSONWriteHandle servDecl) {
                this.dbClient  = dbClient;
                this.baseProxy = new BaseProxy("/data-hub/data-services/customStep/", servDecl);

                this.req_updateCustomStep = this.baseProxy.request(
                    "updateCustomStep.mjs", BaseProxy.ParameterValuesKind.SINGLE_NODE);
                this.req_getCustomStep = this.baseProxy.request(
                    "getCustomStep.mjs", BaseProxy.ParameterValuesKind.SINGLE_ATOMIC);
                this.req_getCustomSteps = this.baseProxy.request(
                    "getCustomSteps.mjs", BaseProxy.ParameterValuesKind.NONE);
            }

            @Override
            public com.fasterxml.jackson.databind.JsonNode updateCustomStep(com.fasterxml.jackson.databind.JsonNode stepProperties) {
                return updateCustomStep(
                    this.req_updateCustomStep.on(this.dbClient), stepProperties
                    );
            }
            private com.fasterxml.jackson.databind.JsonNode updateCustomStep(BaseProxy.DBFunctionRequest request, com.fasterxml.jackson.databind.JsonNode stepProperties) {
              return BaseProxy.JsonDocumentType.toJsonNode(
                request
                      .withParams(
                          BaseProxy.documentParam("stepProperties", false, BaseProxy.JsonDocumentType.fromJsonNode(stepProperties))
                          ).responseSingle(false, Format.JSON)
                );
            }

            @Override
            public com.fasterxml.jackson.databind.JsonNode getCustomStep(String stepName) {
                return getCustomStep(
                    this.req_getCustomStep.on(this.dbClient), stepName
                    );
            }
            private com.fasterxml.jackson.databind.JsonNode getCustomStep(BaseProxy.DBFunctionRequest request, String stepName) {
              return BaseProxy.JsonDocumentType.toJsonNode(
                request
                      .withParams(
                          BaseProxy.atomicParam("stepName", false, BaseProxy.StringType.fromString(stepName))
                          ).responseSingle(false, Format.JSON)
                );
            }

            @Override
            public com.fasterxml.jackson.databind.JsonNode getCustomSteps() {
                return getCustomSteps(
                    this.req_getCustomSteps.on(this.dbClient)
                    );
            }
            private com.fasterxml.jackson.databind.JsonNode getCustomSteps(BaseProxy.DBFunctionRequest request) {
              return BaseProxy.JsonDocumentType.toJsonNode(
                request.responseSingle(false, Format.JSON)
                );
            }
        }

        return new CustomStepServiceImpl(db, serviceDeclaration);
    }

  /**
   * Updates the custom step and returns the updated step
   *
   * @param stepProperties	provides input
   * @return	as output
   */
    com.fasterxml.jackson.databind.JsonNode updateCustomStep(com.fasterxml.jackson.databind.JsonNode stepProperties);

  /**
   * Invokes the getCustomStep operation on the database server
   *
   * @param stepName	provides input
   * @return	as output
   */
    com.fasterxml.jackson.databind.JsonNode getCustomStep(String stepName);

  /**
   * Invokes the getCustomSteps operation on the database server
   *
   * 
   * @return	as output
   */
    com.fasterxml.jackson.databind.JsonNode getCustomSteps();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy