Versions Compared

Key

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

GET /v1/healthcheck
    org.onap.policy.clamp.clds.service.CldsHealthcheckService.gethealthcheck()
    return: org.onap.policy.clamp.clds.model.CldsHealthCheck

GET /v1/user/getUser
    org.onap.policy.clamp.authorization.UserService?method=getUser()
    return: java.lang.String

GET /v2/loop/getAllNames
    org.onap.policy.clamp.loop.LoopController.getLoopNames()
    return: java.lang.String[]

...

PUT /v2/acm/putToscaInstantiationStateChange
    <to uri="direct:put-tosca-instantiation"/>
    return: java.lang.String

Redirection

Clamp Currently clamp is also used as router , several end points are just redirection to Api and , Pap and could be removed. Policy-guy could use an external router/gateway or direct call. Anyway clamp is still need to call Api and Pap, Dcae, Cds and Acm runtime.

Model

Clamp uses its domain objects (JPA entities) directly in its REST endpoints. Controllers receive the body (in POST and PUT) as JsonArray.

Security

Users are store into clds/clds-users.json, it contains user, password and permissions. to handle permission clamp is using Spring Security.Users and permissions should be decouple using roles and the application should be use Spring Security annotationsusing Spring Security.

Users and permissions should be decouple using roles and the application should be use Spring Security annotations.

Properties

  • clamp runtime: multi properties file and mapping implemented manually
  • clamp runtime acm: properties file is automatically mapped to a Properties bean using @ConfigurationPropertiesScan and @ConfigurationProperties. Multi properties file is already supported by SpringBoot using @PropertySource.

Logging

  • clamp runtime: for each end point calls a Java method to log description of the endpoint (e.g. "Create Loop" and "Successful" when finished) and to insert into MDC "X-ONAP-RequestID", "X-ONAP-InvocationID" and "X-ONAP-PartnerName"
  • clamp runtime acm: using RequestResponseLoggingFilter filter class we can log the url (e.g. "POST /v2/loop/create/{loopName}?templateName={templateName}" and "Successful" when finished)  and insert into MDC "X-ONAP-RequestID", "X-ONAP-InvocationID" and "X-ONAP-PartnerName"

...

  • clamp runtime: for each end point implements a try catch block
  • clamp runtime acm: implements a @RestControllerAdvice (by GlobalControllerExceptionHandler class) and Spring ErrorController (by RuntimeErrorController class).

Unit Test

Each service/component should be use Constructor-Based Dependency Injection. So we can remove @SpringBootTest annotation in unit tests increasing performance in compile time.