Skip to content
Snippets Groups Projects
Commit f46876ef authored by Jörn Künsemöller's avatar Jörn Künsemöller
Browse files

Task #9895 - Qpid-enabled services, installable with cmake.

parent 27e6b5ff
No related branches found
No related tags found
No related merge requests found
Showing
with 3514 additions and 0 deletions
......@@ -5774,6 +5774,72 @@ SAS/Scheduler/test/unittest/testGui/testGui.sh eol=lf
SAS/Scheduler/test/unittest/testqstring/testqstring.run eol=lf
SAS/Scheduler/test/unittest/testqstring/testqstring.sh eol=lf
SAS/Scheduler/test/unittest/tojunit.xslt -text
SAS/Specification_Services/CMakeLists.txt -text
SAS/Specification_Services/bin/CMakeLists.txt -text
SAS/Specification_Services/bin/specificationservice -text
SAS/Specification_Services/bin/specificationtranslationservice -text
SAS/Specification_Services/bin/specificationvalidationservice -text
SAS/Specification_Services/lib/CMakeLists.txt -text
SAS/Specification_Services/lib/LofarBase.xsd -text
SAS/Specification_Services/lib/LofarHistorical.xsd -text
SAS/Specification_Services/lib/LofarMoM2.xsd -text
SAS/Specification_Services/lib/LofarProject.xsd -text
SAS/Specification_Services/lib/LofarSpecification.xsd -text
SAS/Specification_Services/lib/LofarTrigger.xsd -text
SAS/Specification_Services/lib/MoM2.xsd -text
SAS/Specification_Services/lib/PersistentObjects.xsd -text
SAS/Specification_Services/lib/UserAdmin.xsd -text
SAS/Specification_Services/lib/__init__.py -text
SAS/Specification_Services/lib/config.py -text
SAS/Specification_Services/lib/specification_service.py -text
SAS/Specification_Services/lib/specification_service_rpc.py -text
SAS/Specification_Services/lib/translation_service.py -text
SAS/Specification_Services/lib/translation_service_rpc.py -text
SAS/Specification_Services/lib/validation_service.py -text
SAS/Specification_Services/lib/validation_service_rpc.py -text
SAS/Specification_Services/test/CMakeLists.txt -text
SAS/Specification_Services/test/setup_queues_and_services.sh -text
SAS/Trigger_Services/CMakeLists.txt -text
SAS/Trigger_Services/TriggerReceptionService/CMakeLists.txt -text
SAS/Trigger_Services/TriggerReceptionService/__init__.py -text
SAS/Trigger_Services/TriggerReceptionService/bin/CMakeLists.txt -text
SAS/Trigger_Services/TriggerReceptionService/bin/triggerrestinterface -text
SAS/Trigger_Services/TriggerReceptionService/bin/triggerservice -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/db.sqlite3 -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/manage.py -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/.idea/.name -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/.idea/encodings.xml -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/.idea/inspectionProfiles/Project_Default.xml -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/.idea/inspectionProfiles/profiles_settings.xml -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/.idea/misc.xml -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/.idea/modules.xml -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/.idea/scopes/scope_settings.xml -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/.idea/triggerservice.iml -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/.idea/vcs.xml -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/.idea/workspace.xml -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/__init__.py -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/credentials.py -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/settings.py -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/triggerinterface/__init__.py -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/triggerinterface/admin.py -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/triggerinterface/apps.py -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/triggerinterface/migrations/__init__.py -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/triggerinterface/models.py -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/triggerinterface/serializers.py -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/triggerinterface/tests.py -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/triggerinterface/views.py -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/urls.py -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/restinterface/wsgi.py -text
SAS/Trigger_Services/TriggerReceptionService/django_rest/urls.py -text
SAS/Trigger_Services/TriggerReceptionService/lib/CMakeLists.txt -text
SAS/Trigger_Services/TriggerReceptionService/lib/__init__.py -text
SAS/Trigger_Services/TriggerReceptionService/lib/config.py -text
SAS/Trigger_Services/TriggerReceptionService/lib/trigger_service.py -text
SAS/Trigger_Services/TriggerReceptionService/lib/trigger_service_rpc.py -text
SAS/Trigger_Services/TriggerReceptionService/test/CMakeLists.txt -text
SAS/Trigger_Services/TriggerReceptionService/test/setup_queues_and_services.sh -text
SAS/Trigger_Services/TriggerReceptionService/test/trigger-testing.xml -text
SAS/Trigger_Services/TriggerReceptionService/test/trigger_misc_testing_nov2016.xml -text
SAS/XML_generator/CMakeLists.txt -text
SAS/XML_generator/src/CMakeLists.txt -text
SAS/XML_generator/src/xmlgen -text
......
......@@ -10,6 +10,7 @@ lofar_add_package(CleanupTool)
lofar_add_package(OTDB_Services)
lofar_add_package(XML_generator)
lofar_add_package(Trigger_Services)
lofar_add_package(Specification_Services)
add_subdirectory(MoM)
add_subdirectory(ResourceAssignment)
......
lofar_find_package(Python 2.7 REQUIRED)
lofar_package(sip 0.1 DEPENDS PyCommon)
include(PythonInstall)
add_subdirectory(lib)
add_subdirectory(bin)
add_subdirectory(test)
lofar_add_bin_scripts(specificationservice)
lofar_add_bin_scripts(specificationtranslationservice)
lofar_add_bin_scripts(specificationvalidationservice)
#!/usr/bin/python
# Copyright (C) 2012-2015 ASTRON (Netherlands Institute for Radio Astronomy)
# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The LOFAR software suite is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
# Executable for the Lofar specification service
from lofar.specificationservices.specification_service import main
import sys
import logging
logger = logging.getLogger(__name__)
if __name__ == '__main__':
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO)
main()
#!/usr/bin/python
# Copyright (C) 2012-2015 ASTRON (Netherlands Institute for Radio Astronomy)
# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The LOFAR software suite is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
# Executable for the specification translation service
# The service converts different specification formats
from lofar.specificationservices.translation_service import main
import sys
import logging
logger = logging.getLogger(__name__)
if __name__ == '__main__':
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO)
main()
#!/usr/bin/python
# Copyright (C) 2012-2015 ASTRON (Netherlands Institute for Radio Astronomy)
# P.O. Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# The LOFAR software suite is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
# Executable for the specification validation service
from lofar.specificationservices.validation_service import main
import sys
import logging
logger = logging.getLogger(__name__)
if __name__ == '__main__':
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO)
main()
# $Id$
lofar_find_package(Python 2.7 REQUIRED)
include(PythonInstall)
set(_py_files
__init__.py
config.py
specification_service.py
specification_service_rpc.py
translation_service.py
translation_service_rpc.py
validation_service.py
validation_service_rpc.py
)
python_install(${_py_files}
DESTINATION lofar/specificationservices)
set(xsd_files
LofarTrigger.xsd
LofarBase.xsd
LofarProject.xsd
LofarMoM2.xsd
MoM2.xsd
PersistentObjects.xsd
LofarHistorical.xsd
LofarSpecification.xsd
UserAdmin.xsd
)
install(FILES ${xsd_files}
DESTINATION ${PYTHON_INSTALL_DIR}/lofar/specificationservices)
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema targetNamespace="http://www.astron.nl/LofarTrigger" version="0.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.astron.nl/LofarTrigger" xmlns:spec="http://www.astron.nl/LofarSpecification" xmlns:base="http://www.astron.nl/LofarBase">
<xsd:import schemaLocation="LofarSpecification.xsd" namespace="http://www.astron.nl/LofarSpecification"/>
<xsd:import schemaLocation="LofarBase.xsd" namespace="http://www.astron.nl/LofarBase"/>
<xsd:annotation>
<xsd:documentation>Definitions for LOFAR historical storage
This contains extentions of base objects that are needed to track and report the history of these objects.
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>============================LOFAR ============================
TBD
</xsd:documentation>
</xsd:annotation>
<!-- UV DataProduct related declarations -->
<!--xsd:element name="uvDataProduct" substitutionGroup="mom2:anyDataProduct" type="UVDataProduct"/>
<xsd:complexType name="UVDataProduct">
<xsd:complexContent>
<xsd:extension base="DataProduct">
<xsd:sequence>
<xsd:element minOccurs="0" name="name" type="xsd:string"/>
<xsd:element minOccurs="0" name="topology" type="xsd:string"/>
<xsd:element minOccurs="0" name="status" type="xsd:string"/>
<xsd:element minOccurs="0" name="storageCluster" type="StorageCluster"/>
<xsd:element minOccurs="0" name="ownerMom2Object" type="mom2:Mom2ObjectRef"/>
<xsd:choice>
<xsd:element minOccurs="0" name="uri" type="xsd:string"/>
<xsd:element minOccurs="0" name="locations" type="mom2:DataProductLocations"/>
</xsd:choice>
<xsd:element minOccurs="0" name="fileFormat" type="xsd:string"/>
<xsd:element minOccurs="0" name="type" type="xsd:string"/>
<xsd:element minOccurs="0" name="timeStamp" type="xsd:dateTime"/>
<xsd:element minOccurs="0" default="false" name="released" type="xsd:boolean"/>
<xsd:element minOccurs="0" default="false" name="exported" type="xsd:boolean"/>
<xsd:choice minOccurs="0">
<xsd:element ref="specificUVDataProductAttributes"/>
</xsd:choice>
<xsd:element minOccurs="0" name="storageTicket" type="xsd:string"/>
<xsd:element minOccurs="0" name="fileSize" type="xsd:unsignedLong"/>
<xsd:element minOccurs="0" name="checksums" type="ChecksumTypes"/>
</xsd:sequence-->
<!-- xsd:attribute name="id" type="xsd:integer" default="0"/ -->
<!-- xsd:attribute name="mom2DPId" type="xsd:nonNegativeInteger"/ -->
<!--xsd:attribute name="topology" type="xsd:string"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType-->
<!--xsd:element name="specificUVDataProductAttributes" substitutionGroup="mom2:specificAttributes" type="SpecificUVDataProductAttributes"/>
<xsd:complexType name="SpecificUVDataProductAttributes">
<xsd:complexContent>
<xsd:extension base="mom2:SpecificAttributes">
<xsd:sequence>
<xsd:element minOccurs="0" name="subband" type="xsd:nonNegativeInteger"/>
<xsd:element minOccurs="0" name="stationSubband" type="xsd:nonNegativeInteger"/>
<xsd:element minOccurs="0" name="centralFrequency" type="mom2:Frequency"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType--><!-- Beamformed DataProduct related declarations -->
<!--xsd:element name="bfDataProduct" substitutionGroup="mom2:anyDataProduct" type="BFDataProduct"/>
<xsd:complexType name="BFDataProduct">
<xsd:complexContent>
<xsd:extension base="DataProduct">
<xsd:sequence>
<xsd:element minOccurs="0" name="name" type="xsd:string"/>
<xsd:element minOccurs="0" name="topology" type="xsd:string"/>
<xsd:element minOccurs="0" name="status" type="xsd:string"/>
<xsd:element minOccurs="0" name="storageCluster" type="StorageCluster"/>
<xsd:element minOccurs="0" name="ownerMom2Object" type="mom2:Mom2ObjectRef"/>
<xsd:choice>
<xsd:element minOccurs="0" name="uri" type="xsd:string"/>
<xsd:element minOccurs="0" name="locations" type="mom2:DataProductLocations"/>
</xsd:choice>
<xsd:element minOccurs="0" name="fileFormat" type="xsd:string"/>
<xsd:element minOccurs="0" name="type" type="xsd:string"/>
<xsd:element minOccurs="0" name="timeStamp" type="xsd:dateTime"/>
<xsd:element minOccurs="0" default="false" name="released" type="xsd:boolean"/>
<xsd:element minOccurs="0" default="false" name="exported" type="xsd:boolean"/>
<xsd:choice minOccurs="0">
<xsd:element ref="specificBFDataProductAttributes"/>
</xsd:choice>
<xsd:element minOccurs="0" name="storageTicket" type="xsd:string"/>
<xsd:element minOccurs="0" name="fileSize" type="xsd:unsignedLong"/>
<xsd:element minOccurs="0" name="checksums" type="ChecksumTypes"/>
</xsd:sequence-->
<!-- xsd:attribute name="id" type="xsd:integer" default="0"/ -->
<!-- xsd:attribute name="mom2DPId" type="xsd:nonNegativeInteger"/ -->
<!--xsd:attribute name="topology" type="xsd:string"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType-->
<!--xsd:element name="specificBFDataProductAttributes" substitutionGroup="mom2:specificAttributes" type="SpecificBFDataProductAttributes"/>
<xsd:complexType name="SpecificBFDataProductAttributes">
<xsd:complexContent>
<xsd:extension base="mom2:SpecificAttributes">
<xsd:sequence/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType--><!-- TBB DataProduct related declarations -->
<!--xsd:element name="tbbDataProduct" substitutionGroup="mom2:anyDataProduct" type="TBBDataProduct"/>
<xsd:complexType name="TBBDataProduct">
<xsd:complexContent>
<xsd:restriction base="DataProduct">
<xsd:sequence>
<xsd:element minOccurs="0" name="name" type="xsd:string"/>
<xsd:element minOccurs="0" name="topology" type="xsd:string"/>
<xsd:element minOccurs="0" name="status" type="xsd:string"/>
<xsd:element minOccurs="0" name="storageCluster" type="StorageCluster"/>
<xsd:element minOccurs="0" name="ownerMom2Object" type="mom2:Mom2ObjectRef"/>
<xsd:choice>
<xsd:element minOccurs="0" name="uri" type="xsd:string"/>
<xsd:element minOccurs="0" name="locations" type="mom2:DataProductLocations"/>
</xsd:choice>
<xsd:element minOccurs="0" name="fileFormat" type="xsd:string"/>
<xsd:element minOccurs="0" name="type" type="xsd:string"/>
<xsd:element minOccurs="0" name="timeStamp" type="xsd:dateTime"/>
<xsd:element minOccurs="0" default="false" name="released" type="xsd:boolean"/>
<xsd:element minOccurs="0" default="false" name="exported" type="xsd:boolean"/>
<xsd:choice minOccurs="0">
<xsd:element ref="specificTBBDataProductAttributes"/>
</xsd:choice>
<xsd:element minOccurs="0" name="storageTicket" type="xsd:string"/>
<xsd:element minOccurs="0" name="fileSize" type="xsd:unsignedLong"/>
<xsd:element minOccurs="0" name="checksums" type="ChecksumTypes"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:integer" default="0"/>
<xsd:attribute name="mom2DPId" type="xsd:nonNegativeInteger"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="specificTBBDataProductAttributes" substitutionGroup="mom2:specificAttributes" type="SpecificTBBDataProductAttributes"/>
<xsd:complexType name="SpecificTBBDataProductAttributes">
<xsd:complexContent>
<xsd:extension base="mom2:SpecificAttributes">
<xsd:sequence>
<xsd:element minOccurs="0" name="numberOfSamples" type="xsd:positiveInteger"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType--><!-- PixelMap DataProduct related declarations -->
<!--xsd:complexType name="PixelMapDataProduct" abstract="true">
<xsd:complexContent>
<xsd:restriction base="DataProduct">
<xsd:sequence>
<xsd:element minOccurs="0" name="name" type="xsd:string"/>
<xsd:element minOccurs="0" name="topology" type="xsd:string"/>
<xsd:element minOccurs="0" name="status" type="xsd:string"/>
<xsd:element minOccurs="0" name="storageCluster" type="StorageCluster"/>
<xsd:element minOccurs="0" name="ownerMom2Object" type="mom2:Mom2ObjectRef"/>
<xsd:choice>
<xsd:element minOccurs="0" name="uri" type="xsd:string"/>
<xsd:element minOccurs="0" name="locations" type="mom2:DataProductLocations"/>
</xsd:choice>
<xsd:element minOccurs="0" name="fileFormat" type="xsd:string"/>
<xsd:element minOccurs="0" name="type" type="xsd:string"/>
<xsd:element minOccurs="0" name="timeStamp" type="xsd:dateTime"/>
<xsd:element minOccurs="0" default="false" name="released" type="xsd:boolean"/>
<xsd:element minOccurs="0" default="false" name="exported" type="xsd:boolean"/>
<xsd:choice minOccurs="0">
<xsd:element ref="specificPixelMapDataProductAttributes"/>
</xsd:choice>
<xsd:element minOccurs="0" name="storageTicket" type="xsd:string"/>
<xsd:element minOccurs="0" name="fileSize" type="xsd:unsignedLong"/>
<xsd:element minOccurs="0" name="checksums" type="ChecksumTypes"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:integer" default="0"/>
<xsd:attribute name="mom2DPId" type="xsd:nonNegativeInteger"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="specificPixelMapDataProductAttributes" substitutionGroup="mom2:specificAttributes" type="SpecificPixelMapDataProductAttributes"/>
<xsd:complexType name="SpecificPixelMapDataProductAttributes">
<xsd:complexContent>
<xsd:extension base="mom2:SpecificAttributes">
<xsd:sequence>
<xsd:element minOccurs="0" name="numberOfAxes" type="xsd:positiveInteger"/>
<xsd:element minOccurs="0" maxOccurs="unbounded" name="axis" type="Axis"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Axis">
<xsd:sequence>
<xsd:element minOccurs="0" name="number" type="xsd:nonNegativeInteger"/>
<xsd:element minOccurs="0" name="name" type="xsd:string"/>
<xsd:element minOccurs="0" name="unit" type="xsd:string"/>
<xsd:element minOccurs="0" name="length" type="xsd:nonNegativeInteger"/>
</xsd:sequence>
</xsd:complexType--><!-- Sky Image DataProduct related declarations -->
<!--xsd:element name="skyImageDataProduct" substitutionGroup="mom2:anyDataProduct" type="SkyImageDataProduct"/>
<xsd:complexType name="SkyImageDataProduct">
<xsd:complexContent>
<xsd:restriction base="DataProduct">
<xsd:sequence>
<xsd:element minOccurs="0" name="name" type="xsd:string"/>
<xsd:element minOccurs="0" name="topology" type="xsd:string"/>
<xsd:element minOccurs="0" name="status" type="xsd:string"/>
<xsd:element minOccurs="0" name="storageCluster" type="StorageCluster"/>
<xsd:element minOccurs="0" name="ownerMom2Object" type="mom2:Mom2ObjectRef"/>
<xsd:choice>
<xsd:element minOccurs="0" name="uri" type="xsd:string"/>
<xsd:element minOccurs="0" name="locations" type="mom2:DataProductLocations"/>
</xsd:choice>
<xsd:element minOccurs="0" name="fileFormat" type="xsd:string"/>
<xsd:element minOccurs="0" name="type" type="xsd:string"/>
<xsd:element minOccurs="0" name="timeStamp" type="xsd:dateTime"/>
<xsd:element minOccurs="0" default="false" name="released" type="xsd:boolean"/>
<xsd:element minOccurs="0" default="false" name="exported" type="xsd:boolean"/>
<xsd:choice minOccurs="0">
<xsd:element ref="specificSkyImageDataProductAttributes"/>
</xsd:choice>
<xsd:element minOccurs="0" name="storageTicket" type="xsd:string"/>
<xsd:element minOccurs="0" name="fileSize" type="xsd:unsignedLong"/>
<xsd:element minOccurs="0" name="checksums" type="ChecksumTypes"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:integer" default="0"/>
<xsd:attribute name="mom2DPId" type="xsd:nonNegativeInteger"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="specificSkyImageDataProductAttributes" substitutionGroup="mom2:specificAttributes" type="SpecificSkyImageDataProductAttributes"/>
<xsd:complexType name="SpecificSkyImageDataProductAttributes">
<xsd:complexContent>
<xsd:extension base="SpecificPixelMapDataProductAttributes">
<xsd:sequence>
<xsd:element minOccurs="0" name="pointing" type="Pointing"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Pointing">
<xsd:sequence>
<xsd:element minOccurs="0" name="rightAscension" type="xsd:double"/>
<xsd:element minOccurs="0" name="declination" type="xsd:double"/>
<xsd:element minOccurs="0" name="equinox" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType--><!-- Pulsar Pipeline DataProduct related declarations -->
<!--xsd:element name="pulsarDataProduct" substitutionGroup="mom2:anyDataProduct" type="PulsarDataProduct"/>
<xsd:complexType name="PulsarDataProduct">
<xsd:complexContent>
<xsd:extension base="DataProduct">
<xsd:sequence>
<xsd:element minOccurs="0" name="name" type="xsd:string"/>
<xsd:element minOccurs="0" name="topology" type="xsd:string"/>
<xsd:element minOccurs="0" name="status" type="xsd:string"/>
<xsd:element minOccurs="0" name="storageCluster" type="StorageCluster"/>
<xsd:element minOccurs="0" name="ownerMom2Object" type="mom2:Mom2ObjectRef"/>
<xsd:choice>
<xsd:element minOccurs="0" name="uri" type="xsd:string"/>
<xsd:element minOccurs="0" name="locations" type="mom2:DataProductLocations"/>
</xsd:choice>
<xsd:element minOccurs="0" name="fileFormat" type="xsd:string"/>
<xsd:element minOccurs="0" name="type" type="xsd:string"/>
<xsd:element minOccurs="0" name="timeStamp" type="xsd:dateTime"/>
<xsd:element minOccurs="0" default="false" name="released" type="xsd:boolean"/>
<xsd:element minOccurs="0" default="false" name="exported" type="xsd:boolean"/>
<xsd:choice minOccurs="0">
<xsd:element ref="specificBFDataProductAttributes"/>
</xsd:choice>
<xsd:element minOccurs="0" name="storageTicket" type="xsd:string"/>
<xsd:element minOccurs="0" name="fileSize" type="xsd:unsignedLong"/>
<xsd:element minOccurs="0" name="checksums" type="ChecksumTypes"/>
</xsd:sequence-->
<!-- xsd:attribute name="id" type="xsd:integer" default="0"/ -->
<!-- xsd:attribute name="mom2DPId" type="xsd:nonNegativeInteger"/ -->
<!-- xsd:attribute name="topology" type="xsd:string"/ -->
<!--/xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="specificPulsarDataProductAttributes" substitutionGroup="mom2:specificAttributes" type="SpecificPulsarDataProductAttributes"/>
<xsd:complexType name="SpecificPulsarDataProductAttributes">
<xsd:complexContent>
<xsd:extension base="mom2:SpecificAttributes">
<xsd:sequence/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType--><!-- Generic DataProduct related declarations -->
<!--xsd:element name="genericDataProduct" substitutionGroup="mom2:anyDataProduct" type="GenericDataProduct"/>
<xsd:complexType name="GenericDataProduct">
<xsd:complexContent>
<xsd:restriction base="DataProduct">
<xsd:sequence>
<xsd:element minOccurs="0" name="name" type="xsd:string"/>
<xsd:element minOccurs="0" name="topology" type="xsd:string"/>
<xsd:element minOccurs="0" name="status" type="xsd:string"/>
<xsd:element minOccurs="0" name="storageCluster" type="StorageCluster"/>
<xsd:element minOccurs="0" name="ownerMom2Object" type="mom2:Mom2ObjectRef"/>
<xsd:choice>
<xsd:element minOccurs="0" name="uri" type="xsd:string"/>
<xsd:element minOccurs="0" name="locations" type="mom2:DataProductLocations"/>
</xsd:choice>
<xsd:element minOccurs="0" name="fileFormat" type="xsd:string"/>
<xsd:element minOccurs="0" name="type" type="xsd:string"/>
<xsd:element minOccurs="0" name="timeStamp" type="xsd:dateTime"/>
<xsd:element minOccurs="0" default="false" name="released" type="xsd:boolean"/>
<xsd:element minOccurs="0" default="false" name="exported" type="xsd:boolean"/>
<xsd:element minOccurs="0" name="storageTicket" type="xsd:string"/>
<xsd:element minOccurs="0" name="fileSize" type="xsd:unsignedLong"/>
<xsd:element minOccurs="0" name="checksums" type="ChecksumTypes"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:integer" default="0"/>
<xsd:attribute name="mom2DPId" type="xsd:nonNegativeInteger"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType-->
</xsd:schema>
This diff is collapsed.
<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema targetNamespace="http://www.astron.nl/LofarTrigger" version="0.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.astron.nl/LofarTrigger" xmlns:base="http://www.astron.nl/LofarBase">
<xsd:import schemaLocation="LofarBase.xsd" namespace="http://www.astron.nl/LofarBase"/>
<xsd:annotation>
<xsd:documentation>Definitions for LOFAR project and user submission</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>============================LOFAR Project entities============================
Project and user related objects.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType name="Project">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="description" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="project" type="Project"/>
</xsd:schema>
<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema targetNamespace="http://www.astron.nl/LofarSpecification" version="0.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.astron.nl/LofarSpecification" xmlns:base="http://www.astron.nl/LofarBase">
<xsd:import schemaLocation="LofarBase.xsd" namespace="http://www.astron.nl/LofarBase"/>
<xsd:annotation>
<xsd:documentation>Definitions for LOFAR specification submission
This is a document that uses the LofarBase and extends that with objects that are specific to the needs of being able to
specify activities, their relations and entities. This is partially compatible with the W3C provenance model in its naming.
Compared to the old MoM XSD, this does not contain a project object. It is assumed the project exists, a specification should
not be able to edit it or add a new one. Thus only a reference to a project is in the specification.
</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>============================LOFAR Specification containers============================
Currently we only support MoM folders as a container.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType name="Container">
<xsd:sequence>
<xsd:element name="temporaryIdentifier" type="base:Identifier"/>
<xsd:choice><!--Or should we be specific to the subtypes here?-->
<xsd:element name="folder" type="base:Folder"/>
<!-- Might be a SchedulingBlock and other types of containers in the future -->
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
<xsd:annotation>
<xsd:documentation>============================LOFAR Specification activities============================
Activities that the system can do and their related types and objects.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType name="DurationSpecification">
<xsd:sequence>
<xsd:element name="duration" type="xsd:duration"/><!-- FIXME we need to think about this some more, it might need to be a choice-->
<xsd:element name="minimumDuration" minOccurs="0" type="xsd:duration"/>
<xsd:element name="maximumDuration" minOccurs="0" type="xsd:duration"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="TimeFrameType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="UT"/>
<xsd:enumeration value="LST"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="ActivityTimeWindowSpecification"> <!-- An activity will also have an actual (resolved/allocated) time window, this is specific to specifying it -->
<xsd:sequence>
<xsd:element name="timeFrame" default="UT">
</xsd:element>
<xsd:choice><!--How much flexibility do we want to support? -->
<xsd:sequence><!-- Specifies a window larger than duration -->
<xsd:element name="minStartTime" type="xsd:dateTime"/>
<xsd:element name="maxEndTime" type="xsd:dateTime"/>
<xsd:element name="duration" type="DurationSpecification"/><!-- Should be less than End - Start, othterwise use one of the other options -->
</xsd:sequence>
<!-- xsd:sequence><This one seems redundant with startTime/duration?>
<xsd:element name="startTime" type="xsd:dateTime"/>
<xsd:element name="endTime" type="xsd:dateTime"/>
</xsd:sequence -->
<xsd:sequence><!-- EndTime is implicit as startTime+duration -->
<xsd:element name="startTime" type="xsd:dateTime"/>
<xsd:element name="duration" type="DurationSpecification"/>
</xsd:sequence>
<xsd:sequence> <!-- Start time is dependent on other activities/events -->
<xsd:element name="duration" type="DurationSpecification"/>
</xsd:sequence>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="LofarStationSelectionType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Single"/>
<xsd:enumeration value="Core"/>
<xsd:enumeration value="Dutch"/>
<xsd:enumeration value="All"/>
<xsd:enumeration value="Custom"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="StationSelection">
<xsd:sequence>
<xsd:element name="stationSet" type="LofarStationSelectionType"/>
<xsd:choice>
<xsd:sequence>
<xsd:element name="minimumConstraint" type="xsd:integer"/>
<xsd:element name="maximumConstraint" minOccurs="0" type="xsd:integer"/>
</xsd:sequence>
<xsd:element name="stations" type="base:Stations"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="StationSelectionSpecification">
<xsd:sequence>
<xsd:element name="stationSelection" maxOccurs="4" type="StationSelection"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Observation">
<xsd:complexContent>
<xsd:extension base="base:Observation">
<xsd:sequence>
<xsd:element name="stationSelectionSpecification" type="StationSelectionSpecification"/>
<xsd:element name="timeWindowSpecification" type="ActivityTimeWindowSpecification"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Activity">
<xsd:sequence>
<xsd:element name="temporaryIdentifier" type="base:Identifier"/>
<xsd:choice><!--Or should we be specific to the subtypes here?-->
<xsd:element name="observation" type="Observation"/>
<xsd:element name="measurement" type="base:Measurement"/><!-- maybe explicit part of Observation but makes it hard to make Relations?-->
<!-- we want to be specific about which types can generate wich types of dataproducts/entities -->
<xsd:element name="pipeline" type="base:Pipeline"/>
<xsd:element name="ingest" type="base:Ingest"/>
<xsd:element name="cleanup" type="base:Cleanup"/>
</xsd:choice>
<xsd:element name="status" minOccurs="0" type="xsd:string"/><!-- default would be opened, might need to be come an enum -->
</xsd:sequence>
</xsd:complexType>
<xsd:annotation>
<xsd:documentation>============================LOFAR Specification entities============================
TBD
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType name="DataProductType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="UVDataProduct"/>
<xsd:enumeration value="BFDataProduct"/>
<xsd:enumeration value="TBBDataProduct"/>
<xsd:enumeration value="PixelMapDataProduct"/>
<xsd:enumeration value="SkyImageDataProduct"/>
<xsd:enumeration value="PulsarDataProduct"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="Entity">
<xsd:sequence>
<xsd:element name="temporaryIdentifier" type="base:Identifier"/>
<xsd:element name="dataproductType" type="DataProductType"/>
<xsd:element name="storageCluster" type="base:StorageCluster"/>
</xsd:sequence>
</xsd:complexType>
<xsd:annotation>
<xsd:documentation>============================LOFAR Specification relations============================
These relations allow more flexibility than a purely nested structure. They can show the different ways that objects are related
to allow for different types of visualisation.
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType name="ChildRelationType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="folder-folder"/> <!-- should be made more specific -->
<xsd:enumeration value="folder-activity"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="ChildRelation">
<xsd:complexContent>
<xsd:extension base="Relation">
<xsd:sequence>
<xsd:element name="parent" type="base:Identifier"/>
<xsd:element name="child" type="base:Identifier"/>
<xsd:element name="type" type="ChildRelationType"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:simpleType name="SibblingRelationType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="group"/>
<xsd:enumeration value="calibrator"/><!-- Not correct FIXME-->
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="SibblingRelation"><!-- We need to make this smarter for other sibbling relations-->
<xsd:complexContent>
<xsd:extension base="Relation">
<xsd:sequence>
<xsd:element name="sibbling" minOccurs="1" maxOccurs="unbounded" type="base:Identifier"/>
<xsd:element name="type" type="SibblingRelationType"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:simpleType name="ProducerRelationType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="output"/><!-- ProducedBy, needs better name?-->
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="ProducerRelation">
<xsd:complexContent>
<xsd:extension base="Relation">
<xsd:sequence>
<xsd:element name="activity" type="base:Identifier"/>
<xsd:element name="entity" type="base:Identifier"/>
<xsd:element name="type" type="ProducerRelationType"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:simpleType name="UserRelationType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="input"/><!-- UsedBy, needs better name?-->
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="UserRelation">
<xsd:complexContent>
<xsd:extension base="Relation">
<xsd:sequence>
<xsd:element name="entity" type="base:Identifier"/>
<xsd:element name="activity" type="base:Identifier"/>
<xsd:element name="type" type="UserRelationType"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Relation" abstract="true"/>
<xsd:annotation>
<xsd:documentation>============================LOFAR Specification root element============================
This contains the other objects in the specification and their relations. It also contains properties that pertain to the whole
specification and not a specific object. It needs to have at least one container/folder to put into the project in MoM that will then
contain other objects. Activities and entities should and can't be related to the project directly.
</xsd:documentation>
</xsd:annotation>
<xsd:simpleType name="QualityOfServiceType">
<xsd:restriction base="xsd:string"><!-- These names are not very clear to me without explanation -->
<xsd:enumeration value="THROUGHPUT"/> <!-- The current and default behavior -->
<xsd:enumeration value="LATENCY"/> <!-- This job needs to be optimized for fast data delivery -->
<xsd:enumeration value="IDLE"/> <!-- Jobs that should only be ran if the telescope is idle (test jobs for example). -->
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="Specification">
<xsd:sequence>
<xsd:element name="version" type="xsd:string"/>
<xsd:element name="projectReference" type="base:ProjectReference"/>
<xsd:element name="userName" type="xsd:string"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0"/><!--Might not be needed?-->
<xsd:element name="generatorVersion" type="xsd:string"/>
<xsd:element name="priority" type="xsd:nonNegativeInteger"/>
<xsd:element name="qualityOfService" type="QualityOfServiceType" default="THROUGHPUT"/>
<xsd:element name="container" type="Container" maxOccurs="unbounded"/> <!-- do we want it all in one container? without maxOccurs="unbounded"-->
<xsd:element name="activity" type="Activity" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="entity" type="Entity" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="relation" type="Relation" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="specification" type="Specification"/>
</xsd:schema>
<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema targetNamespace="http://www.astron.nl/LofarTrigger" version="0.1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.astron.nl/LofarTrigger" xmlns:spec="http://www.astron.nl/LofarSpecification" xmlns:base="http://www.astron.nl/LofarBase">
<xsd:import schemaLocation="LofarSpecification.xsd" namespace="http://www.astron.nl/LofarSpecification"/>
<xsd:import schemaLocation="LofarBase.xsd" namespace="http://www.astron.nl/LofarBase"/>
<xsd:annotation>
<xsd:documentation>Definitions for LOFAR trigger submission</xsd:documentation>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>============================LOFAR Trigger root element============================
Class for submission of a specification based on a trigger, with the relevant trigger information.
</xsd:documentation>
</xsd:annotation>
<xsd:complexType name="Trigger">
<xsd:sequence>
<xsd:element name="version" type="xsd:string"/>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="description" type="xsd:string"/>
<xsd:element name="projectReference" type="base:ProjectReference"/>
<xsd:element name="submitter" type="base:ContactInformation"/><!-- Do we want to enforce this as the authenticated user? -->
<xsd:element name="userName" type="xsd:string"/><!-- The same as the authenticated user? -->
<xsd:element name="comment" type="xsd:string" minOccurs="0"/><!--Might not be needed?-->
<xsd:element name="qualityOfService" type="spec:QualityOfServiceType"/><!--Might not be needed?-->
<xsd:element name="event" type="base:Event" maxOccurs="unbounded"/><!--Maybe there should be EventList?-->
<xsd:element name="specification" type="spec:Specification"/>
<xsd:element name="generatorVersion" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="trigger" type="Trigger"/>
</xsd:schema>
This diff is collapsed.
<xsd:schema targetNamespace="http://www.astron.nl/PersistentObjects" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.astron.nl/PersistentObjects">
<xsd:annotation>
<xsd:documentation>Definition of base types for astron web application persistent objects</xsd:documentation>
</xsd:annotation>
<xsd:complexType name="PersistentObjectType" abstract="true">
<xsd:annotation>
<xsd:documentation>
Base persistent object type
</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="id" type="xsd:integer" default="0"/>
</xsd:complexType>
<xsd:complexType name="IndexedListType" abstract="true">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="indexedListItem"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="IndexedListItemType" abstract="true">
<xsd:attribute name="index" type="xsd:nonNegativeInteger"/>
</xsd:complexType>
<xsd:complexType name="PersistentListType" abstract="true">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
A choice group with min/max occurences is used since
the intention is that the referenced (abstract)
element &quot;"persistentListElement&quot;" is
replaced by a member of it's substitution group. (A
sequence with an unbouded number of these elemets
will not work as the substitution group is treated
as a choice group.)
</xsd:documentation>
</xsd:annotation>
<xsd:element ref="persistentObject"/>
</xsd:choice>
</xsd:complexType>
<xsd:element name="indexedListItem" type="IndexedListItemType" abstract="true"/>
<xsd:element name="persistentObject" type="PersistentObjectType" abstract="true"/>
</xsd:schema>
<xsd:schema targetNamespace="http://www.astron.nl/useradmin" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:persistent="http://www.astron.nl/PersistentObjects">
<xsd:import namespace="http://www.astron.nl/PersistentObjects" schemaLocation="PersistentObjects.xsd"/>
<xsd:annotation>
<xsd:documentation>
XML Schema for the WSRT user administration datamodel
</xsd:documentation>
</xsd:annotation>
<xsd:complexType name="UserRefType">
<xsd:complexContent>
<xsd:restriction base="persistent:PersistentObjectType">
<xsd:attribute name="id" type="xsd:integer" use="required"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
""" Config file for specification services. """
# Messaging
CONNECTION_STRING = '127.0.0.1'
MOMQUERY_BUSNAME = "momquerybus"
MOMQUERY_SERVICENAME = "momqueryservice"
VALIDATION_BUSNAME = "validationbus"
VALIDATION_SERVICENAME = "validationservice"
SPECIFICATION_BUSNAME = "specificationbus"
SPECIFICATION_SERVICENAME = "specificationservice"
SPECIFICATIONTRANSLATION_BUSNAME = "specificationtranslationbus"
SPECIFICATIONTRANSLATION_SERVICENAME = "specificationtranslationservice"
# XSD paths (for validation service)
TRIGGER_XSD = "LofarTrigger.xsd"
LOFARSPEC_XSD = "LofarSpecification.xsd"
MOMSPEC_XSD = "LofarMoM2.xsd"
# These specification elements are to be recoded for MoM as json
MOM_EXTRASPECS = ["triggerid",
"priority",
"qualityOfService",
"activity.observation.timeWindowSpecification",
"activity.observation.stationSelectionSpecification",
"comment"]
\ No newline at end of file
#!/usr/bin/env python
# specification_service.py
#
# Copyright (C) 2015
# ASTRON (Netherlands Institute for Radio Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
#
# This file is part of the LOFAR software suite.
# The LOFAR software suite is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# The LOFAR software suite is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>.
XMLPATH_TRIGGER="../test/trigger.xml"
from lxml import etree
from StringIO import StringIO
from lofar.specificationservices.validation_service_rpc import ValidationRPC
from lofar.specificationservices.translation_service_rpc import TranslationRPC
from lofar.mom.momqueryservice.momqueryrpc import MoMQueryRPC
from lofar.messaging import Service
from lofar.messaging.Service import MessageHandlerInterface
from lofar.common.util import waitForInterrupt
from config import MOMQUERY_BUSNAME, MOMQUERY_SERVICENAME, VALIDATION_BUSNAME, VALIDATION_SERVICENAME, SPECIFICATION_SERVICENAME, SPECIFICATION_BUSNAME, SPECIFICATIONTRANSLATION_SERVICENAME, SPECIFICATIONTRANSLATION_BUSNAME
momqueryrpc = MoMQueryRPC(MOMQUERY_BUSNAME, MOMQUERY_SERVICENAME)
validationrpc = ValidationRPC(VALIDATION_BUSNAME, VALIDATION_SERVICENAME)
specificationtranslationrpc = TranslationRPC(SPECIFICATIONTRANSLATION_BUSNAME, SPECIFICATIONTRANSLATION_SERVICENAME)
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)
def _check_specification(lofar_xml):
folder = "innermost" # where to find this in xml???
#if momqueryrpc.folderExists(folder):
# raise Exception("Folder already exists!")
processes = [] # where to obtain these?
for process in processes:
pass
# todo: i. Check whether the specifications are in folder(s), return ERROR if not.
# todo: ii. Whether the specifications are observations or pipelines
# todo: iii. Whether the specifications go to opened or approved
# todo: iv. Queries the MoMQueryService whether user can open or approve specifications in the selected project(s), return ERROR if not.
return True
def _authenticate(user, project, jobtype, state):
# todo: momqueryrpc.authState(user,project,jobtype,state)
return True
def _validate_lofarspec(lofar_xml):
return validationrpc.validate_specification(lofar_xml)
#return validationhandler.validate_specification(lofar_xml)
def _validate_momspec(mom_xml):
return validationrpc.validate_mom_specification(mom_xml)
#return validationhandler.validate_mom_specification(mom_xml)
def _add_spec_to_mom(mom_xml):
# todo: momrpc.importXML(mom_xml) -- which service is this?
return True
def _lofarxml_to_momxml(lofarxml):
momxml = specificationtranslationrpc.specification_to_momspecification(lofarxml)
return momxml
class SpecificationHandler(MessageHandlerInterface):
def __init__(self, **kwargs):
super(SpecificationHandler, self).__init__(**kwargs)
self.service2MethodMap = {
'add_specification': self.add_specification,
}
def add_specification(self, user, lofar_xml):
logger.info("got specification from user " + str(user))
logger.debug("LOFAR-XML: " + lofar_xml)
id = None
if _authenticate(None, None, None, None):
logger.info("authenticated!")
if _validate_lofarspec(lofar_xml):
logger.info("lofar xml validates!")
if _check_specification(lofar_xml):
logger.info("lofar xml check successful!")
mom_xml = _lofarxml_to_momxml(lofar_xml)
if _validate_momspec(mom_xml):
logger.info("mom xml validates!")
_add_spec_to_mom(mom_xml)
else:
logger.error("Could not create valid LOFAR XML: "+lofar_xml)
return id
def get_specification(self, id):
logger.info("getting spec of id "+str(id))
# todo: return real trigger info as xml
# for testing:
with open(XMLPATH_TRIGGER) as xml:
return xml.read()
def create_service(servicename=SPECIFICATION_SERVICENAME, busname=SPECIFICATION_BUSNAME):
return Service(servicename,
SpecificationHandler,
busname=busname,
use_service_methods=True,
)
def main():
with create_service():
waitForInterrupt()
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