Coder Social home page Coder Social logo

jsoagger / jsoagger-bridge Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 469 KB

Load data from backend services or legacy services. Emagin Bridge contains as many operations as exposed REST operations in Emagin Services.

License: Apache License 2.0

Java 100.00%
java rest https json javascript

jsoagger-bridge's Introduction

                                                                                    Build Status License

Overview

JSoagger Bridge regroups oparations for loading data from backend services or legacy services. JSoagger Bridge contains as many operations as exposed REST service in JSoagger Service.

It uses OkHttp to consume remote REST services.

 

Example

A promote lifecyle operation

public class PromoteOperation implements IOperation {


  /**
   * Constructor
   */
  public PromoteOperation() {
    super();
  }


  /**
   * @{inheritedDoc}
   */
  @Override
  public void doOperation(JsonObject params,
      Consumer<IOperationResult> resultHandler,
      Consumer<Throwable> exHandler) {
    try {
      IOperationResult result = CloudServicesLocator.lifecycleManagedApi.promote(params);
      resultHandler.accept(result);
    }
    catch (Exception e) {

      exHandler.accept(e);
    }
  }
}

And LifecyleManagedApi cloud services REST call:

public IOperationResult promote(JsonObject query) {
    try {
      String oid = query.get("fullId").getAsString();
      String byPathUrl = rootUrl.concat(String.format(PROMOTE_URL, oid));
      IOperationResult result = doPost(query, byPathUrl, SingleResult.class);
      return result;
    }
    catch (Exception e) {
      return IOperationResult.getGeneralSingleResultError();
    }
  }

Project

Contributing

contributions welcome

Please read [CONTRIBUTING.md] for details on our code of conduct, and the process for submitting pull requests to us.

Authors

Licence

License

This project is licensed under Apache Licence V2.

jsoagger-bridge's People

Contributors

rmvonji avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.