git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngineSmartExecutor@133574 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
def1b34335
commit
3d03f95946
|
@ -16,7 +16,10 @@ public abstract class StandardLocalInfraAlgorithm extends StandardLocalExternalA
|
||||||
|
|
||||||
String serviceAddress = InfraRetrieval.findEmailingSystemAddress(config.getGcubeScope());
|
String serviceAddress = InfraRetrieval.findEmailingSystemAddress(config.getGcubeScope());
|
||||||
|
|
||||||
String requestForMessage = serviceAddress + "/messages/writeMessageToUsers" + "?gcube-token=" + config.getGcubeToken();
|
if (!serviceAddress.endsWith("/"))
|
||||||
|
serviceAddress = serviceAddress+"/";
|
||||||
|
|
||||||
|
String requestForMessage = serviceAddress + "messages/writeMessageToUsers" + "?gcube-token=" + config.getGcubeToken();
|
||||||
requestForMessage = requestForMessage.replace("http://", "https://").replace(":80", ""); // remove the port (or set it to 443) otherwise you get an SSL error
|
requestForMessage = requestForMessage.replace("http://", "https://").replace(":80", ""); // remove the port (or set it to 443) otherwise you get an SSL error
|
||||||
|
|
||||||
AnalysisLogger.getLogger().debug("Emailing System->Request url is going to be " + requestForMessage);
|
AnalysisLogger.getLogger().debug("Emailing System->Request url is going to be " + requestForMessage);
|
||||||
|
|
|
@ -19,7 +19,8 @@ public class TestEmailingSystem {
|
||||||
config.setParam("DatabaseURL", "jdbc:postgresql://statistical-manager.d.d4science.research-infrastructures.eu/testdb");
|
config.setParam("DatabaseURL", "jdbc:postgresql://statistical-manager.d.d4science.research-infrastructures.eu/testdb");
|
||||||
config.setPersistencePath("./");
|
config.setPersistencePath("./");
|
||||||
//config.setGcubeScope("/gcube/devNext/NextNext");
|
//config.setGcubeScope("/gcube/devNext/NextNext");
|
||||||
config.setGcubeScope("/gcube/devNext/NextNext");
|
// config.setGcubeScope("/gcube/devNext/NextNext");
|
||||||
|
config.setGcubeScope("/gcube");
|
||||||
config.setParam("ServiceUserName", "gianpaolo.coro");
|
config.setParam("ServiceUserName", "gianpaolo.coro");
|
||||||
config.setParam("DatabaseDriver", "org.postgresql.Driver");
|
config.setParam("DatabaseDriver", "org.postgresql.Driver");
|
||||||
config.setGcubeUserName("gianpaolo.coro");
|
config.setGcubeUserName("gianpaolo.coro");
|
||||||
|
|
|
@ -57,10 +57,16 @@ public class InfraRetrieval {
|
||||||
|
|
||||||
|
|
||||||
public static String findEmailingSystemAddress(String scope) throws Exception {
|
public static String findEmailingSystemAddress(String scope) throws Exception {
|
||||||
|
|
||||||
|
String serviceName = "SocialNetworking";
|
||||||
|
String serviceClass = "Portal";
|
||||||
|
|
||||||
|
List<String> endpoints = retrieveServiceAddress(serviceClass, serviceName,scope,"test");
|
||||||
|
|
||||||
|
|
||||||
|
/* new code - deprecated
|
||||||
String resource = "jersey-servlet";
|
String resource = "jersey-servlet";
|
||||||
String serviceName = "SocialNetworking";
|
|
||||||
String serviceClass = "Portal";
|
|
||||||
SimpleQuery query = ICFactory.queryFor(GCoreEndpoint.class);
|
SimpleQuery query = ICFactory.queryFor(GCoreEndpoint.class);
|
||||||
query.addCondition(String.format("$resource/Profile/ServiceClass/text() eq '%s'",serviceClass));
|
query.addCondition(String.format("$resource/Profile/ServiceClass/text() eq '%s'",serviceClass));
|
||||||
query.addCondition("$resource/Profile/DeploymentData/Status/text() eq 'ready'");
|
query.addCondition("$resource/Profile/DeploymentData/Status/text() eq 'ready'");
|
||||||
|
@ -69,13 +75,20 @@ public class InfraRetrieval {
|
||||||
|
|
||||||
DiscoveryClient<String> client = ICFactory.client();
|
DiscoveryClient<String> client = ICFactory.client();
|
||||||
List<String> endpoints = client.submit(query);
|
List<String> endpoints = client.submit(query);
|
||||||
if (endpoints == null || endpoints.isEmpty()) throw new Exception("Cannot retrieve the GCoreEndpoint serviceName: "+serviceName +", serviceClass: " +serviceClass +", in scope: "+scope);
|
|
||||||
|
|
||||||
String resourceEntyName = endpoints.get(0);
|
|
||||||
|
|
||||||
if(resourceEntyName==null)
|
|
||||||
throw new Exception("Endpoint:"+resource+", is null for serviceName: "+serviceName +", serviceClass: " +serviceClass +", in scope: "+scope);
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
String resourceEntyName = endpoints.get(0);
|
||||||
|
if (endpoints == null || endpoints.isEmpty()) throw new Exception("Cannot retrieve the GCoreEndpoint serviceName: "+serviceName +", serviceClass: " +serviceClass +", in scope: "+scope);
|
||||||
|
|
||||||
|
if(resourceEntyName==null)
|
||||||
|
throw new Exception("Endpoint:"+serviceName+", is null for serviceName: "+serviceName +", serviceClass: " +serviceClass +", in scope: "+scope);
|
||||||
|
|
||||||
|
|
||||||
return resourceEntyName;
|
return resourceEntyName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue