Skip to content

Commit

Permalink
Adds checkstyle style checks and formats code based on new rules (#3)
Browse files Browse the repository at this point in the history
* Adds checkstyle config to POM
* Applies checkstyle rules
Formatting changes only, there are no (intentional) functional updates
  • Loading branch information
bbranan authored and dbernstein committed Mar 23, 2018
1 parent ee17c1c commit a84aa06
Show file tree
Hide file tree
Showing 67 changed files with 1,192 additions and 1,171 deletions.
51 changes: 26 additions & 25 deletions account-management-db-model/pom.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<parent>
<groupId>org.duracloud.db</groupId>
<artifactId>db</artifactId>
<version>4.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.duracloud.db</groupId>
<artifactId>account-management-db-model</artifactId>
<artifactId>db</artifactId>
<version>4.2.0-SNAPSHOT</version>
<name>Account DB Model</name>
<relativePath>../pom.xml</relativePath>
</parent>

<modelVersion>4.0.0</modelVersion>
<groupId>org.duracloud.db</groupId>
<artifactId>account-management-db-model</artifactId>
<version>4.2.0-SNAPSHOT</version>
<name>Account DB Model</name>

<dependencies>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
</dependency>
<dependencies>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
</dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package org.duracloud.account.db.model;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
Expand Down Expand Up @@ -53,7 +52,6 @@ public enum AccountStatus {
@Enumerated(EnumType.STRING)
private AccountStatus status;


/**
* The StorageProviderAccount which is used for primary storage
*/
Expand All @@ -64,7 +62,7 @@ public enum AccountStatus {
/**
* The StorageProviderAccounts which are used for secondary storage
*/
@OneToMany(fetch = FetchType.LAZY, cascade = { CascadeType.ALL })
@OneToMany(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
@JoinColumn(name = "account_info_id", nullable = true, columnDefinition = "bigint(20)")
private Set<StorageProviderAccount> secondaryStorageProviderAccounts;

Expand Down Expand Up @@ -113,7 +111,7 @@ public StorageProviderAccount getPrimaryStorageProviderAccount() {
}

public void setPrimaryStorageProviderAccount(
StorageProviderAccount primaryStorageProviderAccount) {
StorageProviderAccount primaryStorageProviderAccount) {
this.primaryStorageProviderAccount = primaryStorageProviderAccount;
}

Expand All @@ -122,11 +120,10 @@ public Set<StorageProviderAccount> getSecondaryStorageProviderAccounts() {
}

public void setSecondaryStorageProviderAccounts(
Set<StorageProviderAccount> secondaryStorageProviderAccounts) {
Set<StorageProviderAccount> secondaryStorageProviderAccounts) {
this.secondaryStorageProviderAccounts = secondaryStorageProviderAccounts;
}


@Override
public int compareTo(AccountInfo o) {
return this.acctName.compareTo(o.acctName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package org.duracloud.account.db.model;

import java.util.Set;

import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
Expand All @@ -21,24 +20,24 @@

/**
* @author Erik Paulsson
* Date: 7/10/13
* Date: 7/10/13
*/
@Entity
public class AccountRights extends BaseEntity {

@ManyToOne(fetch=FetchType.EAGER, optional=false)
@JoinColumn(name="account_id", nullable=false, columnDefinition = "bigint(20)")
@ManyToOne(fetch = FetchType.EAGER, optional = false)
@JoinColumn(name = "account_id", nullable = false, columnDefinition = "bigint(20)")
private AccountInfo account;

@ManyToOne(fetch= FetchType.EAGER, optional=true)
@JoinColumn(name="user_id", nullable=true, columnDefinition = "bigint(20)")
@ManyToOne(fetch = FetchType.EAGER, optional = true)
@JoinColumn(name = "user_id", nullable = true, columnDefinition = "bigint(20)")
private DuracloudUser user;

@ElementCollection(targetClass=Role.class, fetch = FetchType.EAGER)
@ElementCollection(targetClass = Role.class, fetch = FetchType.EAGER)
@Enumerated(EnumType.STRING)
@CollectionTable(name="account_rights_role",
joinColumns=@JoinColumn(name="account_rights_id", columnDefinition = "bigint(20)"))
@Column(name="role")
@CollectionTable(name = "account_rights_role",
joinColumns = @JoinColumn(name = "account_rights_id", columnDefinition = "bigint(20)"))
@Column(name = "role")
private Set<Role> roles;

public AccountInfo getAccount() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package org.duracloud.account.db.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
Expand All @@ -18,17 +17,16 @@

/**
* @author Erik Paulsson
* Date: 7/10/13
* Date: 7/10/13
*/
@MappedSuperclass
public abstract class BaseEntity {

@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(columnDefinition="bigint(20) AUTO_INCREMENT")
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(columnDefinition = "bigint(20) AUTO_INCREMENT")
protected Long id;


@Version
private Date modified;

Expand All @@ -50,12 +48,18 @@ public void setModified(Date modified) {

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

BaseEntity that = (BaseEntity) o;

if (id != null ? !id.equals(that.id) : that.id != null) return false;
if (id != null ? !id.equals(that.id) : that.id != null) {
return false;
}

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package org.duracloud.account.db.model;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
Expand All @@ -18,7 +17,7 @@

/**
* @author Erik Paulsson
* Date: 7/10/13
* Date: 7/10/13
*/
@Entity
public class DuracloudGroup extends BaseEntity {
Expand All @@ -28,14 +27,16 @@ public class DuracloudGroup extends BaseEntity {

private String name;

@ManyToMany(fetch=FetchType.EAGER)
@JoinTable(name="group_user",
joinColumns=@JoinColumn(name="group_id", referencedColumnName="id", columnDefinition = "bigint(20)"),
inverseJoinColumns=@JoinColumn(name="user_id", referencedColumnName="id", columnDefinition = "bigint(20)"))
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "group_user",
joinColumns = @JoinColumn(name = "group_id", referencedColumnName = "id",
columnDefinition = "bigint(20)"),
inverseJoinColumns = @JoinColumn(name = "user_id", referencedColumnName = "id",
columnDefinition = "bigint(20)"))
private Set<DuracloudUser> users;

@ManyToOne(fetch=FetchType.LAZY, optional=false)
@JoinColumn(name="account_id", nullable=false, columnDefinition = "bigint(20)")
@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "account_id", nullable = false, columnDefinition = "bigint(20)")
private AccountInfo account;

public String getName() {
Expand All @@ -45,9 +46,9 @@ public String getName() {
public void setName(String name) {
this.name = name;
}
public String getPrettyName(){
return this.name.substring(this.name.indexOf(PREFIX)+PREFIX.length());

public String getPrettyName() {
return this.name.substring(this.name.indexOf(PREFIX) + PREFIX.length());
}

public Set<DuracloudUser> getUsers() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,68 +12,81 @@

/**
* Contains basic configuration information for interacting with the Duracloud Mill.
*
* @author Daniel Bernstein
* Date: 05/06/2015
* Date: 05/06/2015
*/
@Entity
public class DuracloudMill extends BaseEntity {
@Column(nullable=false)
@Column(nullable = false)
private String dbName;
@Column(nullable=false)
@Column(nullable = false)
private String dbHost;
@Column(nullable=false)
@Column(nullable = false)
private Integer dbPort;
@Column(nullable=false)
@Column(nullable = false)
private String dbUsername;
@Column(nullable=false)
@Column(nullable = false)
private String dbPassword;
@Column(nullable=false)
@Column(nullable = false)
private String auditQueue;
@Column(nullable=false)
@Column(nullable = false)
private String auditLogSpaceId;

public String getDbName() {
return dbName;
}

public void setDbName(String dbName) {
this.dbName = dbName;
}

public String getDbHost() {
return dbHost;
}

public void setDbHost(String dbHost) {
this.dbHost = dbHost;
}

public Integer getDbPort() {
return dbPort;
}

public void setDbPort(Integer dbPort) {
this.dbPort = dbPort;
}

public String getDbUsername() {
return dbUsername;
}

public void setDbUsername(String dbUsername) {
this.dbUsername = dbUsername;
}

public String getDbPassword() {
return dbPassword;
}

public void setDbPassword(String dbPassword) {
this.dbPassword = dbPassword;
}

public String getAuditQueue() {
return auditQueue;
}

public void setAuditQueue(String auditQueue) {
this.auditQueue = auditQueue;
}

public String getAuditLogSpaceId() {
return auditLogSpaceId;
}

public void setAuditLogSpaceId(String auditLogSpaceId) {
this.auditLogSpaceId = auditLogSpaceId;
}



}
Loading

0 comments on commit a84aa06

Please sign in to comment.