implementing changes requested by Fabio
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/widgets/ws-thredds-sync-widget@164941 82a268e6-3cf1-43bd-a215-b396298e98cfpull/1/head
parent
9733909819
commit
e9ae76e295
@ -1,91 +0,0 @@
|
||||
package org.gcube.portlets.widgets.wsthreddssync.server;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.gcube.portlets.widgets.wsthreddssync.shared.TransferOnThreddsReport;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class SessionUtil {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(SessionUtil.class);
|
||||
|
||||
public static final String FOLDER_SYNCRONIZE_WITH_THREDDS = "Folder_Syncronize_With_Thredds";
|
||||
|
||||
/**
|
||||
* Sets the folder publishing on thredds.
|
||||
*
|
||||
* @param session the session
|
||||
* @param report the report
|
||||
*/
|
||||
public static void setTransferPublishingOnThredds(HttpSession session, TransferOnThreddsReport report){
|
||||
|
||||
Map<String, TransferOnThreddsReport> map = getMapTransferPublishingOnThredds(session);
|
||||
|
||||
if(map!=null)
|
||||
map.put(report.getTransferId(), report);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the folder publishing on thredds.
|
||||
*
|
||||
* @param session the session
|
||||
* @return the folder publishing on thredds
|
||||
*/
|
||||
public static Map<String, TransferOnThreddsReport> getMapTransferPublishingOnThredds(HttpSession session){
|
||||
|
||||
Map<String, TransferOnThreddsReport> map = null;
|
||||
try{
|
||||
|
||||
map = (Map<String,TransferOnThreddsReport>) session.getAttribute(FOLDER_SYNCRONIZE_WITH_THREDDS);
|
||||
|
||||
if(map==null){
|
||||
logger.info("Creating new map to trace syncronize with thredds... ");
|
||||
map = new HashMap<String, TransferOnThreddsReport>();
|
||||
session.setAttribute(FOLDER_SYNCRONIZE_WITH_THREDDS, map);
|
||||
}
|
||||
|
||||
}catch (Exception e) {
|
||||
logger.error("an error occurred instancing PropertySpecialFolderReader ",e);
|
||||
}
|
||||
|
||||
return map;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ge transfer publishing on thredds for id.
|
||||
*
|
||||
* @param session the session
|
||||
* @param transferId the transfer id
|
||||
* @return the transfer on thredds report
|
||||
*/
|
||||
public static TransferOnThreddsReport geTransferPublishingOnThreddsForId(HttpSession session, String transferId){
|
||||
|
||||
Map<String, TransferOnThreddsReport> map = getMapTransferPublishingOnThredds(session);
|
||||
|
||||
if(map!=null){
|
||||
return map.get(transferId);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prints the as sys out.
|
||||
*
|
||||
* @param txt the txt
|
||||
*/
|
||||
public static void printAsSysOut(String txt) {
|
||||
|
||||
System.out.println(txt);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
package org.gcube.portlets.widgets.wsthreddssync.shared;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
* The Class GcubeVRE.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Feb 14, 2018
|
||||
*/
|
||||
public class GcubeScope implements Serializable, IsSerializable{
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -6427520549519606384L;
|
||||
|
||||
|
||||
private GcubeScopeType scopeType;
|
||||
|
||||
|
||||
private String scopeTitle;
|
||||
|
||||
|
||||
private String scopeName;
|
||||
|
||||
/**
|
||||
* Instantiates a new gcube VRE.
|
||||
*/
|
||||
public GcubeScope() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new gcube scope.
|
||||
*
|
||||
* @param scopeTitle the scope title
|
||||
* @param scopeName the scope name
|
||||
* @param scopeType the scope type
|
||||
*/
|
||||
public GcubeScope(String scopeTitle, String scopeName, GcubeScopeType scopeType) {
|
||||
|
||||
super();
|
||||
this.scopeTitle = scopeTitle;
|
||||
this.scopeName = scopeName;
|
||||
this.scopeType = scopeType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the scopeType
|
||||
*/
|
||||
public GcubeScopeType getScopeType() {
|
||||
|
||||
return scopeType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the scopeTitle
|
||||
*/
|
||||
public String getScopeTitle() {
|
||||
|
||||
return scopeTitle;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the scopeName
|
||||
*/
|
||||
public String getScopeName() {
|
||||
|
||||
return scopeName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param scopeType the scopeType to set
|
||||
*/
|
||||
public void setScopeType(GcubeScopeType scopeType) {
|
||||
|
||||
this.scopeType = scopeType;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param scopeTitle the scopeTitle to set
|
||||
*/
|
||||
public void setScopeTitle(String scopeTitle) {
|
||||
|
||||
this.scopeTitle = scopeTitle;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param scopeName the scopeName to set
|
||||
*/
|
||||
public void setScopeName(String scopeName) {
|
||||
|
||||
this.scopeName = scopeName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("GcubeScope [scopeType=");
|
||||
builder.append(scopeType);
|
||||
builder.append(", scopeTitle=");
|
||||
builder.append(scopeTitle);
|
||||
builder.append(", scopeName=");
|
||||
builder.append(scopeName);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.widgets.wsthreddssync.shared;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The Enum GcubeScopeType.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Mar 12, 2018
|
||||
*/
|
||||
public enum GcubeScopeType {
|
||||
|
||||
ROOT,
|
||||
VO,
|
||||
VRE
|
||||
}
|
@ -1,111 +0,0 @@
|
||||
package org.gcube.portlets.widgets.wsthreddssync.shared;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
* The Class GcubeVRE.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Feb 14, 2018
|
||||
*/
|
||||
public class GcubeVRE implements Serializable, IsSerializable{
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -6427520549519606384L;
|
||||
|
||||
/** The vre name. */
|
||||
private String vreName;
|
||||
|
||||
/** The vre scope. */
|
||||
private String vreScope;
|
||||
|
||||
/**
|
||||
* Instantiates a new gcube VRE.
|
||||
*/
|
||||
public GcubeVRE() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new gcube VRE.
|
||||
*
|
||||
* @param vreName the vre name
|
||||
* @param vreScope the vre scope
|
||||
*/
|
||||
public GcubeVRE(String vreName, String vreScope) {
|
||||
|
||||
super();
|
||||
this.vreName = vreName;
|
||||
this.vreScope = vreScope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the vre name.
|
||||
*
|
||||
* @return the vreName
|
||||
*/
|
||||
public String getVreName() {
|
||||
|
||||
return vreName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the vre scope.
|
||||
*
|
||||
* @return the vreScope
|
||||
*/
|
||||
public String getVreScope() {
|
||||
|
||||
return vreScope;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the vre name.
|
||||
*
|
||||
* @param vreName the vreName to set
|
||||
*/
|
||||
public void setVreName(String vreName) {
|
||||
|
||||
this.vreName = vreName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the vre scope.
|
||||
*
|
||||
* @param vreScope the vreScope to set
|
||||
*/
|
||||
public void setVreScope(String vreScope) {
|
||||
|
||||
this.vreScope = vreScope;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("GcubeVRE [vreName=");
|
||||
builder.append(vreName);
|
||||
builder.append(", vreScope=");
|
||||
builder.append(vreScope);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,201 +0,0 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.widgets.wsthreddssync.shared;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
* The Class TransferOnThreddsReport.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Feb 7, 2018
|
||||
*/
|
||||
public class TransferOnThreddsReport implements Serializable, IsSerializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 326492579557983L;
|
||||
|
||||
/** The transfer id. */
|
||||
private String transferId;
|
||||
|
||||
/** The folder id. */
|
||||
private String folderId;
|
||||
|
||||
/** The on error. */
|
||||
private Boolean onError = false;
|
||||
|
||||
/** The report message. */
|
||||
private String reportMessage = null;
|
||||
|
||||
/** The report created on workspace. */
|
||||
private Boolean reportCreatedOnWorkspace = false;
|
||||
|
||||
/**
|
||||
* Instantiates a new transfer on thredds report.
|
||||
*/
|
||||
public TransferOnThreddsReport() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new transfer on thredds report.
|
||||
*
|
||||
* @param transferId the transfer id
|
||||
* @param folderId the folder id
|
||||
* @param onError the on error
|
||||
* @param reportMessage the report message
|
||||
*/
|
||||
public TransferOnThreddsReport(String transferId, String folderId, Boolean onError, String reportMessage) {
|
||||
|
||||
this.transferId = transferId;
|
||||
this.folderId = folderId;
|
||||
this.onError = onError;
|
||||
this.reportMessage = reportMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the report created on workspace.
|
||||
*
|
||||
* @param reportCreatedOnWorkspace the reportCreated to set
|
||||
*/
|
||||
public void setReportCreatedOnWorkspace(Boolean reportCreatedOnWorkspace) {
|
||||
|
||||
this.reportCreatedOnWorkspace = reportCreatedOnWorkspace;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if is transferring report available.
|
||||
*
|
||||
* @return the boolean
|
||||
*/
|
||||
public Boolean isTransferringReportAvailable() {
|
||||
|
||||
return reportCreatedOnWorkspace;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the transfer id.
|
||||
*
|
||||
* @return the transferId
|
||||
*/
|
||||
public String getTransferId() {
|
||||
|
||||
return transferId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the folder id.
|
||||
*
|
||||
* @return the folderId
|
||||
*/
|
||||
public String getFolderId() {
|
||||
|
||||
return folderId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the on error.
|
||||
*
|
||||
* @return the onError
|
||||
*/
|
||||
public Boolean isOnError() {
|
||||
|
||||
return onError;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the transfer id.
|
||||
*
|
||||
* @param transferId the transferId to set
|
||||
*/
|
||||
public void setTransferId(String transferId) {
|
||||
|
||||
this.transferId = transferId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the folder id.
|
||||
*
|
||||
* @param folderId the folderId to set
|
||||
*/
|
||||
public void setFolderId(String folderId) {
|
||||
|
||||
this.folderId = folderId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the on error.
|
||||
*
|
||||
* @param onError the onError to set
|
||||
*/
|
||||
public void setOnError(Boolean onError) {
|
||||
|
||||
this.onError = onError;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets the report message.
|
||||
*
|
||||
* @return the reportMessage
|
||||
*/
|
||||
public String getReportMessage() {
|
||||
|
||||
return reportMessage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the report message.
|
||||
*
|
||||
* @param reportMessage the reportMessage to set
|
||||
*/
|
||||
public void setReportMessage(String reportMessage) {
|
||||
|
||||
this.reportMessage = reportMessage;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("TransferOnThreddsReport [transferId=");
|
||||
builder.append(transferId);
|
||||
builder.append(", folderId=");
|
||||
builder.append(folderId);
|
||||
builder.append(", onError=");
|
||||
builder.append(onError);
|
||||
builder.append(", reportMessage=");
|
||||
builder.append(reportMessage);
|
||||
builder.append(", reportCreated=");
|
||||
builder.append(reportCreatedOnWorkspace);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,232 +0,0 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.widgets.wsthreddssync.shared;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
|
||||
|
||||
|
||||
// TODO: Auto-generated Javadoc
|
||||
/**
|
||||
* The Class TransferToThreddsProperty.
|
||||
*
|
||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Feb 7, 2018
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlRootElement
|
||||
public class TransferToThreddsProperty implements Serializable{
|
||||
|
||||
|
||||
/** The folder id. */
|
||||
private String folderId;
|
||||
|
||||
/** The catalogue name. */
|
||||
private String catalogueName;
|
||||
|
||||
/** The vre name. */
|
||||
private String vreName;
|
||||
|
||||
/** The vre scope. */
|
||||
private String vreScope;
|
||||
|
||||
/** The metadata folder id. */
|
||||
private String metadataFolderId;
|
||||
|
||||
/** The metadata folder name. */
|
||||
private String metadataFolderName;
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new transfering to thredds property.
|
||||
*/
|
||||
public TransferToThreddsProperty() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Instantiates a new transfering to thredds property.
|
||||
*
|
||||
* @param folderId the folder id
|
||||
* @param catalogueName the catalogue name
|
||||
* @param vreName the vre name
|
||||
* @param vreScope the vre scope
|
||||
* @param metadataFolderId the metadata folder id
|
||||
* @param metadataFolderName the metadata folder name
|
||||
*/
|
||||
public TransferToThreddsProperty(
|
||||
String folderId, String catalogueName, String vreName,
|
||||
String vreScope, String metadataFolderId, String metadataFolderName) {
|
||||
|
||||
super();
|
||||
this.folderId = folderId;
|
||||
this.catalogueName = catalogueName;
|
||||
this.vreName = vreName;
|
||||
this.vreScope = vreScope;
|
||||
this.metadataFolderId = metadataFolderId;
|
||||
this.metadataFolderName = metadataFolderName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the folder id.
|
||||
*
|
||||
* @return the folderId
|
||||
*/
|
||||
public String getFolderId() {
|
||||
|
||||
return folderId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the catalogue name.
|
||||
*
|
||||
* @return the catalogueName
|
||||
*/
|
||||
public String getCatalogueName() {
|
||||
|
||||
return catalogueName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the vre name.
|
||||
*
|
||||
* @return the vreName
|
||||
*/
|
||||
public String getVreName() {
|
||||
|
||||
return vreName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the vre scope.
|
||||
*
|
||||
* @return the vreScope
|
||||
*/
|
||||
public String getVreScope() {
|
||||
|
||||
return vreScope;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the metadata folder id.
|
||||
*
|
||||
* @return the metadataFolderId
|
||||
*/
|
||||
public String getMetadataFolderId() {
|
||||
|
||||
return metadataFolderId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the metadata folder name.
|
||||
*
|
||||
* @return the metadataFolderName
|
||||
*/
|
||||
public String getMetadataFolderName() {
|
||||
|
||||
return metadataFolderName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the folder id.
|
||||
*
|
||||
* @param folderId the folderId to set
|
||||
*/
|
||||
public void setFolderId(String folderId) {
|
||||
|
||||
this.folderId = folderId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the catalogue name.
|
||||
*
|
||||
* @param catalogueName the catalogueName to set
|
||||
*/
|
||||
public void setCatalogueName(String catalogueName) {
|
||||
|
||||
this.catalogueName = catalogueName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the vre name.
|
||||
*
|
||||
* @param vreName the vreName to set
|
||||
*/
|
||||
public void setVreName(String vreName) {
|
||||
|
||||
this.vreName = vreName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the vre scope.
|
||||
*
|
||||
* @param vreScope the vreScope to set
|
||||
*/
|
||||
public void setVreScope(String vreScope) {
|
||||
|
||||
this.vreScope = vreScope;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the metadata folder id.
|
||||
*
|
||||
* @param metadataFolderId the metadataFolderId to set
|
||||
*/
|
||||
public void setMetadataFolderId(String metadataFolderId) {
|
||||
|
||||
this.metadataFolderId = metadataFolderId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the metadata folder name.
|
||||
*
|
||||
* @param metadataFolderName the metadataFolderName to set
|
||||
*/
|
||||
public void setMetadataFolderName(String metadataFolderName) {
|
||||
|
||||
this.metadataFolderName = metadataFolderName;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("TransferToThreddsProperty [folderId=");
|
||||
builder.append(folderId);
|
||||
builder.append(", catalogueName=");
|
||||
builder.append(catalogueName);
|
||||
builder.append(", vreName=");
|
||||
builder.append(vreName);
|
||||
builder.append(", vreScope=");
|
||||
builder.append(vreScope);
|
||||
builder.append(", metadataFolderId=");
|
||||
builder.append(metadataFolderId);
|
||||
builder.append(", metadataFolderName=");
|
||||
builder.append(metadataFolderName);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue