Skip to content

Commit e9f6b9b

Browse files
authored
Merge pull request #68 from oracle/atael-doc-updates
Java doc links, typos, and bugs
2 parents 38c5b26 + f15d3c9 commit e9f6b9b

File tree

14 files changed

+157
-169
lines changed

14 files changed

+157
-169
lines changed

docs/src/main/asciidoc/adb.adoc

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ https://docs.oracle.com/en/cloud/paas/atp-cloud/index.html[Autonomous Database]
88
on self-driving Oracle Autonomous Database technology to deliver automated patching, upgrades, and tuning, including
99
performing all routine database maintenance tasks while the system is running, without human intervention.
1010

11-
Maven coordinates, using <<getting-started.adoc#bill-of-materials, Spring Cloud OCI BOM>>:
11+
Maven coordinates:
1212

1313
[source,xml]
1414
----
@@ -30,19 +30,12 @@ dependencies {
3030
=== Using Autonomous Database
3131

3232
The starter automatically configures and registers an `AutonomousDb` bean in the Spring application context.
33-
The `AutonomousDb` bean (link[Javadoc]) can be used to create an Autonomous Database, get details of an Autonomous Database,
33+
The `AutonomousDb` bean (https://oracle.github.io/spring-cloud-oci/{project-version}/javadocs/com/oracle/cloud/spring/adb/package-summary.html[Javadoc]) can be used to create an Autonomous Database, get details of an Autonomous Database,
3434
delete an Autonomous Database and generate a wallet for an Autonomous Database.
3535

3636
[source,java]
3737
----
3838
@Autowired
39-
private Queue queue;
40-
41-
public void createQueue() {
42-
43-
String queueId = queue.createQueue("my-queue", <<compartmentId>>, <<deadLetterQueueDeliveryCount>>, <<retentionInSeconds>>);
44-
}
45-
@Autowired
4639
AutonomousDb autonomousDatabase;
4740
4841
public void createAutonomousDatabase() {

docs/src/main/asciidoc/core.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// Copyright (c) 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2023, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
33

44
[#spring-cloud-oci-core]
55
== Spring Cloud OCI Core
66

77
Spring Cloud OCI provides a Spring Boot starter to auto-configure the core components.
88

9-
Maven coordinates, using <<getting-started.adoc#bill-of-materials, Spring Cloud OCI BOM>>:
9+
Maven coordinates:
1010

1111
[source,xml]
1212
----

docs/src/main/asciidoc/aqjms.adoc renamed to docs/src/main/asciidoc/db_starters.adoc

Lines changed: 113 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// Copyright (c) 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
33

4-
[#AQ/JMS]
5-
== AQ/JMS
4+
[[database-spring-starters]]
5+
== Database Spring Boot Starters
6+
7+
=== AQ/JMS
68

79
This starter provides support for Oracle Transactional Event Queues (TxEventQ) and Oracle Advanced Queuing (AQ) as Java Message Service (JMS) providers. It depends on the Universal Connection Pool (UCP) starter.
810

@@ -28,13 +30,13 @@ dependencies {
2830
}
2931
----
3032

31-
=== Using AQ/JMS
33+
==== Using AQ/JMS
3234

3335
To configure your application to use Oracle Transactional Event Queues or Oracle Advanced Queuing, you must annotate you application with the `@EnableJms` annotation, and create the
3436
two following beans:
3537

3638
* A `JmsListenerContainerFactory<?>` bean, which can be created as shown in the following example. Note that you can override settings if you need to. Also, note that the name of the method defines the name of the factory, which you will use when creating JMS listeners.
37-
* A `MessageConverter` bean to map objects of your class representing the payload into a text based format (like JSON) that can be used in the actual messages.
39+
* A `MessageConverter` bean to map objects of your class representing the payload into a text based format (like JSON) that can be used in the actual messages.
3840

3941
**Note**: Any queues or topics that you want to use must be pre-created in the database. See [Sample Code](https://www.oracle.com/database/advanced-queuing/#rc30sample-code) for
4042
examples.
@@ -71,19 +73,19 @@ public class JmsSampleApplication {
7173
// You could override some of Boot's defaults here if necessary
7274
return factory;
7375
}
74-
76+
7577
@Bean
7678
public MessageConverter jacksonJmsMessageConverter() {
7779
MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter();
7880
converter.setTargetType(MessageType.TEXT);
7981
converter.setTypeIdPropertyName("_type");
8082
return converter;
8183
}
82-
84+
8385
public static void main(String[] args) {
8486
ConfigurableApplicationContext context = SpringApplication.run(JmsSampleApplication.class, args);
8587
}
86-
88+
8789
}
8890
----
8991

@@ -117,3 +119,107 @@ public class Receiver {
117119
----
118120

119121
**Note**: The starter uses the configuration for `spring.datasource` as the connection details for the Oracle Database hosting the queues and topics. If you wish to use a different configuration, you must use a named configuration, for example `spring.datasource.txeventq` and use Java configuration and annotate the configuration with the standard Spring `@Qualifier` annotation, specifying the correct name, for example `txevevntq`.
122+
123+
=== Universal Connection Pool
124+
125+
This starter provides a connection (data source) to an Oracle Database using Universal Connection Pool, which provides an efficient way to use database connections.
126+
127+
To add this starter to your project, add this Maven dependency:
128+
129+
[source,xml]
130+
----
131+
<dependency>
132+
<groupId>com.oracle.database.spring</groupId>
133+
<artifactId>oracle-spring-boot-starter-ucp</artifactId>
134+
<version>23.4.0</version>
135+
</dependency>
136+
----
137+
138+
For Gradle projects, add this dependency:
139+
140+
[source,subs="normal"]
141+
----
142+
dependencies {
143+
implementation 'com.oracle.database.spring:oracle-spring-boot-starter-ucp:23.4.0'
144+
}
145+
----
146+
147+
==== Using Universal Connection Pool
148+
149+
An Oracle data source is injected into your application and can be used normally. You must configure the data source as shown below, and you should also add either Spring Data JDBC or Spring Data JPA to your project.
150+
151+
To configure the data source, provide a `spring.datasource` object in your Spring `application.yaml`, or equivalent, as shown in the following example. The `oracleucp` entry is optional, and can be used to fine tune the configuration of the connection pool, if desired. For details of available settings, refer to the [JavaDoc](https://docs.oracle.com/en/database/oracle/oracle-database/21/jjuar/oracle/ucp/jdbc/UCPDataSource.html).
152+
153+
[source,yaml]
154+
----
155+
spring:
156+
jpa:
157+
hibernate:
158+
ddl-auto: validate
159+
properties:
160+
hibernate:
161+
dialect: org.hibernate.dialect.OracleDialect
162+
format_sql: true
163+
show-sql: true
164+
datasource:
165+
url: jdbc:oracle:thin:@//myhost:1521/pdb1
166+
username: username
167+
password: password
168+
driver-class-name: oracle.jdbc.OracleDriver
169+
type: oracle.ucp.jdbc.PoolDataSource
170+
oracleucp:
171+
connection-factory-class-name: oracle.jdbc.pool.OracleDataSource
172+
connection-pool-name: AccountConnectionPool
173+
initial-pool-size: 15
174+
min-pool-size: 10
175+
max-pool-size: 30
176+
----
177+
178+
The `spring.datasource.url` can be in the basic format (as previously shown), or in TNS format if your application uses Transparent Network Substrate (TNS).
179+
180+
Note that the connections to the database use the `DEDICATED` server by default. If you wish to use `SHARED` or `POOLED`, you can append that to the basic URL, or add it to the TNS names entry. For example, to use database resident pooled connections, you would change the URL shown in the previous example to the following:
181+
182+
[source,yaml]
183+
----
184+
datasource:
185+
url: jdbc:oracle:thin:@//myhost:1521/pdb1:pooled
186+
----
187+
188+
If you are using TNS, add `server=pooled` to the `connect_data`. For example:
189+
190+
[source,text]
191+
----
192+
mydb_tp = (description=
193+
(retry_count=20)
194+
(retry_delay=3)
195+
(address=(protocol=tcps)(port=1521)(host=myhost))
196+
(connect_data=(service_name=pdb1)(server=pooled))
197+
(security=(ssl_server_dn_match=yes)))
198+
----
199+
200+
If you prefer to use Java configuration, the data source can be configured as shown in the following example:
201+
202+
[source,java]
203+
----
204+
import oracle.jdbc.pool.OracleDataSource;
205+
import org.springframework.context.annotation.Bean;
206+
import org.springframework.context.annotation.Configuration;
207+
208+
import javax.sql.DataSource;
209+
import java.sql.SQLException;
210+
211+
@Configuration
212+
public class DataSourceConfiguration {
213+
214+
@Bean
215+
public DataSource dataSource() throws SQLException {
216+
OracleDataSource dataSource = new OracleDataSource();
217+
dataSource.setUser("account");
218+
dataSource.setPassword("password");
219+
dataSource.setURL("jdbc:oracle:thin:@//myhost:1521/pdb1");
220+
dataSource.setDataSourceName("AccountConnectionPool");
221+
return dataSource;
222+
}
223+
}
224+
----
225+

docs/src/main/asciidoc/function.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// Copyright (c) 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2023, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
33

44
[#cloud-function]
55
== Cloud Functions
66

77
https://docs.oracle.com/en-us/iaas/Content/Functions/Concepts/functionsoverview.htm[OCI Functions] is a fully managed, multi-tenant, highly scalable, on-demand, Functions-as-a-Service platform. It is built on enterprise-grade Oracle Cloud Infrastructure and powered by the Fn Project open source engine. Use OCI Functions when you want to focus on writing code to meet business needs. The Spring Cloud module for OCI Functions allows to invoke an OCI Function.
8-
A Spring Boot starter is provided to auto-configure the Function component.
8+
A Spring Boot starter is provided to autoconfigure the Function component.
99

10-
Maven coordinates, using <<getting-started.adoc#bill-of-materials, Spring Cloud OCI BOM>>:
10+
Maven coordinates:
1111

1212
[source,xml]
1313
----
@@ -29,7 +29,7 @@ dependencies {
2929
=== Using Cloud Functions
3030

3131
The starter automatically configures and registers a `Function` bean in the Spring application context.
32-
The `Function` bean (link[Javadoc]) can be used to invoke a function with parameter inputs 'functionOcid' and 'endpoint'
32+
The `Function` bean (https://oracle.github.io/spring-cloud-oci/{project-version}/javadocs/com/oracle/cloud/spring/function/package-summary.html[Javadoc]) can be used to invoke a function with parameter inputs 'functionOcid' and 'endpoint'
3333

3434
[source,java]
3535
----

docs/src/main/asciidoc/genai.adoc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
https://docs.oracle.com/en-us/iaas/Content/generative-ai/home.htm[OCI Generative AI] is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases, including chat and creating text embeddings.
88

9-
Maven coordinates, using <<getting-started.adoc#bill-of-materials, Spring Cloud OCI BOM>>:
9+
Maven coordinates:
1010

1111
[source,xml]
1212
----
@@ -28,12 +28,11 @@ dependencies {
2828
=== Using Generative AI Chat
2929

3030
The starter configures and registers a `ChatModel` bean in the Spring application context.
31-
The `ChatModel` bean (link[Javadoc]) can be used to interact with OCI Generative AI Chat Models.
31+
The `ChatModel` bean (https://oracle.github.io/spring-cloud-oci/{project-version}/javadocs/com/oracle/cloud/spring/genai/package-summary.html[Javadoc]) can be used to interact with OCI Generative AI Chat Models.
3232

3333
[source,java]
3434
----
3535
@Autowired
36-
@Autowired
3736
private ChatModel chatModel;
3837
3938
public void embed() {
@@ -44,7 +43,7 @@ public void embed() {
4443
=== Using Generative AI Embedding
4544

4645
The starter configures and registers an `EmbeddingModel` bean in the Spring application context.
47-
The `EmbeddingModel` bean (link[Javadoc]) can be used to create text embeddings using OCI Generative AI Embedding Models.
46+
The `EmbeddingModel` bean (https://oracle.github.io/spring-cloud-oci/{project-version}/javadocs/com/oracle/cloud/spring/genai/package-summary.html[Javadoc]) can be used to create text embeddings using OCI Generative AI Embedding Models.
4847

4948
[source,java]
5049
----
@@ -82,7 +81,6 @@ The Spring Boot Starter for Oracle Cloud Generative AI provides the following co
8281

8382
|===
8483

85-
8684
=== Sample
8785

8886
A sample application provided https://github.com/oracle/spring-cloud-oci/tree/main/spring-cloud-oci-samples/spring-cloud-oci-gen-ai-sample[here] contains the examples to demonstrates the usage of OCI Spring Cloud Generative AI module.

docs/src/main/asciidoc/index.adoc

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,35 @@
66

77
include::_attributes.adoc[]
88

9-
Documentation for version *{project-version}*
9+
Documentation for version *+{project-version}+*
1010

1111
== Introduction
1212

1313
Spring Cloud for OCI, part of the Spring Cloud umbrella project, eases the integration with hosted OCI Services. It offers a convenient way to interact with OCI provided services using well-known Spring idioms and APIs, such as storage resources. Developers can build their application around the hosted services without having to worry about infrastructure or maintenance.
1414

1515
include::getting-started.adoc[]
1616

17+
include::adb.adoc[]
18+
1719
include::core.adoc[]
1820

19-
include::storage.adoc[]
21+
include::function.adoc[]
2022

21-
include::notifications.adoc[]
23+
include::logging.adoc[]
2224

2325
include::genai.adoc[]
2426

25-
include::logging.adoc[]
26-
27-
include::function.adoc[]
27+
include::storage.adoc[]
2828

29-
include::streaming.adoc[]
29+
include::notifications.adoc[]
3030

3131
include::queues.adoc[]
3232

33-
include::adb.adoc[]
33+
include::streaming.adoc[]
3434

3535
include::vault.adoc[]
3636

37-
include::ucp.adoc[]
38-
39-
include::aqjms.adoc[]
37+
include::db_starters.adoc[]
4038

4139
== Configuration properties
4240

docs/src/main/asciidoc/logging.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// Copyright (c) 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2023, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
33

44
[#cloud-logging]
55
== Cloud Logging
66

77
https://docs.oracle.com/en-us/iaas/Content/Logging/home.htm[OCI Logging] service is a highly scalable and fully managed single pane of glass for all the logs in your tenancy. Logging provides access to logs from OCI resources. These logs include critical diagnostic information that describes how resources are performing and being accessed. Use Logging to enable, manage, and search Audit, Service, and Custom logs. The Spring Cloud module for OCI Logging allows ingesting logs associated with a logId.
8-
A Spring Boot starter is provided to auto-configure the Logging component.
8+
A Spring Boot starter is provided to autoconfigure the Logging component.
99

10-
Maven coordinates, using <<getting-started.adoc#bill-of-materials, Spring Cloud OCI BOM>>:
10+
Maven coordinates::
1111

1212
[source,xml]
1313
----
@@ -29,7 +29,7 @@ dependencies {
2929
=== Using Cloud Logging
3030

3131
The starter automatically configures and registers a `Logging` bean in the Spring application context.
32-
The `Logging` bean (link[Javadoc]) can be used to ingest logs associated with a logId specified in the property `spring.cloud.oci.logging.logId` within the application configuration file
32+
The `Logging` bean (https://oracle.github.io/spring-cloud-oci/{project-version}/javadocs/com/oracle/cloud/spring/logging/package-summary.html[Javadoc]) can be used to ingest logs associated with a logId specified in the property `spring.cloud.oci.logging.logId` within the application configuration file
3333

3434
[source,java]
3535
----

docs/src/main/asciidoc/notifications.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// Copyright (c) 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2023, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
33

44
[#cloud-notifications]
55
== Cloud Notifications
66

77
https://www.oracle.com/in/devops/notifications/[OCI Notifications] is a highly available, low latency publish/subscribe (pub/sub) service that sends alerts and messages to Oracle Cloud Functions, email, SMS, and message delivery partners, including Slack, PagerDuty and custom HTTPS endpoint. Spring Cloud module for Oracle Cloud Notifications allows you to create a Topic, then create and publish messages to multiple subscription types such as Oracle Cloud Functions, email, SMS, Slack, PagerDuty and custom HTTPS endpoint.
8-
A Spring Boot starter is provided to auto-configure the various Notification components.
8+
A Spring Boot starter is provided to autoconfigure the various Notification components.
99

10-
Maven coordinates, using <<getting-started.adoc#bill-of-materials, Spring Cloud OCI BOM>>:
10+
Maven coordinates:
1111

1212
[source,xml]
1313
----
@@ -29,7 +29,7 @@ dependencies {
2929
=== Using Cloud Notifications
3030

3131
The starter automatically configures and registers a `Notification` bean in the Spring application context.
32-
The `Notification` bean (link[Javadoc]) can be used to create a Topic, create, list, get a Subscription, and publish messages to the Subscriptions in a Topic.
32+
The `Notification` bean (https://oracle.github.io/spring-cloud-oci/{project-version}/javadocs/com/oracle/cloud/spring/notification/package-summary.html[Javadoc]) can be used to create a Topic, create, list, get a Subscription, and publish messages to the Subscriptions in a Topic.
3333

3434
[source,java]
3535
----

docs/src/main/asciidoc/queues.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// Copyright (c) 2023, Oracle and/or its affiliates.
1+
// Copyright (c) 2023, 2024, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
33

44
[#cloud-queues]
55
== Cloud Queues
66

77
https://docs.oracle.com/en-us/iaas/Content/queue/home.htm[OCI Queues] is a highly available, low latency publish/subscribe (pub/sub) service, handles high volume transactional data that requires independently processed messages without loss or duplication. Spring Cloud module for Oracle Cloud Queues allows you to create a queue, get a queue, list queues, delete a queue, put messages, get messages, update messages and delete a message.
8-
A Spring Boot starter is provided to auto-configure the various Queue components.
8+
A Spring Boot starter is provided to autoconfigure the various Queue components.
99

10-
Maven coordinates, using <<getting-started.adoc#bill-of-materials, Spring Cloud OCI BOM>>:
10+
Maven coordinates:
1111

1212
[source,xml]
1313
----
@@ -29,7 +29,7 @@ dependencies {
2929
=== Using Cloud Queues
3030

3131
The starter automatically configures and registers a `Queue` bean in the Spring application context.
32-
The `Queue` bean (link[Javadoc]) can be used to create a queue, get a queue, list queues, delete a queue, put messages, get messages, update messages and delete a message.
32+
The `Queue` bean (https://oracle.github.io/spring-cloud-oci/{project-version}/javadocs/com/oracle/cloud/spring/queue/package-summary.html[Javadoc]) can be used to create a queue, get a queue, list queues, delete a queue, put messages, get messages, update messages and delete a message.
3333

3434
[source,java]
3535
----

0 commit comments

Comments
 (0)