Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… dependencies on the primary DuraCloud baseline by moving a few classes into DuraCloud-DB.
  • Loading branch information
bbranan committed Jul 11, 2016
1 parent 142fa35 commit 326ead6
Show file tree
Hide file tree
Showing 10 changed files with 273 additions and 104 deletions.
18 changes: 5 additions & 13 deletions account-management-db-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@
<name>Account DB Model</name>

<dependencies>
<dependency>
<groupId>org.duracloud</groupId>
<artifactId>common</artifactId>
<version>${duracloud.artifact.version}</version>
</dependency>

<dependency>
<groupId>org.duracloud</groupId>
<artifactId>storageprovider</artifactId>
<version>${duracloud.artifact.version}</version>
</dependency>

<!--External dependencies-->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
Expand All @@ -36,5 +23,10 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
</dependency>

<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 @@ -18,11 +18,6 @@
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import org.hibernate.annotations.LazyToOne;
import org.hibernate.annotations.LazyToOneOption;

/**
* @author Erik Paulsson Date: 7/10/13
*/
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://duracloud.org/license/
*/
package org.duracloud.reportdata.bitintegrity;
/**
*
* @author Daniel Bernstein
*
*/
public enum BitIntegrityReportResult {
SUCCESS,
FAILURE;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
/*
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://duracloud.org/license/
*/
package org.duracloud.security.domain;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

/**
* @author Andrew Woods
* Date: Mar 28, 2010
*/
public class SecurityUserBean {
private String username;
private String password;
private String email;
private String ipLimits;
private boolean enabled;
private boolean accountNonExpired;
private boolean credentialsNonExpired;
private boolean accountNonLocked;
private List<String> grantedAuthorities;
private List<String> groups;

public static final String SCHEMA_VERSION = "1.3";

public SecurityUserBean() {
this("unknown",
"unknown",
"",
"",
false,
false,
false,
false,
new ArrayList<>(),
new ArrayList<>());
}

public SecurityUserBean(String username,
String password,
List<String> grantedAuthorities) {
this(username,
password,
"",
"",
true,
true,
true,
true,
grantedAuthorities,
new ArrayList<>());
}

public SecurityUserBean(String username,
String password,
String email,
String ipLimits,
boolean enabled,
boolean accountNonExpired,
boolean credentialsNonExpired,
boolean accountNonLocked,
List<String> grantedAuthorities,
List<String> groups) {
this.username = username;
this.password = password;
this.email = email;
this.ipLimits = ipLimits;
this.enabled = enabled;
this.accountNonExpired = accountNonExpired;
this.credentialsNonExpired = credentialsNonExpired;
this.accountNonLocked = accountNonLocked;
this.grantedAuthorities = grantedAuthorities;
this.groups = groups;
}

public String getUsername() {
return username;
}

public String getPassword() {
return password;
}

public String getEmail() {
return email;
}

public String getIpLimits() {
return ipLimits;
}

public boolean isEnabled() {
return enabled;
}

public boolean isAccountNonExpired() {
return accountNonExpired;
}

public boolean isCredentialsNonExpired() {
return credentialsNonExpired;
}

public boolean isAccountNonLocked() {
return accountNonLocked;
}

public List<String> getGrantedAuthorities() {
return grantedAuthorities;
}

public void setUsername(String username) {
if (!StringUtils.isBlank(username)) {
this.username = username;
}
}

public void setPassword(String password) {
if (!StringUtils.isBlank(password)) {
this.password = password;
}
}

public void setEmail(String email) {
if (!StringUtils.isBlank(email)) {
this.email = email;
}
}

public void setIpLimits(String ipLimits) {
if(!StringUtils.isBlank(ipLimits)) {
this.ipLimits = ipLimits;
}
}

public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

public void setAccountNonExpired(boolean accountNonExpired) {
this.accountNonExpired = accountNonExpired;
}

public void setCredentialsNonExpired(boolean credentialsNonExpired) {
this.credentialsNonExpired = credentialsNonExpired;
}

public void setAccountNonLocked(boolean accountNonLocked) {
this.accountNonLocked = accountNonLocked;
}

public void setGrantedAuthorities(List<String> grantedAuthorities) {
this.grantedAuthorities = grantedAuthorities;
}

public void addGrantedAuthority(String grantedAuthority) {
if (null == this.grantedAuthorities) {
this.grantedAuthorities = new ArrayList<String>();
}
this.grantedAuthorities.add(grantedAuthority);
}

public String getTopAuthorityDisplay() {
List<String> authrorities = getGrantedAuthorities();
if (authrorities.contains("ROLE_OWNER")) {
return "Owner";
} else if (authrorities.contains("ROLE_ADMIN")) {
return "Administrator";
} else {
return "User";
}
}

public void addGroup(String group) {
if (null == this.groups) {
groups = new ArrayList<>();
}
groups.add(group);
}

public List<String> getGroups() {
return groups;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://duracloud.org/license/
*/
package org.duracloud.storage.domain;

public enum StorageProviderType {
AMAZON_S3("amazon-s3"),
AMAZON_GLACIER("amazon-glacier"),
RACKSPACE("rackspace"),
SDSC("sdsc"),
IRODS("irods"),
SNAPSHOT("snapshot"),
UNKNOWN("unknown"),
TEST_RETRY("test-retry"),
TEST_VERIFY_CREATE("test-verify-create"),
TEST_VERIFY_DELETE("test-verify-delete");

private final String text;

private StorageProviderType(String pt) {
text = pt;
}

public static StorageProviderType fromString(String pt) {
for (StorageProviderType pType : values()) {
if (pType.text.equalsIgnoreCase(pt)||
pType.name().equalsIgnoreCase(pt)) {
return pType;
}
}
return StorageProviderType.UNKNOWN;
}

@Override
public String toString() {
return text;
}

public String getName(){
return name();
}
}
6 changes: 0 additions & 6 deletions account-management-db-repo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
<artifactId>common</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.duracloud</groupId>
<artifactId>security</artifactId>
<version>${duracloud.artifact.version}</version>
</dependency>

<!--External dependencies-->
<dependency>
Expand Down
12 changes: 3 additions & 9 deletions mill-db-repo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@
</dependency>

<dependency>
<groupId>org.duracloud</groupId>
<artifactId>common</artifactId>
<version>${duracloud.artifact.version}</version>
</dependency>

<dependency>
<groupId>org.duracloud</groupId>
<artifactId>reportdata</artifactId>
<version>${duracloud.artifact.version}</version>
<groupId>org.duracloud.db</groupId>
<artifactId>account-management-db-model</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
Expand Down
Loading

0 comments on commit 326ead6

Please sign in to comment.