Skip to content

Commit

Permalink
Fix javadoc warnings.
Browse files Browse the repository at this point in the history
Adapt pom for toolchain and javadoc.
Add scandium-test.jar and move debug connection store to tests.

Signed-off-by: Achim Kraus <achim.kraus@bosch.io>
  • Loading branch information
Achim Kraus committed Jul 21, 2020
1 parent d81ef69 commit 9f9047b
Show file tree
Hide file tree
Showing 82 changed files with 391 additions and 215 deletions.
39 changes: 39 additions & 0 deletions README.md
Expand Up @@ -18,6 +18,45 @@ $ mvn clean install

Executable JARs of the examples with all dependencies can be found in the `demo-apps/run` folder.

The build-process is tested for jdk 7, jdk 8 and jdk 11. For jdk 7 the revapi maven-plugin is disabled,
it requires at least java 8.

To generate the javadocs, add "-DcreateJavadoc=true" to the command line and set the `JAVA_HOME`.

```sh
$ mvn clean install -DcreateJavadoc=true
```

Californium 2.x can be used with java 7 or newer. If you want to build it with a jdk 7, but use also plugins which are only supported for newer jdks, the toolchain plugin could be used. That requires a toolchains configuration in "toolchains.xml" in your maven ".m2" folder

```xml
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<!-- JDK toolchains -->
<toolchain>
<type>jdk</type>
<provides>
<version>1.7</version>
</provides>
<configuration>
<jdkHome>path..to..jdk7...home</jdkHome>
</configuration>
</toolchain>
</toolchains>
```

To use the jdk7 toolchain, add "-DuseToolchain=true" to the command line.

```sh
$ mvn clean install -DuseToolchain=true
```

To use the jdk7 toolchain and create javadocs, add "-DuseToolchainJavadoc=true" to the command line (`JAVA_HOME` is not required).

```sh
$ mvn clean install -DuseToolchainJavadoc=true
```

# Using Californium in Maven Projects

We are publishing Californium's artifacts for milestones and releases to [Maven Central](https://search.maven.org/search?q=g:org.eclipse.californium%20a:parent%20v:2.3.0).
Expand Down
4 changes: 4 additions & 0 deletions assembly/pom.xml
Expand Up @@ -10,4 +10,8 @@
<name>Californium (Cf) Custom Assembly Descriptors</name>
<description>The set of custom assembly descriptors used for Californium.</description>

<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>

</project>
10 changes: 9 additions & 1 deletion bom/pom.xml
Expand Up @@ -114,7 +114,7 @@
<groupId>${project.groupId}</groupId>
<artifactId>californium-legal</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
<scope>runtime</scope>
</dependency>

