Skip to content

Commit 6bb5d3e

Browse files
authored
b/360705086 Generate Javadocs (#479)
* Add Javadoc plugin, stylesheet * Set style to match homepage * Add package-info files
1 parent b45aeda commit 6bb5d3e

27 files changed

Lines changed: 570 additions & 30 deletions

sources/pom.xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@
2727
<version>2.3.0</version>
2828
<properties>
2929
<surefire-plugin.version>3.5.3</surefire-plugin.version>
30+
<surefire-plugin.version>3.3.1</surefire-plugin.version>
31+
<maven-javadoc-plugin.version>3.8.0</maven-javadoc-plugin.version>
3032
<maven.compiler.target>17</maven.compiler.target>
3133
<maven.compiler.source>17</maven.compiler.source>
3234
<quarkus.version>3.25.0</quarkus.version>
3335
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36+
<javadoc.outputDirectory>${project.build.directory}/javadoc</javadoc.outputDirectory>
3437
</properties>
3538

3639
<dependencyManagement>
@@ -185,6 +188,42 @@
185188
</execution>
186189
</executions>
187190
</plugin>
191+
<plugin>
192+
<groupId>org.apache.maven.plugins</groupId>
193+
<artifactId>maven-javadoc-plugin</artifactId>
194+
<version>${maven-javadoc-plugin.version}</version>
195+
<configuration>
196+
<doctitle>JIT Groups</doctitle>
197+
<outputDirectory>${javadoc.outputDirectory}</outputDirectory> <addStylesheets>
198+
<addStylesheet>javadoc.css</addStylesheet>
199+
</addStylesheets>
200+
<noindex>true</noindex>
201+
<nonavbar>true</nonavbar>
202+
<top><![CDATA[
203+
<div class='jit-flex-box jit-topbar'><div class='jit-flex-content'></div></div>
204+
<div class='jit-flex-box jit-menubar'><div class='jit-flex-content'>
205+
<ul>
206+
<li><a href='https://googlecloudplatform.github.io/jit-groups/'>JIT Groups</a></li>
207+
<li><a href='https://github.com/GoogleCloudPlatform/jit-groups/'>GitHub</a></li>
208+
<li><a href='https://github.com/GoogleCloudPlatform/jit-groups/javadoc/' class='jit-activemenu'>Javadoc</a></li>
209+
</ul>
210+
</div></div>
211+
]]></top>
212+
<bottom><![CDATA[ ]]></bottom>
213+
<source>${maven.compiler.source}</source>
214+
<target>${maven.compiler.target}</target>
215+
<groups>
216+
<group>
217+
<title>Application logic</title>
218+
<packages>com.google.solutions.jitaccess.catalog*</packages>
219+
</group>
220+
<group>
221+
<title>Web API</title>
222+
<packages>com.google.solutions.jitaccess.web*</packages>
223+
</group>
224+
</groups>
225+
</configuration>
226+
</plugin>
188227
</plugins>
189228

190229
<resources>

sources/src/main/java/com/google/solutions/jitaccess/apis/FolderId.java

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import java.util.Optional;
3030

3131
/**
32-
* ID of a Google Cloud folder.
32+
* Identifier for a Google Cloud folder.
3333
*/
3434
public record FolderId(
3535
@NotNull String id
@@ -42,16 +42,13 @@ public record FolderId(
4242
assert !id.contains("/");
4343
}
4444

45-
@Override
46-
public String toString() {
47-
return this.id;
48-
}
49-
5045
/**
5146
* Parse a folder ID from one of the formats
52-
* <p>
53-
* * folders/123
54-
* * 123
47+
*
48+
* <ul>
49+
* <li>folders/123/li>
50+
* <li>123</li>
51+
* </ul>
5552
*
5653
* @return empty if the input string is malformed.
5754
*/
@@ -92,18 +89,35 @@ public int compareTo(@NotNull FolderId o) {
9289
// ResourceId.
9390
// -------------------------------------------------------------------------
9491

92+
/**
93+
* {@inheritDoc}
94+
*/
9595
@Override
9696
public @NotNull String service() {
9797
return ResourceManagerClient.SERVICE;
9898
}
9999

100+
/**
101+
* {@inheritDoc}
102+
*/
100103
@Override
101104
public @NotNull String type() {
102105
return "folder";
103106
}
104107

108+
/**
109+
* {@inheritDoc}
110+
*/
105111
@Override
106112
public @NotNull String path() {
107113
return PREFIX + this.id;
108114
}
115+
116+
/**
117+
* {@inheritDoc}
118+
*/
119+
@Override
120+
public String toString() {
121+
return this.id;
122+
}
109123
}

sources/src/main/java/com/google/solutions/jitaccess/apis/OrganizationId.java

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import java.util.Optional;
3030

3131
/**
32-
* ID of a Google Cloud organization.
32+
* Identifier for a Google Cloud organization.
3333
*/
3434
public record OrganizationId(
3535
@NotNull String id
@@ -42,16 +42,13 @@ public record OrganizationId(
4242
assert !id.contains("/");
4343
}
4444

45-
@Override
46-
public String toString() {
47-
return this.id;
48-
}
49-
5045
/**
5146
* Parse an organization ID from one of the formats
52-
* <p>
53-
* * organizations/123
54-
* * 123
47+
*
48+
* <ul>
49+
* <li>organizations/123</li>
50+
* <li>123</li>
51+
* </ul>
5552
*
5653
* @return empty if the input string is malformed.
5754
*/
@@ -92,18 +89,35 @@ public int compareTo(@NotNull OrganizationId o) {
9289
// ResourceId.
9390
// -------------------------------------------------------------------------
9491

92+
/**
93+
* {@inheritDoc}
94+
*/
9595
@Override
9696
public @NotNull String service() {
9797
return ResourceManagerClient.SERVICE;
9898
}
9999

100+
/**
101+
* {@inheritDoc}
102+
*/
100103
@Override
101104
public @NotNull String type() {
102105
return "organization";
103106
}
104107

108+
/**
109+
* {@inheritDoc}
110+
*/
105111
@Override
106112
public @NotNull String path() {
107113
return PREFIX + this.id;
108114
}
115+
116+
/**
117+
* {@inheritDoc}
118+
*/
119+
@Override
120+
public String toString() {
121+
return this.id;
122+
}
109123
}

sources/src/main/java/com/google/solutions/jitaccess/apis/ProjectId.java

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import java.util.Optional;
3030

3131
/**
32-
* ID of a Google Cloud project.
32+
* Identifier for a Google Cloud project.
3333
*/
3434
public record ProjectId(
3535
@NotNull String id
@@ -42,16 +42,13 @@ public record ProjectId(
4242
assert !id.contains("/");
4343
}
4444

45-
@Override
46-
public String toString() {
47-
return this.id;
48-
}
49-
5045
/**
5146
* Parse a project ID from one of the formats
52-
* <p>
53-
* * projects/project-123
54-
* * project-123
47+
*
48+
* <ul>
49+
* <li>projects/project-123</li>
50+
* <li>project-123</li>
51+
* </ul>
5552
*
5653
* @return empty if the input string is malformed.
5754
*/
@@ -95,18 +92,35 @@ public int compareTo(@NotNull ProjectId o) {
9592
// ResourceId.
9693
// -------------------------------------------------------------------------
9794

95+
/**
96+
* {@inheritDoc}
97+
*/
9898
@Override
9999
public @NotNull String service() {
100100
return ResourceManagerClient.SERVICE;
101101
}
102102

103+
/**
104+
* {@inheritDoc}
105+
*/
103106
@Override
104107
public @NotNull String type() {
105108
return "project";
106109
}
107110

111+
/**
112+
* {@inheritDoc}
113+
*/
108114
@Override
109115
public @NotNull String path() {
110116
return PREFIX + this.id;
111117
}
118+
119+
/**
120+
* {@inheritDoc}
121+
*/
122+
@Override
123+
public String toString() {
124+
return this.id;
125+
}
112126
}

sources/src/main/java/com/google/solutions/jitaccess/apis/ResourceId.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,10 @@ public interface ResourceId {
4949
*/
5050
@SuppressWarnings("SameReturnValue")
5151
@NotNull String service();
52+
53+
/**
54+
* Return the ID, without prefix.
55+
*/
56+
@Override
57+
public String toString();
5258
}

sources/src/main/java/com/google/solutions/jitaccess/apis/clients/CloudIdentityGroupsClient.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,9 @@ public enum AccessProfile {
937937

938938
public record MembershipId(String id) {}
939939

940+
/**
941+
* Constructor options, to be injected using CDI.
942+
*/
940943
public record Options(
941944
@NotNull CustomerId customerId
942945
) {

sources/src/main/java/com/google/solutions/jitaccess/apis/clients/HttpTransport.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ public void initialize(@NotNull HttpRequest request) throws IOException {
9696
};
9797
}
9898

99+
/**
100+
* Constructor options, to be injected using CDI.
101+
*/
99102
public record Options(
100103
Duration connectTimeout,
101104
Duration readTimeout,
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// Copyright 2024 Google LLC
3+
//
4+
// Licensed to the Apache Software Foundation (ASF) under one
5+
// or more contributor license agreements. See the NOTICE file
6+
// distributed with this work for additional information
7+
// regarding copyright ownership. The ASF licenses this file
8+
// to you under the Apache License, Version 2.0 (the
9+
// "License"); you may not use this file except in compliance
10+
// with the License. You may obtain a copy of the License at
11+
//
12+
// http://www.apache.org/licenses/LICENSE-2.0
13+
//
14+
// Unless required by applicable law or agreed to in writing,
15+
// software distributed under the License is distributed on an
16+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
// KIND, either express or implied. See the License for the
18+
// specific language governing permissions and limitations
19+
// under the License.
20+
//
21+
22+
/**
23+
* Clients for interacting with Google Cloud APIs.
24+
*/
25+
package com.google.solutions.jitaccess.apis.clients;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// Copyright 2024 Google LLC
3+
//
4+
// Licensed to the Apache Software Foundation (ASF) under one
5+
// or more contributor license agreements. See the NOTICE file
6+
// distributed with this work for additional information
7+
// regarding copyright ownership. The ASF licenses this file
8+
// to you under the Apache License, Version 2.0 (the
9+
// "License"); you may not use this file except in compliance
10+
// with the License. You may obtain a copy of the License at
11+
//
12+
// http://www.apache.org/licenses/LICENSE-2.0
13+
//
14+
// Unless required by applicable law or agreed to in writing,
15+
// software distributed under the License is distributed on an
16+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
// KIND, either express or implied. See the License for the
18+
// specific language governing permissions and limitations
19+
// under the License.
20+
//
21+
22+
/**
23+
* Common classes and interfaces for API clients.
24+
*/
25+
package com.google.solutions.jitaccess.apis;

sources/src/main/java/com/google/solutions/jitaccess/auth/IamRole.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727

2828
import java.util.Optional;
2929

30+
/**
31+
* Identifier for an IAM role.
32+
*/
3033
public record IamRole(
3134
@NotNull String name
3235
) {

0 commit comments

Comments
 (0)