ref 18964: Create a Generic Resource to record Dismissed VREs

https://support.d4science.org/issues/18964

Create a library to support the resource access
This commit is contained in:
Giancarlo Panichi 2020-04-08 11:18:22 +02:00
parent 37780ece3f
commit b5fb5e9cdb
3 changed files with 46 additions and 8 deletions

View File

@ -8,13 +8,13 @@ import java.util.LinkedHashMap;
* @author Giancarlo Panichi
*
*/
public class Gateway implements Serializable {
public class Gateway implements Serializable, Comparable<Gateway> {
private static final long serialVersionUID = -7369449849642474360L;
private String scope;
private String name;
private String description;
private LinkedHashMap<String,VO> vos;
private LinkedHashMap<String, VO> vos;
private String startDate;
private String endDate;
private String catalogUrl;
@ -36,7 +36,7 @@ public class Gateway implements Serializable {
this.description = description;
}
public Gateway(String scope, String name, String description, LinkedHashMap<String,VO> vos) {
public Gateway(String scope, String name, String description, LinkedHashMap<String, VO> vos) {
super();
this.scope = scope;
this.name = name;
@ -100,6 +100,19 @@ public class Gateway implements Serializable {
this.catalogUrl = catalogUrl;
}
@Override
public int compareTo(Gateway gateway) {
if (name == null) {
return -1;
} else {
if (gateway != null && gateway.getName() != null) {
return name.compareTo(gateway.getName());
} else {
return 1;
}
}
}
@Override
public String toString() {
return "Gateway [scope=" + scope + ", name=" + name + ", description=" + description + ", vos=" + vos

View File

@ -8,13 +8,13 @@ import java.util.LinkedHashMap;
* @author Giancarlo Panichi
*
*/
public class VO implements Serializable {
public class VO implements Serializable, Comparable<VO> {
private static final long serialVersionUID = 3227628150807395623L;
private String scope;
private String name;
private String description;
private LinkedHashMap<String,VRE> vres;
private LinkedHashMap<String, VRE> vres;
private String startDate;
private String endDate;
private String catalogUrl;
@ -36,7 +36,7 @@ public class VO implements Serializable {
this.description = description;
}
public VO(String scope, String name, String description, LinkedHashMap<String,VRE> vres) {
public VO(String scope, String name, String description, LinkedHashMap<String, VRE> vres) {
super();
this.scope = scope;
this.name = name;
@ -68,7 +68,6 @@ public class VO implements Serializable {
this.description = description;
}
public LinkedHashMap<String, VRE> getVres() {
return vres;
}
@ -101,6 +100,19 @@ public class VO implements Serializable {
this.catalogUrl = catalogUrl;
}
@Override
public int compareTo(VO vo) {
if (name == null) {
return -1;
} else {
if (vo != null && vo.getName() != null) {
return name.compareTo(vo.getName());
} else {
return 1;
}
}
}
@Override
public String toString() {
return "VO [scope=" + scope + ", name=" + name + ", description=" + description + ", vres=" + vres

View File

@ -8,7 +8,7 @@ import java.util.ArrayList;
* @author Giancarlo Panichi
*
*/
public class VRE implements Serializable {
public class VRE implements Serializable, Comparable<VRE> {
private static final long serialVersionUID = 8250701755399181125L;
private String scope;
@ -91,6 +91,19 @@ public class VRE implements Serializable {
public void setCatalogUrl(String catalogUrl) {
this.catalogUrl = catalogUrl;
}
@Override
public int compareTo(VRE vre) {
if (name == null) {
return -1;
} else {
if (vre != null && vre.getName() != null) {
return name.compareTo(vre.getName());
} else {
return 1;
}
}
}
@Override
public String toString() {