Skip to content

Commit 0c48e0e

Browse files
authored
Merge pull request #231 from deftdevs/model-classes
Rename model classes from *Bean to *Model
2 parents cb0b675 + e8d8d07 commit 0c48e0e

File tree

453 files changed

+738892
-5122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

453 files changed

+738892
-5122
lines changed

.doc/CODE_CONVENTIONS.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The code conventions are valid for all BootstrAPI modules.
88

99
=== Quick Reference
1010

11-
* Model Class: `EntityBean`
11+
* Model Class: `EntityModel`
1212
* Model JSON Name: `entity` (`@XmlRootElement(name = BootstrAPI.ENTITY)`)
1313
* REST Endpoint Class: `EntitiesResource`
1414
* REST Endpoint Name: `entities` (`@Path(BootstrAPI.ENTITIES)`)
@@ -33,7 +33,7 @@ Example:
3333
@Data
3434
@NoArgsConstructor
3535
@XmlRootElement(name = BootstrAPI.ENTITY)
36-
public class EntityBean {
36+
public class EntityModel {
3737
3838
@XmlElement
3939
@NotNull
@@ -117,7 +117,7 @@ public interface EntitiesResource {
117117
summary = "Get the list of entities",
118118
responses = {
119119
@ApiResponse(
120-
responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = EntitiyBean.class))),
120+
responseCode = "200", content = @Content(array = @ArraySchema(schema = @Schema(implementation = EntitiyModel.class))),
121121
description = ""
122122
),
123123
@ApiResponse(responseCode = "400", content = @Content(schema = @Schema(implementation = ErrorCollection.class)))
@@ -134,15 +134,15 @@ public interface EntitiesResource {
134134
description = "A new entity can be added here if no other entity with the same name already exists",
135135
responses = {
136136
@ApiResponse(
137-
responseCode = "200", content = @Content(schema = @Schema(implementation = EntityBean.class)),
137+
responseCode = "200", content = @Content(schema = @Schema(implementation = EntityModel.class)),
138138
description = ""
139139
),
140140
@ApiResponse(responseCode = "400", content = @Content(schema = @Schema(implementation = ErrorCollection.class)))
141141
}
142142
)
143143
Response addEntity(
144144
@QueryParam("doSomethingAfterAdding") @DefaultValue("false") final boolean doSomethingAfterAdding,
145-
@NotNull final EntityBean entity);
145+
@NotNull final EntityModel entity);
146146
147147
}
148148
----
@@ -173,8 +173,8 @@ public class EntitiesResourceImpl implements EntitiesResource {
173173
public Response getEntities() {
174174
final ErrorCollection errorCollection = new ErrorCollection();
175175
try {
176-
final List<EntitiesBean> entitieBeans = entitiesService.getEntities();
177-
return Response.ok(entitiesBeanBeans).build();
176+
final List<EntitiesModel> entitieModels = entitiesService.getEntities();
177+
return Response.ok(entitiesModelModels).build();
178178
} catch (Exception e) {
179179
log.error(e.getMessage(), e);
180180
errorCollection.addErrorMessage(e.getMessage());
@@ -185,11 +185,11 @@ public class EntitiesResourceImpl implements EntitiesResource {
185185
@Override
186186
public Response addEntity(
187187
final boolean doSomethingAfterAdding,
188-
@NotNull final EntityBean entity) {
188+
@NotNull final EntityModel entity) {
189189
190190
final ErrorCollection errorCollection = new ErrorCollection();
191191
try {
192-
EntityBean addedEntity = entitiesService.addEntity(entity, doSomethingAfterAdding);
192+
EntityModel addedEntity = entitiesService.addEntity(entity, doSomethingAfterAdding);
193193
return Response.ok(addedEntity).build();
194194
} catch (Exception e) {
195195
log.error(e.getMessage(), e);

commons/src/main/java/com/deftdevs/bootstrapi/commons/exception/DirectoryNotFoundException.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.deftdevs.bootstrapi.commons.exception;
22

33
import com.deftdevs.bootstrapi.commons.exception.web.NotFoundException;
4-
import com.deftdevs.bootstrapi.commons.model.AbstractDirectoryBean;
4+
import com.deftdevs.bootstrapi.commons.model.AbstractDirectoryModel;
55

66
@SuppressWarnings("java:S110")
77
public class DirectoryNotFoundException extends NotFoundException {
@@ -21,9 +21,9 @@ public DirectoryNotFoundException(
2121
}
2222

2323
public DirectoryNotFoundException(
24-
final AbstractDirectoryBean directoryBean) {
24+
final AbstractDirectoryModel directoryModel) {
2525

26-
this(directoryBean.getName());
26+
this(directoryModel.getName());
2727
}
2828

2929
}

commons/src/main/java/com/deftdevs/bootstrapi/commons/exception/GroupNotFoundException.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.deftdevs.bootstrapi.commons.exception;
22

33
import com.deftdevs.bootstrapi.commons.exception.web.NotFoundException;
4-
import com.deftdevs.bootstrapi.commons.model.GroupBean;
4+
import com.deftdevs.bootstrapi.commons.model.GroupModel;
55

66
@SuppressWarnings("java:S110")
77
public class GroupNotFoundException extends NotFoundException {
@@ -21,9 +21,9 @@ public GroupNotFoundException(
2121
}
2222

2323
public GroupNotFoundException(
24-
final GroupBean groupBean) {
24+
final GroupModel groupModel) {
2525

26-
this(groupBean.getName());
26+
this(groupModel.getName());
2727
}
2828

2929
}

commons/src/main/java/com/deftdevs/bootstrapi/commons/exception/UserNotFoundException.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.deftdevs.bootstrapi.commons.exception;
22

33
import com.deftdevs.bootstrapi.commons.exception.web.NotFoundException;
4-
import com.deftdevs.bootstrapi.commons.model.UserBean;
4+
import com.deftdevs.bootstrapi.commons.model.UserModel;
55

66
@SuppressWarnings("java:S110")
77
public class UserNotFoundException extends NotFoundException {
@@ -21,9 +21,9 @@ public UserNotFoundException(
2121
}
2222

2323
public UserNotFoundException(
24-
final UserBean userBean) {
24+
final UserModel userModel) {
2525

26-
this(userBean.getUsername());
26+
this(userModel.getUsername());
2727
}
2828

2929
}

commons/src/main/java/com/deftdevs/bootstrapi/commons/model/AbstractAuthenticationIdpBean.java renamed to commons/src/main/java/com/deftdevs/bootstrapi/commons/model/AbstractAuthenticationIdpModel.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
property = "type"
2323
)
2424
@JsonSubTypes({
25-
@JsonSubTypes.Type(value = AuthenticationIdpOidcBean.class, name = BootstrAPI.AUTHENTICATION_IDP_OIDC),
26-
@JsonSubTypes.Type(value = AuthenticationIdpSamlBean.class, name = BootstrAPI.AUTHENTICATION_IDP_SAML),
25+
@JsonSubTypes.Type(value = AuthenticationIdpOidcModel.class, name = BootstrAPI.AUTHENTICATION_IDP_OIDC),
26+
@JsonSubTypes.Type(value = AuthenticationIdpSamlModel.class, name = BootstrAPI.AUTHENTICATION_IDP_SAML),
2727
})
2828
// Note: The subtypes must also be registered for swagger to be considered in the REST API documentation
2929
@Schema(anyOf = {
30-
AuthenticationIdpOidcBean.class,
31-
AuthenticationIdpSamlBean.class,
30+
AuthenticationIdpOidcModel.class,
31+
AuthenticationIdpSamlModel.class,
3232
})
33-
public abstract class AbstractAuthenticationIdpBean {
33+
public abstract class AbstractAuthenticationIdpModel {
3434

3535
@XmlElement
3636
private Long id;

commons/src/main/java/com/deftdevs/bootstrapi/commons/model/AbstractDirectoryBean.java renamed to commons/src/main/java/com/deftdevs/bootstrapi/commons/model/AbstractDirectoryModel.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import java.util.Date;
1414

1515
/**
16-
* Bean for user directory settings in REST requests.
16+
* Model for user directory settings in REST requests.
1717
*/
1818
@Data
1919
@NoArgsConstructor
@@ -24,21 +24,21 @@
2424
property = "type"
2525
)
2626
@JsonSubTypes({
27-
@JsonSubTypes.Type(value = DirectoryCrowdBean.class, name = BootstrAPI.DIRECTORY_CROWD),
28-
@JsonSubTypes.Type(value = DirectoryDelegatingBean.class, name = BootstrAPI.DIRECTORY_DELEGATING),
29-
@JsonSubTypes.Type(value = DirectoryGenericBean.class, name = BootstrAPI.DIRECTORY_GENERIC),
30-
@JsonSubTypes.Type(value = DirectoryInternalBean.class, name = BootstrAPI.DIRECTORY_INTERNAL),
31-
@JsonSubTypes.Type(value = DirectoryLdapBean.class, name = BootstrAPI.DIRECTORY_LDAP),
27+
@JsonSubTypes.Type(value = DirectoryCrowdModel.class, name = BootstrAPI.DIRECTORY_CROWD),
28+
@JsonSubTypes.Type(value = DirectoryDelegatingModel.class, name = BootstrAPI.DIRECTORY_DELEGATING),
29+
@JsonSubTypes.Type(value = DirectoryGenericModel.class, name = BootstrAPI.DIRECTORY_GENERIC),
30+
@JsonSubTypes.Type(value = DirectoryInternalModel.class, name = BootstrAPI.DIRECTORY_INTERNAL),
31+
@JsonSubTypes.Type(value = DirectoryLdapModel.class, name = BootstrAPI.DIRECTORY_LDAP),
3232
})
3333
// Note: The subtypes must also be registered for swagger to be considered in the REST API documentation
3434
@Schema(anyOf = {
35-
DirectoryCrowdBean.class,
36-
DirectoryDelegatingBean.class,
37-
DirectoryGenericBean.class,
38-
DirectoryInternalBean.class,
39-
DirectoryLdapBean.class,
35+
DirectoryCrowdModel.class,
36+
DirectoryDelegatingModel.class,
37+
DirectoryGenericModel.class,
38+
DirectoryInternalModel.class,
39+
DirectoryLdapModel.class,
4040
})
41-
public abstract class AbstractDirectoryBean {
41+
public abstract class AbstractDirectoryModel {
4242

4343
@XmlElement
4444
private Long id;

commons/src/main/java/com/deftdevs/bootstrapi/commons/model/AbstractMailServerProtocolBean.java renamed to commons/src/main/java/com/deftdevs/bootstrapi/commons/model/AbstractMailServerProtocolModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
@Data
1313
@NoArgsConstructor
14-
public abstract class AbstractMailServerProtocolBean {
14+
public abstract class AbstractMailServerProtocolModel {
1515

1616
public static final Long DEFAULT_TIMEOUT = 10000L;
1717

commons/src/main/java/com/deftdevs/bootstrapi/commons/model/ApplicationLinkBean.java renamed to commons/src/main/java/com/deftdevs/bootstrapi/commons/model/ApplicationLinkModel.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
import java.util.UUID;
1212

1313
/**
14-
* Bean for an application link in REST requests.
14+
* Model for an application link in REST requests.
1515
*/
1616
@Data
1717
@NoArgsConstructor
1818
@XmlRootElement(name = BootstrAPI.APPLICATION_LINK)
19-
public class ApplicationLinkBean {
19+
public class ApplicationLinkModel {
2020

2121
public enum ApplicationLinkType {
2222
BAMBOO,
@@ -72,10 +72,10 @@ public enum ApplicationLinkStatus {
7272

7373
// Example instances for documentation and tests
7474

75-
public static final ApplicationLinkBean EXAMPLE_1;
75+
public static final ApplicationLinkModel EXAMPLE_1;
7676

7777
static {
78-
EXAMPLE_1 = new ApplicationLinkBean();
78+
EXAMPLE_1 = new ApplicationLinkModel();
7979
EXAMPLE_1.setUuid(UUID.randomUUID());
8080
EXAMPLE_1.setName("Example");
8181
EXAMPLE_1.setDisplayUrl(URI.create("http://example.com"));

commons/src/main/java/com/deftdevs/bootstrapi/commons/model/AuthenticationIdpOidcBean.java renamed to commons/src/main/java/com/deftdevs/bootstrapi/commons/model/AuthenticationIdpOidcModel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@NoArgsConstructor
1515
@EqualsAndHashCode(callSuper = true)
1616
@XmlRootElement(name = BootstrAPI.AUTHENTICATION + "-" + BootstrAPI.AUTHENTICATION_IDP + "-" + BootstrAPI.AUTHENTICATION_IDP_OIDC)
17-
public class AuthenticationIdpOidcBean extends AbstractAuthenticationIdpBean {
17+
public class AuthenticationIdpOidcModel extends AbstractAuthenticationIdpModel {
1818

1919
@XmlElement
2020
private String clientId;
@@ -44,10 +44,10 @@ public class AuthenticationIdpOidcBean extends AbstractAuthenticationIdpBean {
4444

4545
// Example instances for documentation and tests
4646

47-
public static final AuthenticationIdpOidcBean EXAMPLE_1;
47+
public static final AuthenticationIdpOidcModel EXAMPLE_1;
4848

4949
static {
50-
EXAMPLE_1 = new AuthenticationIdpOidcBean();
50+
EXAMPLE_1 = new AuthenticationIdpOidcModel();
5151
EXAMPLE_1.setId(1L);
5252
EXAMPLE_1.setName("OIDC");
5353
EXAMPLE_1.setEnabled(true);

commons/src/main/java/com/deftdevs/bootstrapi/commons/model/AuthenticationIdpSamlBean.java renamed to commons/src/main/java/com/deftdevs/bootstrapi/commons/model/AuthenticationIdpSamlModel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@NoArgsConstructor
1313
@EqualsAndHashCode(callSuper = true)
1414
@XmlRootElement(name = BootstrAPI.AUTHENTICATION + "-" + BootstrAPI.AUTHENTICATION_IDP + "-" + BootstrAPI.AUTHENTICATION_IDP_SAML)
15-
public class AuthenticationIdpSamlBean extends AbstractAuthenticationIdpBean {
15+
public class AuthenticationIdpSamlModel extends AbstractAuthenticationIdpModel {
1616

1717
@XmlElement
1818
private String certificate;
@@ -24,10 +24,10 @@ public class AuthenticationIdpSamlBean extends AbstractAuthenticationIdpBean {
2424

2525
// Example instances for documentation and tests
2626

27-
public static final AuthenticationIdpSamlBean EXAMPLE_1;
27+
public static final AuthenticationIdpSamlModel EXAMPLE_1;
2828

2929
static {
30-
EXAMPLE_1 = new AuthenticationIdpSamlBean();
30+
EXAMPLE_1 = new AuthenticationIdpSamlModel();
3131
EXAMPLE_1.setId(1L);
3232
EXAMPLE_1.setName("SAML");
3333
EXAMPLE_1.setEnabled(true);

0 commit comments

Comments
 (0)