Skip to content

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

License

Notifications You must be signed in to change notification settings

jsoagger/jsoagger-bridge

Repository files navigation

                                                                                    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.

About

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

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages