Skip to content

Commit

Permalink
Java links
Browse files Browse the repository at this point in the history
  • Loading branch information
BraunMatthias committed Mar 5, 2024
1 parent 16e5301 commit ef52090
Show file tree
Hide file tree
Showing 17 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion about/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Following is an index of the features currently covered by CAP, with status and
| [Temporal Data](../guides/temporal-data) | <X/> | <X/> | <X/> |
| [Managed Data](../guides/domain-modeling#managed-data) | <X/> | <X/> | <X/> |
| [Dynamic Extensibility](../guides/extensibility/) | <X/> | <X/> | <X/> |
| Monitoring / Logging [[Node.js](../node.js/cds-log)\|[Java](../java/observability#logging)] | <Na/> | <X/> | <X/> |
| Monitoring / Logging [[Node.js](../node.js/cds-log)\|[Java](../java/operating-applications/observability#logging)] | <Na/> | <X/> | <X/> |
| Audit Logging [[Node.js](../guides/data-privacy/audit-logging)\|[Java](../java/auditlog)] | <Na/> | <X/> | <X/> |


Expand Down
2 changes: 1 addition & 1 deletion get-started/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ module.exports = class say {

<div class="impl java">

... for example, using a [CAP Java](../java/provisioning-api) custom handler like this:
... for example, using a [CAP Java](../java/event-handlers) custom handler like this:

::: code-group

Expand Down
2 changes: 1 addition & 1 deletion get-started/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ module.exports = cds.server

### How can I make sure that a user passes all authorization checks?

A new option `privilegedUser()` can be leveraged when [defining](../java/handlers/request-contexts#defining-requestcontext) your own `RequestContext`. Adding this introduces a user, which passes all authorization restrictions. This is useful for scenarios, where a restricted service should be called through the [local service consumption API](../java/services) either in a request thread regardless of the original user's authorizations or in a background thread.
A new option `privilegedUser()` can be leveraged when [defining](../java/event-handlers/request-contexts#defining-requestcontext) your own `RequestContext`. Adding this introduces a user, which passes all authorization restrictions. This is useful for scenarios, where a restricted service should be called through the [local service consumption API](../java/services) either in a request thread regardless of the original user's authorizations or in a background thread.

### Why do I get a "User should not exist" error during build time?

Expand Down
2 changes: 1 addition & 1 deletion guides/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ cds.db.run (`SELECT from sqlite_schema where name like ?`, name)
<div markdown="1" class="impl java">
Use Spring's [JDBC Template](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jdbc/core/JdbcTemplate.html) to [leverage native database features](../java/advanced#jdbctemplate) as follows:
Use Spring's [JDBC Template](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/jdbc/core/JdbcTemplate.html) to [leverage native database features](../java/cqn-services/persistence-services#jdbctemplate) as follows:
```java
@Autowired
Expand Down
4 changes: 2 additions & 2 deletions guides/messaging/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class ReviewsService extends cds.ApplicationService { async init() {
}}
```
[Learn more about `srv.emit()` in Node.js.](../../node.js/core-services#srv-emit-event){.learn-more}
[Learn more about `srv.emit()` in Java.](../../java/consumption-api#an-event-based-api){.learn-more}
[Learn more about `srv.emit()` in Java.](../../java/services#an-event-based-api){.learn-more}

Method `srv.emit()` is used to emit event messages. As you can see, emitters usually emit messages to themselves, that is, `this`, to inform potential listeners about certain events. Emitters don't know the receivers of the events they emit. There might be none, there might be local ones in the same process, or remote ones in separate processes.

Expand All @@ -186,7 +186,7 @@ Find the code to receive events in *[@capire/bookstore/srv/mashup.js](https://gi
```

[Learn more about registering event handlers in Node.js.](../../node.js/core-services#srv-on-before-after){.learn-more}
[Learn more about registering event handlers in Java.](../../java/provisioning-api#introduction-to-event-handlers){.learn-more}
[Learn more about registering event handlers in Java.](../../java/event-handlers#introduction-to-event-handlers){.learn-more}

The message payload is in the `data` property of the inbound `msg` object.

Expand Down
6 changes: 3 additions & 3 deletions guides/providing-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ The remaining cases that need custom handlers, reduce to real custom logic, spec
public class FooServiceImpl implements EventHandler {...}
```

[Learn more about Event Handler classes in Java.](../java/provisioning-api#handlerclasses){.learn-more}
[Learn more about Event Handler classes in Java.](../java/event-handlers#handlerclasses){.learn-more}



Expand Down Expand Up @@ -946,7 +946,7 @@ public class BookshopServiceImpl implements EventHandler {

[Learn more about **adding event handlers in Node.js**.](../node.js/core-services#srv-on-before-after){.learn-more}

[Learn more about **adding event handlers in Java**.](../java/provisioning-api#handlerclasses){.learn-more}
[Learn more about **adding event handlers in Java**.](../java/event-handlers#handlerclasses){.learn-more}



Expand Down Expand Up @@ -980,7 +980,7 @@ Event handlers all get a uniform _Request_/_Event Message_ context object as the
- The `tenant` using your SaaS application, if enabled

[Learn more about **implementing event handlers in Node.js**.](../node.js/events#cds-request){.learn-more}
[Learn more about **implementing event handlers in Java**.](../java/provisioning-api#eventcontext){.learn-more}
[Learn more about **implementing event handlers in Java**.](../java/event-handlers#eventcontext){.learn-more}



Expand Down
12 changes: 6 additions & 6 deletions guides/using-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ You can use dependency injection to get access to the remote service:
CqnService bupa;
```

Then execute your queries using the [Querying API](../java/query-execution):
Then execute your queries using the [Querying API](../java/working-with-cql/query-execution):

```java
CqnSelect select = Select.from(ABusinessPartner_.class).limit(100);
Expand Down Expand Up @@ -1034,7 +1034,7 @@ cds:
type: "odata-v2"
```
[Learn more about configuring destinations for Java.](../java/remote-services#configuring-the-destination){.learn-more}
[Learn more about configuring destinations for Java.](../java/cqn-services/remote-services#configuring-the-destination){.learn-more}
#### Use Application Defined Destinations { #app-defined-destinations}
Expand Down Expand Up @@ -1177,7 +1177,7 @@ cds:
type: "odata-v2"
```

[Learn more about programmatic destination registration.](../java/remote-services#programmatic-destination-registration){.learn-more} [See examples for different authentication types.](../java/remote-services#register-destinations){.learn-more}
[Learn more about programmatic destination registration.](../java/cqn-services/remote-services#programmatic-destination-registration){.learn-more} [See examples for different authentication types.](../java/cqn-services/remote-services#register-destinations){.learn-more}


### Connect to Remote Services Locally
Expand Down Expand Up @@ -1586,7 +1586,7 @@ Kyma clusters run an [Istio](https://istio.io/) service mesh. Istio allows to [c
CAP adds headers for request correlation to its outbound requests that allows logging and tracing across micro services.

[Learn more about request correlation in Node.js.](../node.js/cds-log#node-observability-correlation){.learn-more .impl .node}
[Learn more about request correlation in Java.](../java/observability#correlation-ids){.learn-more .impl .java}
[Learn more about request correlation in Java.](../java/operating-applications/observability#correlation-ids){.learn-more .impl .java}

<div id="aftertracing" />

Expand Down Expand Up @@ -1673,5 +1673,5 @@ This list specifies the properties for application defined destinations.
| NoAuthentication | <Y/> | <Y/> |
| BasicAuthentication | <Y/> | <Y/> |
| TokenForwarding | <Y/> | <X/><br>Use `forwardAuthToken` |
| OAuth2ClientCredentials | [code only](../java/remote-services#oauth2-client-credentials) | <X/> |
| UserTokenAuthentication | [code only](../java/remote-services#user-token-authentication) | <X/> |
| OAuth2ClientCredentials | [code only](../java/cqn-services/remote-services#oauth2-client-credentials) | <X/> |
| UserTokenAuthentication | [code only](../java/cqn-services/remote-services#user-token-authentication) | <X/> |
2 changes: 1 addition & 1 deletion java/building-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public class SampleAdapter extends HttpServlet {

As mentioned previously, a protocol adapter maps incoming requests to CQL statements and executes them on the right [`ApplicationService`](https://cap.cloud.sap/docs/java/application-services) according to the `HttpServletRequest`'s request-path. In order to have all relevant `ApplicationServices` ready at runtime, you can call `runtime.getServiceCatalog().getServices(ApplicationService.class)` in the adapter's constructor to load all `ApplicationServices`. Then select the ones relevant for this protocol adapter to have them ready, for example in a Map, for serving requests in `service()`.

When handling incoming requests at runtime, you need to extract the request path and parameters from the incoming HttpServletRequest. Then, you can use CQL API from the `cds4j-api` module to [create CQL](https://cap.cloud.sap/docs/java/working-with-cql/query-api) corresponding to the extracted information. This statement then needs to be executed with [`ApplicationService.run()`](https://cap.cloud.sap/docs/java/query-execution). The returned result then needs to be mapped to the result format that is suitable for the protocol handled by the adapter. For REST, it would be some canonical JSON serialization of the returned objects.
When handling incoming requests at runtime, you need to extract the request path and parameters from the incoming HttpServletRequest. Then, you can use CQL API from the `cds4j-api` module to [create CQL](https://cap.cloud.sap/docs/java/working-with-cql/query-api) corresponding to the extracted information. This statement then needs to be executed with [`ApplicationService.run()`](https://cap.cloud.sap/docs/java/working-with-cql/query-execution). The returned result then needs to be mapped to the result format that is suitable for the protocol handled by the adapter. For REST, it would be some canonical JSON serialization of the returned objects.

REST request:

Expand Down
2 changes: 1 addition & 1 deletion java/cds-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ status: released
redirect_from: java/data
uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/9186ed9ab00842e1a31309ff1be38792.html
---
<!--- Migrated: @external/java/040-Data/index.md -> @external/java/dataindex.md -->
<!--- Migrated: @external/java/040-Data/index.md -> @external/java/cds-dataindex.md -->

# Working with Data

Expand Down
4 changes: 2 additions & 2 deletions java/cqn-services/persistence-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ SAP HANA Cloud is the CAP standard database recommended for productive use with

1. Write operations through views that can't be resolved by the CAP runtime are passed through to SAP HANA Cloud. Limitations are described in the [SAP HANA Cloud documentation](https://help.sap.com/docs/HANA_CLOUD_DATABASE/c1d3f60099654ecfb3fe36ac93c121bb/20d5fa9b75191014a33eee92692f1702.html#loio20d5fa9b75191014a33eee92692f1702__section_trx_ckh_qdb).

2. [Shared locks](../java/query-execution#pessimistic-locking) are supported on SAP HANA Cloud only.
2. [Shared locks](../java/working-with-cql/query-execution#pessimistic-locking) are supported on SAP HANA Cloud only.

3. When using `String` elements in locale-specific ordering relations (`>`, `<`, ... , `between`), a statement-wide collation is added, which can have negative impact on the performance. If locale-specific ordering isn't required for specific `String` elements, annotate the element with `@cds.collate: false`.

Expand Down Expand Up @@ -147,7 +147,7 @@ cds.sql.hana.optimizationMode: hex
```

:::tip
Use the [hints](../java/query-execution#hana-hints) `hdb.USE_HEX_PLAN` and `hdb.NO_USE_HEX_PLAN` to overrule the configured optimization mode per statement.
Use the [hints](../java/working-with-cql/query-execution#hana-hints) `hdb.USE_HEX_PLAN` and `hdb.NO_USE_HEX_PLAN` to overrule the configured optimization mode per statement.
:::

### PostgreSQL { #postgresql-1 }
Expand Down
2 changes: 1 addition & 1 deletion java/cqn-services/remote-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ status: released
redirect_from: java/remote-services
uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/9186ed9ab00842e1a31309ff1be38792.html
---
<!--- Migrated: @external/java/remote-services.md -> @external/java/remote-services.md -->
<!--- Migrated: @external/java/cqn-services/remote-services.md -> @external/java/cqn-services/remote-services.md -->

# Remote Services
<style scoped>
Expand Down
2 changes: 1 addition & 1 deletion java/messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ synopsis: >
status: released
redirect_from: java/messaging-foundation
---
<!--- Migrated: @external/java/301-messaging-foundation0-index.md -> @external/java/messaging-foundation.md -->
<!--- Migrated: @external/java/301-messaging-foundation0-index.md -> @external/java/messaging.md -->

<script setup>
import { h } from 'vue'
Expand Down
6 changes: 3 additions & 3 deletions java/operating-applications/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ synopsis: >
Presents a set of recommended tools that help to understand the current status of running CAP services.
status: released
---
<!--- Migrated: @external/java/700-observability0-index.md -> @external/java/observability.md -->
<!--- Migrated: @external/java/700-observability0-index.md -> @external/java/operating-applications/observability.md -->

# Observability
<style scoped>
Expand Down Expand Up @@ -394,7 +394,7 @@ How to configure a Dynatrace connection to your CAP Java application is describe



<!--- Migrated: @external/java/700-observability04-metrics.md -> @external/java/observabilitymetrics.md -->
<!--- Migrated: @external/java/700-observability04-metrics.md -> @external/java/operating-applications/observabilitymetrics.md -->
### Spring Boot Actuators { #spring-boot-actuators }

Metrics are mainly referring to operational information about various resources of the running application, such as HTTP sessions and worker threads, JDBC connections, JVM memory including garbage collector statistics and so on.
Expand Down Expand Up @@ -462,7 +462,7 @@ The `AppActuator` bean registers an actuator with name `app` that exposes a simp



<!--- Migrated: @external/java/700-observability03-availability.md -> @external/java/observabilityavailability.md -->
<!--- Migrated: @external/java/700-observability03-availability.md -> @external/java/operating-applications/observabilityavailability.md -->
### Availability { #availability}

This section describes how to set up an endpoint for availability or health check. At a first glance, providing such a health check endpoint sounds like a simple task. But some aspects need to be considered:
Expand Down
2 changes: 1 addition & 1 deletion java/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public class ActuatorSecurityConfig {

You're free to configure any authentication method according to your needs. CAP isn't bound to any specific authentication method or user representation such as introduced with XSUAA, it rather runs the requests based on a [user abstraction](../guides/authorization#user-claims). The CAP user of a request is represented by a [UserInfo](https://www.javadoc.io/doc/com.sap.cds/cds-services-api/latest/com/sap/cds/services/request/UserInfo.html) object that can be retrieved from the [RequestContext](https://www.javadoc.io/doc/com.sap.cds/cds-services-api/latest/com/sap/cds/services/request/RequestContext.html) as explained in [Enforcement API & Custom Handlers](#enforcement-api).

Hence, if you bring your own authentication, you've to transform the authenticated user and inject as `UserInfo` to the current request. This is done by means of [UserInfoProvider](https://www.javadoc.io/doc/com.sap.cds/cds-services-api/latest/com/sap/cds/services/runtime/UserInfoProvider.html) interface that can be implemented as Spring bean as demonstrated in [Registering Global Parameter Providers](../java/request-contexts#global-providers).
Hence, if you bring your own authentication, you've to transform the authenticated user and inject as `UserInfo` to the current request. This is done by means of [UserInfoProvider](https://www.javadoc.io/doc/com.sap.cds/cds-services-api/latest/com/sap/cds/services/runtime/UserInfoProvider.html) interface that can be implemented as Spring bean as demonstrated in [Registering Global Parameter Providers](../java/event-handlers/request-contexts#global-providers).
More frequently you might have the requirement to just adapt the request's `UserInfo` which is possible with the same interface:


Expand Down
2 changes: 1 addition & 1 deletion java/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ redirect_from:
status: released
uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/9186ed9ab00842e1a31309ff1be38792.html
---
<!--- Migrated: @external/java/025-Services/0-index.md -> @external/java/consumption-api.md -->
<!--- Migrated: @external/java/025-Services/0-index.md -> @external/java/services.md -->

# Services
<style scoped>
Expand Down
2 changes: 1 addition & 1 deletion java/working-with-cql/query-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ The Query Builder API supports using expressions in many places. Expressions con

### Entity References {#entity-refs}

Entity references specify entity sets. They can be used to define the target entity set of a [CQL](../cds/cql) statement. They can either be defined inline using lambda expressions in the Query Builder (see [Target Entity Sets](#target-entity-sets)) or via the `CQL.entity` method, which is available in an _untyped_ version as well as in a _typed_ version that uses the generated [model interfaces](../java/advanced#model-interfaces). The following example shows an entity reference describing the set of *authors* that have published books in the year 2020:
Entity references specify entity sets. They can be used to define the target entity set of a [CQL](../cds/cql) statement. They can either be defined inline using lambda expressions in the Query Builder (see [Target Entity Sets](#target-entity-sets)) or via the `CQL.entity` method, which is available in an _untyped_ version as well as in a _typed_ version that uses the generated [model interfaces](../java/cqn-services/persistence-services#model-interfaces). The following example shows an entity reference describing the set of *authors* that have published books in the year 2020:

```java
import com.sap.cds.ql.CQL;
Expand Down
2 changes: 1 addition & 1 deletion java/working-with-cql/query-execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ status: released
redirect_from: java/query-execution
uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/9186ed9ab00842e1a31309ff1be38792.html
---
<!--- Migrated: @external/java/070-Executing-Queries/0-index.md -> @external/java/query-execution.md -->
<!--- Migrated: @external/java/070-Executing-Queries/0-index.md -> @external/java/working-with-cql/query-execution.md -->

# Executing CQL Statements
<style scoped>
Expand Down

0 comments on commit ef52090

Please sign in to comment.