Skip to content
Snippets Groups Projects
Commit b20206f6 authored by brinn's avatar brinn
Browse files

Add getDataStoreBaseUrl() to AggregationServiceDescription to be able to put...

Add getDataStoreBaseUrl() to AggregationServiceDescription to be able to put files for an aggregation service.

SVN: 26270
parent b0902b01
No related branches found
No related tags found
No related merge requests found
...@@ -195,7 +195,8 @@ public class QueryApiServer extends AbstractServer<IQueryApiServer> implements I ...@@ -195,7 +195,8 @@ public class QueryApiServer extends AbstractServer<IQueryApiServer> implements I
{ {
checkSession(sessionToken); checkSession(sessionToken);
List<AggregationServiceDescription> services = new ArrayList<AggregationServiceDescription>(); List<AggregationServiceDescription> services =
new ArrayList<AggregationServiceDescription>();
List<DataStorePE> dataStores = getDAOFactory().getDataStoreDAO().listDataStores(); List<DataStorePE> dataStores = getDAOFactory().getDataStoreDAO().listDataStores();
for (DataStorePE dataStore : dataStores) for (DataStorePE dataStore : dataStores)
{ {
...@@ -211,6 +212,7 @@ public class QueryApiServer extends AbstractServer<IQueryApiServer> implements I ...@@ -211,6 +212,7 @@ public class QueryApiServer extends AbstractServer<IQueryApiServer> implements I
AggregationServiceDescription info = new AggregationServiceDescription(); AggregationServiceDescription info = new AggregationServiceDescription();
info.setServiceKey(service.getKey()); info.setServiceKey(service.getKey());
info.setDataStoreCode(dataStore.getCode()); info.setDataStoreCode(dataStore.getCode());
info.setDataStoreBaseUrl(dataStore.getDownloadUrl());
services.add(info); services.add(info);
} }
} }
...@@ -219,13 +221,16 @@ public class QueryApiServer extends AbstractServer<IQueryApiServer> implements I ...@@ -219,13 +221,16 @@ public class QueryApiServer extends AbstractServer<IQueryApiServer> implements I
} }
@Override @Override
public QueryTableModel createReportFromAggregationService(String sessionToken, String dataStoreCode, String serviceKey, Map<String, Object> parameters) public QueryTableModel createReportFromAggregationService(String sessionToken,
String dataStoreCode, String serviceKey, Map<String, Object> parameters)
{ {
checkSession(sessionToken); checkSession(sessionToken);
DatastoreServiceDescription description = DatastoreServiceDescription description =
DatastoreServiceDescription.reporting(serviceKey, "", new String[0], dataStoreCode, ReportingPluginType.AGGREGATION_TABLE_MODEL); DatastoreServiceDescription.reporting(serviceKey, "", new String[0], dataStoreCode,
return translate(commonServer.createReportFromAggregationService(sessionToken, description, parameters)); ReportingPluginType.AGGREGATION_TABLE_MODEL);
return translate(commonServer.createReportFromAggregationService(sessionToken, description,
parameters));
} }
@Override @Override
...@@ -237,7 +242,7 @@ public class QueryApiServer extends AbstractServer<IQueryApiServer> implements I ...@@ -237,7 +242,7 @@ public class QueryApiServer extends AbstractServer<IQueryApiServer> implements I
@Override @Override
public int getMinorVersion() public int getMinorVersion()
{ {
return 3; return 4;
} }
private QueryTableModel translate(TableModel result) private QueryTableModel translate(TableModel result)
......
...@@ -28,7 +28,7 @@ import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.QueryTableModel; ...@@ -28,7 +28,7 @@ import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.QueryTableModel;
import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.ReportDescription; import ch.systemsx.cisd.openbis.plugin.query.shared.api.v1.dto.ReportDescription;
/** /**
* Public API interface to query server (version 1.2). * Public API interface to query server (version 1.4).
* *
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
...@@ -114,7 +114,7 @@ public interface IQueryApiServer extends IRpcService ...@@ -114,7 +114,7 @@ public interface IQueryApiServer extends IRpcService
* @since 1.3 * @since 1.3
*/ */
@Transactional(readOnly = true) @Transactional(readOnly = true)
public QueryTableModel createReportFromAggregationService(String sessionToken, String dataStoreCode, public QueryTableModel createReportFromAggregationService(String sessionToken,
String serviceKey, Map<String, Object> parameters); String dataStoreCode, String serviceKey, Map<String, Object> parameters);
} }
...@@ -32,18 +32,30 @@ public class AggregationServiceDescription implements Serializable ...@@ -32,18 +32,30 @@ public class AggregationServiceDescription implements Serializable
private String dataStoreCode; private String dataStoreCode;
private String dataStoreBaseUrl;
private String serviceKey; private String serviceKey;
private AggregationServiceType type; private AggregationServiceType type;
/** /**
* The code of the data store the provides this service. Non-null. * The code of the data store that provides this service. Non-null.
*/ */
public String getDataStoreCode() public String getDataStoreCode()
{ {
return dataStoreCode; return dataStoreCode;
} }
/**
* Returns the base URL of the data store that provides this service. Non-null.
*
* @since 1.4
*/
public String getDataStoreBaseUrl()
{
return dataStoreBaseUrl;
}
/** /**
* The key that identifies this particular service. Non-null. * The key that identifies this particular service. Non-null.
*/ */
...@@ -67,6 +79,11 @@ public class AggregationServiceDescription implements Serializable ...@@ -67,6 +79,11 @@ public class AggregationServiceDescription implements Serializable
this.dataStoreCode = dataStoreCode; this.dataStoreCode = dataStoreCode;
} }
public void setDataStoreBaseUrl(String dataStoreBaseUrl)
{
this.dataStoreBaseUrl = dataStoreBaseUrl;
}
public void setServiceKey(String key) public void setServiceKey(String key)
{ {
this.serviceKey = key; this.serviceKey = key;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment