50 lines
1.1 KiB
Java
50 lines
1.1 KiB
Java
package org.gcube.data.transfer.model.plugins.thredds;
|
|
|
|
import javax.xml.bind.annotation.XmlAccessType;
|
|
import javax.xml.bind.annotation.XmlAccessorType;
|
|
import javax.xml.bind.annotation.XmlRootElement;
|
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.Getter;
|
|
import lombok.NoArgsConstructor;
|
|
import lombok.Setter;
|
|
import lombok.ToString;
|
|
|
|
@Getter
|
|
@Setter
|
|
@ToString
|
|
@NoArgsConstructor
|
|
@AllArgsConstructor
|
|
@XmlRootElement
|
|
@XmlAccessorType(XmlAccessType.FIELD)
|
|
public class ThreddsInfo {
|
|
|
|
private String hostname;
|
|
private String localBasePath;
|
|
private String instanceBaseUrl;
|
|
private ThreddsCatalog catalog;
|
|
|
|
|
|
private String adminUser;
|
|
private String adminPassword;
|
|
|
|
private int version;
|
|
private int minor;
|
|
private int build;
|
|
private int revision;
|
|
private String ghnId;
|
|
|
|
|
|
public ThreddsCatalog getById(String id) {
|
|
return findById(catalog,id);
|
|
}
|
|
|
|
|
|
private static ThreddsCatalog findById(ThreddsCatalog catalog,String id) {
|
|
if(catalog!=null&&catalog.getID()!=null&&catalog.getID().equals(id)) return catalog;
|
|
for(ThreddsCatalog cat : catalog.getSubCatalogs().getLinkedCatalogs())
|
|
return findById(cat,id);
|
|
return null;
|
|
}
|
|
}
|