<!-- tests -->
Expand All @@ -126,6 +126,14 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>scandium</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>californium-core</artifactId>
Expand Down
Expand Up @@ -146,6 +146,7 @@ private void next() {
*
* @param request the request
* @param endpoint the endpoint
* @param executor the executor to schedule the reregistration.
*/
protected CoapObserveRelation(Request request, Endpoint endpoint, ScheduledThreadPoolExecutor executor) {
this.request = request;
Expand Down
Expand Up @@ -26,7 +26,7 @@
* Endpoint Context tracer.
*
* Calls {@link #onContextChanged(EndpointContext)}, if the endpoint context
* changes. The default implementation logs a pretty printed endpint context.
* changes. The default implementation logs a pretty printed endpoint context.
*
* @since 2.3
*/
Expand All @@ -50,7 +50,7 @@ public void onContextEstablished(EndpointContext endpointContext) {
* because on returning, the message is sent. Therefore take special care in
* methods called on this callback.
*
* @param endpointContext
* @param endpointContext changed endpoint context
*/
protected void onContextChanged(EndpointContext endpointContext) {
if (LOGGER.isInfoEnabled()) {
Expand Down
Expand Up @@ -411,7 +411,7 @@ public boolean hasMID() {
* @throws IllegalArgumentException if mid is out of range {@link #NONE} to
* {@link #MAX_MID}
* @throws IllegalStateException if message is already serialized
* ({@link #setBytes(byte[]) has been called before)
* ({@link #setBytes(byte[])} has been called before)
*/
public Message setMID(int mid) {
// NONE is allowed as a temporary placeholder
Expand All @@ -429,7 +429,7 @@ public Message setMID(int mid) {
* Clears this message's MID.
*
* @throws IllegalStateException if message is already serialized
* ({@link #setBytes(byte[]) has been called before)
* ({@link #setBytes(byte[])} has been called before)
*/
public void removeMID() {
setMID(NONE);
Expand Down Expand Up @@ -487,7 +487,7 @@ public String getTokenString() {
* @return this Message
* @see #setToken(Token)
* @throws IllegalStateException if message is already serialized
* ({@link #setBytes(byte[]) has been called before)
* ({@link #setBytes(byte[])} has been called before)
*/
public Message setToken(byte[] tokenBytes) {
Token token = null;
Expand All @@ -511,7 +511,7 @@ public Message setToken(byte[] tokenBytes) {
* @param token the new token
* @return this Message
* @throws IllegalStateException if message is already serialized
* ({@link #setBytes(byte[]) has been called before)
* ({@link #setBytes(byte[])} has been called before)
*/
public Message setToken(Token token) {
this.token = token;
Expand All @@ -526,7 +526,7 @@ public Message setToken(Token token) {
* one. EmptyMessages should not have any options.
*
* @return the options
* @throws IllegalStateException if message was {@link #offload()}ed.
* @throws IllegalStateException if message was {@link #offload}ed.
*/
public OptionSet getOptions() {
synchronized (acknowledged) {
Expand Down Expand Up @@ -562,7 +562,7 @@ public Message setOptions(OptionSet options) {
*
* @return maximum resource body size. {@code 0} to use the
* {@link NetworkConfig} value of
* {@link NetworkConfig#Keys#MAX_RESOURCE_BODY_SIZE}.
* {@link Keys#MAX_RESOURCE_BODY_SIZE}.
* @since 2.3
*/
public int getMaxResourceBodySize() {
Expand All @@ -575,9 +575,9 @@ public int getMaxResourceBodySize() {
* For incoming messages the protocol stack may set individual sizes. For
* outgoing requests, this limits the size of the response.
*
* @param maxResourceBodySize maximum resouce body size. {@code 0} or
* @param maxResourceBodySize maximum resource body size. {@code 0} or
* default is defined by the {@link NetworkConfig} value of
* {@link NetworkConfig#Keys#MAX_RESOURCE_BODY_SIZE}.
* {@link Keys#MAX_RESOURCE_BODY_SIZE}.
* @since 2.3
*/
public void setMaxResourceBodySize(int maxResourceBodySize) {
Expand All @@ -599,7 +599,7 @@ public int getPayloadSize() {
* Gets the raw payload.
*
* @return the payload
* @throws IllegalStateException if message was {@link #offload()}ed.
* @throws IllegalStateException if message was {@link #offload}ed.
*/
public byte[] getPayload() {
if (offload != null) {
Expand All @@ -613,7 +613,7 @@ public byte[] getPayload() {
* payload is defined.
*
* @return the payload as string
* @throws IllegalStateException if message was {@link #offload()}ed.
* @throws IllegalStateException if message was {@link #offload}ed.
*/
public String getPayloadString() {
if (offload != null) {
Expand Down Expand Up @@ -1166,7 +1166,7 @@ protected String getStatusTracingString() {
* Gets the serialized message as byte array or {@code null}, if not serialized yet.
*
* @return the bytes of the serialized message or null
* @throws IllegalStateException if message was {@link #offload()}ed.
* @throws IllegalStateException if message was {@link #offload}ed.
*/
public byte[] getBytes() {
if (offload == OffloadMode.FULL) {
Expand Down
Expand Up @@ -172,12 +172,14 @@
* are required, set them via {@link #getOptions()}.
* </p>
*
* Note:</br>
* <p>
* Note:
* Using {@link #setDestination(InetAddress)} or
* {@link #setDestinationPort(int)} is deprecated since 2017-09. Using these
* functions may result in unexpected behavior, especially, if other
* destinations are used as in a provided URI.
* Don't use it in combination with the new proxy support of 2.1!
* </p>
*
* @see Response
*/
Expand Down Expand Up @@ -1180,7 +1182,7 @@ public Map<String, String> getUserContext() {
/**
* Set contextual information about this request.
*
* @param userContext
* @param userContext user context
* @return this request
*/
public Request setUserContext(Map<String, String> userContext) {
Expand Down
Expand Up @@ -115,6 +115,7 @@
import org.eclipse.californium.core.network.stack.BlockwiseLayer;
import org.eclipse.californium.core.network.stack.ObserveLayer;
import org.eclipse.californium.core.network.stack.ReliabilityLayer;
import org.eclipse.californium.core.network.stack.ExchangeCleanupLayer;
import org.eclipse.californium.core.network.stack.CoapStack;
import org.eclipse.californium.core.network.stack.CoapTcpStack;
import org.eclipse.californium.core.network.stack.CoapUdpStack;
Expand Down
Expand Up @@ -149,9 +149,9 @@ public synchronized Endpoint getDefaultEndpoint(String uriScheme) {
* endpoint, if not already started.
*
* @param newEndpoint new default endpoint.
* @throws IllegalArgumentException, if the uri scheme of the provided new
* @throws IllegalArgumentException if the uri scheme of the provided new
* endpoint is not supported.
* @throws NullPointerException, if the provided new endpoint is null.
* @throws NullPointerException if the provided new endpoint is null.
* @see #getDefaultEndpoint()
* @see #setDefaultEndpoint(Endpoint)
* @see CoAP#isSupportedScheme
Expand Down

0 comments on commit 9f9047b

Please sign in to comment.