-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Part of https://jira.duraspace.org/browse/DURACLOUD-1039, removes all…
… dependencies on the primary DuraCloud baseline by moving a few classes into DuraCloud-DB.
- Loading branch information
Showing
10 changed files
with
273 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
...gement-db-model/src/main/java/org/duracloud/account/db/model/util/InitUserCredential.java
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
...b-model/src/main/java/org/duracloud/reportdata/bitintegrity/BitIntegrityReportResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
191 changes: 191 additions & 0 deletions
191
...unt-management-db-model/src/main/java/org/duracloud/security/domain/SecurityUserBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...t-management-db-model/src/main/java/org/duracloud/storage/domain/StorageProviderType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.