Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Available with the Syndeia Cloud download. Check with your admin.
  2. Available with the tutorials in all three Syndeia clients - MagicDraw plugin, Rhapsody plugin, and Syndeia Standalone.

...


CloudApiDemo

...

This project is a Java example, that shows how to call various endpoints exposed by the Syndeia Cloud API.###

Code organization

...

This is a Maven project with a `pompom.xml` xml file that mentions all the dependencies on the external Java packages.

The source code is organized in three packages -* **

  • com.intercax.syndeia.domain

...

  • - contains various domain model classes (like

...

  • Repository, Container, Artifact,

...

  • Relation etc.)

...

  • com.intercax.syndeia.services

...

  • - contains various classes like

...

  • CloudService, CoreCloudService, CloudServiceUrlHelper, GenericrestClient and

...

  • ReponseTypesForGson classes

...

  • com.intercax.syndeia.utils

...

  • - contains

...

  • Either and

...

  • TriFunction utility classes

A few of the subpackages of the `comcom.intercax.syndeia.domain` domain package, are as under -* **

  • com.intercax.syndeia.domain.forms

...

  • - contains classes that are to used to call POST / PUT APIs to sign-up and sign-in a

user
* **com.intercax.syndeia.domain.responses** - contains classes that are used to deserialize the string response of Syndeia
Cloud API endpoints###

How do I get set up?

...

...

  • You can open this project in IntelliJ IDEA or Eclipse, or any other suitable editor like Visual Studio Code.

...

  • For Eclipse, use Import -> Maven -> Existing Maven Projects (by pointing to the pom.xml file) or Import -> General -> Existing projects into Workspace

(by pointing to the .project file)
* Before running this code, you need to make sure that the Syndeia Cloud API is running
* You can run the tests in `comcom.intercax.syndeia.services.CloudServiceTests` CloudServiceTests to see how a particular Syndeia Cloud API endpoint is called
* Alternatively, you can run the `main` main method of the `comcom.intercax.syndeia.CloudApiDemo` CloudApiDemo project to see examples of invoking a few of the
Syndeia Cloud API endpoints
* Both the main method and the tests assume some values (like the IP address, port, username and password) for where the Syndeia Cloud API is running.
**So before running either the tests or the main method, please get the required credentials from Syndeia Cloud administrator and use the relevant values.**###

How to extend this code (for trying out other Syndeia Cloud API endpoints)

...

...

  • You need to figure out the URL of the particular Syndeia Cloud API endpoint, whether that endpoint is exposed over HTTP

Get, Post, Put, Delete (verbs) methods, and if it accepts any parameters
* Typically, the Post and Put methods expect some payload (data in JSON format) for the resource that has to be created
/ updated on the server
* The Get methods might also need some values for parameters that are part of the URL
* Most likely, there will be a method in the `comcom.intercax.syndeia.services.CloudServiceUrlHelper` CloudServiceUrlHelper class that will be
returning a correct URL by accepting (a few) parameters - if such a method is missing, you may add one accordingly
* Finally, you'll need to add a new method to the `comcom.intercax.syndeia.services.CloudService` CloudService class and use the URL
returned by one of the methods in `CloudServiceUrlHelper` CloudServiceUrlHelper and then passing this URL and the type of response expected
to one of the (`getget, getAll`getAll) methods in `CoreCloudService` CoreCloudService class
* Typically, the methods in the `comcom.intercax.syndeia.services.CloudService` CloudService class return `Either<ErrorResponse, *Response<T>>` Response<T>>where -
* *Response is one of `ObjResponse` ObjResponse(for single values), `SeqResponse` SeqResponse(for a list of values) or `CreatedResponse` CreatedResponse` (if
something got created on the server)
* T is one of the domain objects from the **com.intercax.syndeia.domain** package###

Typical API calling pattern

...

// A method in the CloudService class

...



public Either&lt;ErrorResponse, SeqResponse&lt;Domain>> getAllDomainObjects() {

...


    return coreCloudService.getAll(cloudServiceUrlHelper.getXyzApiEndpointUrl(), typeOfSeqResponseOfDomain);

...


}

...

Who do I talk to?

...

...

  • Please get in touch with the

...

...

  • for more details.