diff --git a/data-access/engine/Makefile b/data-access/engine/Makefile index bb728ded32f7de86da2dd5e2ede7ecf8f262968a..d44feed36de73e02dcf9abed3627135712991e67 100644 --- a/data-access/engine/Makefile +++ b/data-access/engine/Makefile @@ -45,6 +45,10 @@ uninstall: # vlkb-devel site local +.PHONY: vlkb-devel +vlkb-devel: stop uninstall clean build install config start + + .PHONY: config config: diff --git a/data-access/servlet/config/Makefile b/data-access/servlet/config/Makefile index 93856fc8b2fd5a498ac263c9f8b99c185b668221..6e549a0f124eaff9127db3a0ca219d01e46d0cba 100644 --- a/data-access/servlet/config/Makefile +++ b/data-access/servlet/config/Makefile @@ -1,9 +1,11 @@ ################################################################ # args AMQP_QUEUE ?= vlkbdevel +# if amqp_host_name empty -> uses ExecCmd vlkb for cutout (not AMQP+vlkbd) -# localhost pasquale pasqule-devel -DBMS ?= localhost +# Resolver DB: <none> localhost pasquale pasqule-devel +# DBMS ?= localhost +# if <none> uses ResolverById # test prod #FITSDB ?= test @@ -12,7 +14,6 @@ CONTEXT_ROOT ?= vlkb/datasets # <empty> ia2token garrtoken basic AUTH ?= -#NAUTHZ ?= anonymous ################################################################ diff --git a/data-access/servlet/config/cutout.properties.in b/data-access/servlet/config/cutout.properties.in index 96e9782c9eac23d9fe8ebf261fc2f9a1a69f7c38..af593049a2852d14d3dcb5d8abda646533e8ba62 100644 --- a/data-access/servlet/config/cutout.properties.in +++ b/data-access/servlet/config/cutout.properties.in @@ -9,21 +9,21 @@ default_spec_system=VELO_LSRK # MIME-type of the response (only one of [1][2][3]) # [1]: -default_response_format=application/x-vlkb+xml +# default_response_format=application/fits # [2]: # default_response_format=application/fits;createfile=yes # fits_path_cutouts=/srv/vlkb/cutouts -# amqp_host_name=localhost +# amqp_host_name= # amqp_port=5672 # amqp_routing_key=AMQP_QUEUE # [3]: -# default_response_format=application/x-vlkb+xml -# surveys_metadata_abs_pathname=/srv/vlkb/surveys/survey_populate.csv -# fits_path_cutouts=/srv/vlkb/cutouts -# fits_url_cutouts=http://localhost:8080/CONTEXT_ROOT/cutouts -# amqp_host_name=localhost +default_response_format=application/x-vlkb+xml +surveys_metadata_abs_pathname=/srv/vlkb/surveys/survey_populate.csv +fits_path_cutouts=/srv/vlkb/cutouts +fits_url_cutouts=http://vlkb-devel.ia2.inaf.it:8080/CONTEXT_ROOT/cutouts +# amqp_host_name= # amqp_port=5672 # amqp_routing_key=AMQP_QUEUE diff --git a/data-access/servlet/config/dbms.conf- b/data-access/servlet/config/dbms.conf- new file mode 100644 index 0000000000000000000000000000000000000000..ae63d7c2df3c47b109091314ea6dd86ed021921b --- /dev/null +++ b/data-access/servlet/config/dbms.conf- @@ -0,0 +1 @@ +# DBMS=<empty> -> Resolver will attempt ResolverById diff --git a/data-access/servlet/src/main/java/datasets/CutoutImpl.java b/data-access/servlet/src/main/java/datasets/CutoutImpl.java index a253c4cc671b5bbeaefdc3f0c7eafce2434130a9..cd2a6e9e6af5d42934dca63c0c4e182580f7d3a8 100644 --- a/data-access/servlet/src/main/java/datasets/CutoutImpl.java +++ b/data-access/servlet/src/main/java/datasets/CutoutImpl.java @@ -193,9 +193,13 @@ class CutoutImpl implements Cutout if(settings.amqpConn.isHostnameEmpty()) { + LOGGER.info("Using doStream() to local file"); + String absSubimgPathname = settings.fitsPaths.cutouts() + "/" + generateSubimgPathname(relPathname, hdunum); + LOGGER.info("Uses local filename : " + absSubimgPathname); + OutputStream fileOutputStream = new FileOutputStream( new File(absSubimgPathname) ); doStream(relPathname, hdunum, pos, band, time, pol, fileOutputStream); @@ -211,6 +215,8 @@ class CutoutImpl implements Cutout } else { + LOGGER.info("Using AMQP"); + JsonEncoder jReq = new JsonEncoder(); jReq.add(relPathname, hdunum); jReq.add(pos); diff --git a/data-access/servlet/src/main/java/webapi/ServletCutout.java b/data-access/servlet/src/main/java/webapi/ServletCutout.java index 8b77375f2663d9477543877e6b99b565228571e5..bfad95284f81df93f631bb07da6d90bf73acf751 100644 --- a/data-access/servlet/src/main/java/webapi/ServletCutout.java +++ b/data-access/servlet/src/main/java/webapi/ServletCutout.java @@ -146,7 +146,7 @@ public class ServletCutout extends javax.servlet.http.HttpServlet String dbUri = settings.dbConn.uri(); - if((dbUri == null) || dbUri.trim().isEmpty()) + if(settings.dbConn.isDbUriEmpty()) { Resolver rsl = new ResolverFromId(); rsl.resolve(id); diff --git a/data-access/servlet/src/main/java/webapi/Settings.java b/data-access/servlet/src/main/java/webapi/Settings.java index c56f91a3605a79545cf380366d233dced18ce698..30be9a733ff210e08566388765e28d6ec3937871 100644 --- a/data-access/servlet/src/main/java/webapi/Settings.java +++ b/data-access/servlet/src/main/java/webapi/Settings.java @@ -45,6 +45,11 @@ class Settings return uri() + " [" + schema + "] " + user_name + " / " + password + " "; } + public boolean isDbUriEmpty() + { + return ((uri == null) || uri.trim().isEmpty()); + } + public String uri() { return uri; } public String schema() { return schema; } public String userName() { return user_name; } @@ -167,7 +172,7 @@ class Settings private static AMQPConn loadAMQPConn(Properties properties) { AMQPConn amqpconn = new AMQPConn(); - amqpconn.hostName = properties.getProperty("amqp_host_name", "localhost").strip(); + amqpconn.hostName = properties.getProperty("amqp_host_name", "").strip(); String strPortNum = properties.getProperty("amqp_port", "5672").strip(); amqpconn.portNum = Integer.parseInt(strPortNum); amqpconn.routingKey = properties.getProperty("amqp_routing_key", "").strip(); diff --git a/data-access/servlet/src/main/resources/cutout.properties b/data-access/servlet/src/main/resources/cutout.properties index ad6722dd92a63a2641b732cecb0888a17d1968bf..5d4a790c8a6bbd0a44f14677ef5e5785f6623696 100644 --- a/data-access/servlet/src/main/resources/cutout.properties +++ b/data-access/servlet/src/main/resources/cutout.properties @@ -26,7 +26,7 @@ # surveys_metadata_abs_pathname=/srv/surveys/survey_populate.csv # fits_path_cutouts=/srv/cutouts # fits_url_cutouts= -# amqp_host_name=localhost +# amqp_host_name= # amqp_port=5672 # amqp_routing_key=