├── RMBTUtil ├── .gitignore ├── build.gradle └── src │ ├── test │ └── resources │ │ └── at │ │ └── rtr │ │ └── rmbt │ │ └── util │ │ └── model │ │ └── option │ │ ├── test4.json │ │ ├── test5.json │ │ ├── test1.json │ │ ├── test2.json │ │ └── test3.json │ └── main │ └── java │ └── at │ └── rtr │ └── rmbt │ └── util │ ├── model │ ├── shared │ │ ├── exception │ │ │ ├── ErrorStatus.java │ │ │ └── LoopModeRejectedException.java │ │ └── MapOptions.java │ └── option │ │ ├── OptionFunctionCallback.java │ │ └── OptionFunctionUtil.java │ ├── tools │ ├── MemInfo.java │ ├── NetStat.java │ ├── ToolUtils.java │ ├── UdpConnectionInformation.java │ ├── TracerouteService.java │ └── TcpConnectionInformation.java │ ├── NumberUtil.java │ ├── capability │ ├── ClassificationCapability.java │ └── QualityOfServiceCapability.java │ ├── Randomizer.java │ └── net │ └── sip │ └── SipRequestMessage.java ├── RMBTMapServer ├── .gitignore ├── src │ ├── .gitignore │ └── at │ │ └── rtr │ │ └── rmbt │ │ ├── res │ │ └── Configuration.properties │ │ └── mapServer │ │ ├── PngOutputRepresentation.java │ │ ├── parameters │ │ ├── ShapeTileParameters.java │ │ └── HeatmapTileParameters.java │ │ ├── DbConnection.java │ │ ├── ByteArrayOutputRepresentation.java │ │ ├── VersionResource.java │ │ └── MapServer.java ├── WebContent │ └── META-INF │ │ └── MANIFEST.MF └── build.gradle ├── RMBTSharedCode ├── .gitignore ├── src │ ├── .gitignore │ └── at │ │ └── rtr │ │ └── rmbt │ │ └── shared │ │ ├── qos │ │ ├── MkitDashResult.java │ │ ├── MkitWebConnectivityResult.java │ │ ├── ResultOptions.java │ │ ├── annotations │ │ │ └── NonComparableField.java │ │ ├── testscript │ │ │ └── ScriptException.java │ │ └── UdpPayload.java │ │ ├── smoothing │ │ ├── Smoothable.java │ │ └── SmoothingFunctionCalculation.java │ │ ├── hstoreparser │ │ └── annotation │ │ │ ├── HstoreKey.java │ │ │ └── HstoreCollection.java │ │ ├── cache │ │ └── CacheContextListener.java │ │ └── ResourceManager.java └── build.gradle ├── RMBTClient ├── .gitignore ├── src │ ├── .gitignore │ ├── main │ │ └── java │ │ │ └── at │ │ │ └── rtr │ │ │ └── rmbt │ │ │ └── client │ │ │ ├── qos │ │ │ ├── OnResultReadyListener.java │ │ │ ├── QoSMeasurementClientControlAdapter.java │ │ │ ├── QoSMeasurementClientControlListener.java │ │ │ └── QoSMeasurementClientProgressAdapter.java │ │ │ ├── v2 │ │ │ └── task │ │ │ │ ├── QoSTestErrorEnum.java │ │ │ │ ├── QoSTestEnum.java │ │ │ │ ├── ControlConnectionResponseCallback.java │ │ │ │ ├── result │ │ │ │ ├── QoSTestResultEnum.java │ │ │ │ ├── QoSResultCollector.java │ │ │ │ └── QoSServerResultTestDesc.java │ │ │ │ ├── service │ │ │ │ ├── TrafficService.java │ │ │ │ └── TestProgressListener.java │ │ │ │ └── QoSTask.java │ │ │ ├── helper │ │ │ ├── NdtStatus.java │ │ │ ├── RMBTOutputCallback.java │ │ │ ├── TestStatus.java │ │ │ └── IntermediateResult.java │ │ │ ├── Ping.java │ │ │ ├── ThreadTestResult.java │ │ │ ├── Results.java │ │ │ ├── TestResult.java │ │ │ ├── OutputStreamCounter.java │ │ │ └── SpeedItem.java │ └── test │ │ └── java │ │ └── at │ │ └── rtr │ │ └── rmbt │ │ └── client │ │ ├── QualityOfExperienceTest.java │ │ └── RMBTClientTestStub.java └── build.gradle ├── RMBTControlServer ├── .gitignore ├── src │ ├── .gitignore │ ├── cache.ccf │ └── at │ │ └── rtr │ │ └── rmbt │ │ ├── qos │ │ ├── ResultOptions.java │ │ ├── annotations │ │ │ └── NonComparableField.java │ │ └── testscript │ │ │ └── ScriptException.java │ │ ├── db │ │ ├── fields │ │ │ ├── IPField.java │ │ │ ├── JsonField.java │ │ │ └── IllegalFieldTypeException.java │ │ ├── dao │ │ │ ├── PrimaryKeyDao.java │ │ │ ├── CrudPrimaryKeyDao.java │ │ │ └── DaoUtil.java │ │ ├── DbConnection.java │ │ └── QoSTestDesc.java │ │ ├── res │ │ └── Configuration.properties │ │ └── controlServer │ │ ├── TimerFilter.java │ │ ├── server │ │ ├── ProxyEchoResult.java │ │ └── ProxyEchoRequest.java │ │ └── VersionResource.java └── WebContent │ └── META-INF │ └── MANIFEST.MF ├── RMBTStatisticServer ├── .gitignore ├── src │ ├── .gitignore │ └── at │ │ └── rtr │ │ └── rmbt │ │ ├── statisticServer │ │ ├── export │ │ │ ├── forumbanner_de.png │ │ │ ├── forumbanner_en.png │ │ │ ├── forumsmall_de.png │ │ │ ├── forumsmall_en.png │ │ │ └── netztest-thumbnail.png │ │ ├── opendata │ │ │ └── dto │ │ │ │ ├── CoveragesDTO.java │ │ │ │ ├── PingGraphItemDTO.java │ │ │ │ ├── SpeedGraphItemDTO.java │ │ │ │ └── OpenTestGraphDTO.java │ │ └── VersionResource.java │ │ ├── res │ │ └── Configuration.properties │ │ └── db │ │ └── DbConnection.java └── WebContent │ └── META-INF │ └── MANIFEST.MF ├── RMBTQoSServer ├── .gitignore ├── src │ ├── main │ │ └── java │ │ │ └── at │ │ │ └── rtr │ │ │ └── rmbt │ │ │ └── qos │ │ │ └── testserver │ │ │ ├── entity │ │ │ ├── Observable.java │ │ │ ├── QoSProtocolException.java │ │ │ ├── QoSTestServerException.java │ │ │ ├── AbstractTtlObject.java │ │ │ ├── ClientToken.java │ │ │ └── TestCandidate.java │ │ │ ├── tcp │ │ │ └── competences │ │ │ │ ├── Action.java │ │ │ │ ├── RepeatAction.java │ │ │ │ ├── Competence.java │ │ │ │ ├── BasicCompetence.java │ │ │ │ ├── ResponseAction.java │ │ │ │ └── SleepAction.java │ │ │ ├── TestServerException.java │ │ │ ├── udp │ │ │ ├── UdpTestCompleteCallback.java │ │ │ └── UdpPacketReceivedCallback.java │ │ │ ├── service │ │ │ └── JobCallback.java │ │ │ └── plugin │ │ │ └── rest │ │ │ ├── RestletApplication.java │ │ │ └── StatusResource.java │ └── test │ │ └── java │ │ └── at │ │ └── rtr │ │ └── rmbt │ │ └── qos │ │ └── testserver │ │ ├── rules │ │ ├── Repeat.java │ │ └── RepeatRule.java │ │ └── mock │ │ ├── SocketWithCountDownLatchMockup.java │ │ ├── RecordingFilterOutputStreamMock.java │ │ ├── ServerSocketMockup.java │ │ └── DataInputStreamMockup.java ├── build.gradle └── qos_server.sh ├── install └── postgresql │ ├── 3rd_party_open_data │ ├── statistik_austria │ │ ├── statistik_austria_gem.sql │ │ └── get_dsr.sh │ ├── coverage │ │ ├── init_cov_bb_fixed.sql │ │ ├── init_cov_visible_name.sql │ │ ├── init_cov_mno.sql │ │ ├── view_cov_mno_fn.sql │ │ └── get_cov_bb_fixed.sh │ └── admin_0_countries │ │ └── get_admin_0_countries.sh │ ├── create_rmbt_sql.sh │ ├── functions │ ├── rmbt_get_country_iso_a2.sql │ ├── rmbt_get_distance_iso_a2.sql │ └── rmbt_purge_obsolete.sql │ ├── trigger │ └── functions │ │ └── trigger_geo_location.sql │ ├── create_rmbt_init_sql.sh │ └── rmbt_globals.sql ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── private.sample ├── keystore.properties └── appSecrets.properties ├── doc └── historical │ └── RTR Multithreaded Broadband Test (RMBT)_ Specification.pdf ├── gradle.properties ├── settings.gradle ├── .gitignore ├── common.gradle ├── .github └── workflows │ └── build.yml └── NOTICE /RMBTUtil/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | -------------------------------------------------------------------------------- /RMBTMapServer/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /RMBTSharedCode/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | -------------------------------------------------------------------------------- /RMBTClient/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /doc 3 | -------------------------------------------------------------------------------- /RMBTControlServer/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /RMBTMapServer/src/.gitignore: -------------------------------------------------------------------------------- 1 | /rebel.xml 2 | -------------------------------------------------------------------------------- /RMBTStatisticServer/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /RMBTControlServer/src/.gitignore: -------------------------------------------------------------------------------- 1 | /rebel.xml 2 | -------------------------------------------------------------------------------- /RMBTClient/src/.gitignore: -------------------------------------------------------------------------------- 1 | /revision.properties 2 | -------------------------------------------------------------------------------- /RMBTStatisticServer/src/.gitignore: -------------------------------------------------------------------------------- 1 | /rebel.xml 2 | -------------------------------------------------------------------------------- /RMBTSharedCode/src/.gitignore: -------------------------------------------------------------------------------- 1 | /revision.properties 2 | -------------------------------------------------------------------------------- /RMBTQoSServer/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /doc 3 | /guard.properties 4 | -------------------------------------------------------------------------------- /install/postgresql/3rd_party_open_data/statistik_austria/statistik_austria_gem.sql: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /RMBTControlServer/WebContent/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /RMBTMapServer/WebContent/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /RMBTStatisticServer/WebContent/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtr-nettest/open-rmbt/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /private.sample/keystore.properties: -------------------------------------------------------------------------------- 1 | storeFile=YOUR_FILE 2 | storePassword=YOUR_PASSWORD 3 | keyAlias=YOUR_ALIAS 4 | keyPassword=YOUR_PASSWORD 5 | -------------------------------------------------------------------------------- /doc/historical/RTR Multithreaded Broadband Test (RMBT)_ Specification.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtr-nettest/open-rmbt/HEAD/doc/historical/RTR Multithreaded Broadband Test (RMBT)_ Specification.pdf -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project wide Gradle settings. 2 | org.gradle.jvmargs=-Xmx2048m 3 | 4 | # allow single subprojects to be build without having to evaluate all projects 5 | #org.gradle.configureondemand=true -------------------------------------------------------------------------------- /RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/export/forumbanner_de.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtr-nettest/open-rmbt/HEAD/RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/export/forumbanner_de.png -------------------------------------------------------------------------------- /RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/export/forumbanner_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtr-nettest/open-rmbt/HEAD/RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/export/forumbanner_en.png -------------------------------------------------------------------------------- /RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/export/forumsmall_de.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtr-nettest/open-rmbt/HEAD/RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/export/forumsmall_de.png -------------------------------------------------------------------------------- /RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/export/forumsmall_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtr-nettest/open-rmbt/HEAD/RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/export/forumsmall_en.png -------------------------------------------------------------------------------- /RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/export/netztest-thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtr-nettest/open-rmbt/HEAD/RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/export/netztest-thumbnail.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':RMBTUtil' 2 | include ':RMBTSharedCode' 3 | include ':RMBTQoSServer' 4 | include ':RMBTControlServer' 5 | include ':RMBTStatisticServer' 6 | include ':RMBTMapServer' 7 | include ':RMBTClient' 8 | 9 | 10 | -------------------------------------------------------------------------------- /private.sample/appSecrets.properties: -------------------------------------------------------------------------------- 1 | googleMapsApiKey=123456789 2 | loopModeUnlockCode=123456789 3 | loopModeLockCode=123456789 4 | serverSelectionUnlockCode=123456789 5 | serverSelectionLockCode=123456789 6 | developerUnlockCode=123456789 7 | developerLockCode=123456789 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Jan 11 20:24:04 CET 2020 2 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 3 | distributionBase=GRADLE_USER_HOME 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | tmp/ 2 | /.nb-gradle/ 3 | /RMBTSharedCode/build/ 4 | /RMBTUtil/build/ 5 | /RMBTAndroid/build/ 6 | /RMBTClient/build/ 7 | /RMBTQoSServer/build/ 8 | .gradle 9 | .idea 10 | *.iml 11 | local.properties 12 | .DS_Store 13 | /build/ 14 | /apk/ 15 | gradlew 16 | settings.gradle 17 | /private/ 18 | -------------------------------------------------------------------------------- /common.gradle: -------------------------------------------------------------------------------- 1 | // 2 | // This file is to be applied to every subproject. 3 | // 4 | ext { 5 | restletVersion = '2.4.3' 6 | servletVersion = '3.1.0' 7 | jacksonVersion = '2.14.2' 8 | catalinaVersion = '7.0.109' 9 | jsonVersion = '20220924' 10 | javaMelodyVersion = '1.91.0' 11 | dbUtilsVersion = '1.7' 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /RMBTUtil/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | sourceCompatibility = 1.8 3 | 4 | repositories { 5 | mavenCentral() 6 | } 7 | 8 | 9 | dependencies { 10 | testCompile group: 'junit', name: 'junit', version: '4.13.2' 11 | compile group: 'org.json', name: 'json', version: "$jsonVersion" 12 | compile group: 'com.google.code.gson', name: 'gson', version: '2.10.1' 13 | } 14 | -------------------------------------------------------------------------------- /install/postgresql/3rd_party_open_data/coverage/init_cov_bb_fixed.sql: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | CREATE TABLE "cov_bb_fixed" (uid serial, 3 | "raster" varchar (50), 4 | "operator" varchar (200), 5 | "technology" varchar (50), 6 | "dl_max_mbit" real, 7 | "ul_max_mbit" real, 8 | "date" varchar (50) 9 | ); 10 | ALTER TABLE "cov_bb_fixed" ADD PRIMARY KEY (uid); 11 | CREATE INDEX cov_bb_fixed_raster_idx 12 | 13 | ON cov_bb_fixed(raster); 14 | 15 | COMMIT; 16 | -------------------------------------------------------------------------------- /install/postgresql/3rd_party_open_data/coverage/init_cov_visible_name.sql: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | CREATE TABLE cov_visible_name (uid serial, 3 | "operator" varchar (200), 4 | "visible_name" varchar (50) 5 | ); 6 | ALTER TABLE "cov_visible_name" ADD PRIMARY KEY (uid); 7 | CREATE INDEX cov_visible_name_visible_name_idx 8 | ON cov_visible_name(visible_name); 9 | ALTER TABLE cov_visible_name OWNER TO rmbt; 10 | GRANT SELECT ON TABLE cov_visible_name TO rmbt_group_read_only; 11 | COMMIT; 12 | -------------------------------------------------------------------------------- /install/postgresql/3rd_party_open_data/coverage/init_cov_mno.sql: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | CREATE TABLE "cov_mno" (uid serial, 3 | "operator" varchar (50), 4 | "reference" varchar (50), 5 | "license" varchar (50), 6 | "rfc_date" varchar (50), 7 | "raster" varchar (50), 8 | "dl_normal" bigint, 9 | "ul_normal" bigint, 10 | "dl_max" bigint, 11 | "ul_max" bigint); 12 | 13 | ALTER TABLE "cov_mno" ADD PRIMARY KEY (uid); 14 | 15 | CREATE INDEX cov_mno_operator_reference_license_raster_idx 16 | 17 | ON cov_mno(operator,reference,license,raster); 18 | 19 | CREATE INDEX cov_mno_raster_idx 20 | 21 | ON cov_mno(raster); 22 | COMMIT; 23 | -------------------------------------------------------------------------------- /install/postgresql/create_rmbt_sql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # dz 4 | # 5 | # Create rmbt.sql - database schema for RTR-Netztest 6 | # GIT location: /install/postgresql/rmbt.sql 7 | 8 | 9 | # set -x 10 | 11 | export LANG=C 12 | DATE=`date '+%Y-%m-%d_%H-%M-%S'` 13 | OUTPUT=rmbt.sql 14 | 15 | # Check if file exists 16 | test -r $OUTPUT && echo "$OUTPUT exists, aborting." && exit 0 17 | # Create header with timestamp 18 | echo "-- $DATE $OUTPUT" > $OUTPUT 19 | # Dump schema 20 | pg_dump -s rmbt >> $OUTPUT 21 | # Remove ^M (DOS-linebreaks) 22 | sed -ie "s/ //" $OUTPUT 23 | test -r $OUTPUT && echo "$OUTPUT created." && exit 1 24 | -------------------------------------------------------------------------------- /install/postgresql/functions/rmbt_get_country_iso_a2.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION public.rmbt_get_country_iso_a2(point public.geometry(point, 4326)) 2 | RETURNS varchar(5) 3 | LANGUAGE plpgsql 4 | IMMUTABLE STRICT 5 | AS $function$ 6 | DECLARE 7 | -- ISO3266 two digit country code (e.g. 'US') 8 | a2 varchar(5); 9 | BEGIN 10 | 11 | -- Example query: select rmbt_get_country_iso_a2(st_setsrid(ST_GeomFromText('POINT(-71.064544 42.28787)'),4326)); 12 | 13 | 14 | select into a2 ac.iso_a2 from admin_0_countries ac where point && ac.geom and within(point,ac.geom) and char_length(iso_a2) = 2; 15 | return a2; 16 | 17 | END; 18 | $function$ 19 | ; 20 | 21 | -------------------------------------------------------------------------------- /install/postgresql/trigger/functions/trigger_geo_location.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION public.trigger_geo_location() 2 | RETURNS trigger 3 | LANGUAGE plpgsql 4 | AS $function$ 5 | BEGIN 6 | 7 | 8 | IF (TG_OP = 'INSERT' and new.location is not NULL) then 9 | new.geom3857=st_setsrid(new.location,3857); 10 | new.geom4326=st_transform(new.geom3857,4326); 11 | end if; 12 | RETURN NEW; 13 | 14 | END; 15 | $function$ 16 | ; 17 | -- add trigger BEFORE insert 18 | 19 | -- create trigger trigger_geo_location before 20 | -- insert 21 | -- on 22 | -- public.geo_location for each row execute function trigger_geo_location() 23 | 24 | -------------------------------------------------------------------------------- /RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/opendata/dto/CoveragesDTO.java: -------------------------------------------------------------------------------- 1 | package at.rtr.rmbt.statisticServer.opendata.dto; 2 | 3 | import java.util.List; 4 | 5 | public class CoveragesDTO { 6 | private List coverages; 7 | private long durationMs; 8 | 9 | public long getDurationMs() { 10 | return durationMs; 11 | } 12 | 13 | public void setDurationMs(long durationMs) { 14 | this.durationMs = durationMs; 15 | } 16 | 17 | public List getCoverages() { 18 | return coverages; 19 | } 20 | 21 | public void setCoverages(List coverages) { 22 | this.coverages = coverages; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /RMBTUtil/src/test/resources/at/rtr/rmbt/util/model/option/test4.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "title": "test4-option0", 4 | "options": [ 5 | { 6 | "params": { 7 | "test": 1, 8 | "option0": "a1" 9 | } 10 | }, 11 | { 12 | "params": { 13 | "test": 2, 14 | "option0": "a2" 15 | } 16 | } 17 | ] 18 | }, 19 | { 20 | "title": "test4-option1", 21 | "options": [ 22 | { 23 | "params": { 24 | "option1": "a3" 25 | } 26 | }, 27 | { 28 | "params": { 29 | "option1": "a4" 30 | }, 31 | "depends_on": { 32 | "test": 1 33 | } 34 | } 35 | ] 36 | } 37 | ] -------------------------------------------------------------------------------- /RMBTControlServer/src/cache.ccf: -------------------------------------------------------------------------------- 1 | jcs.default= 2 | jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes 3 | jcs.default.cacheattributes.MaxObjects=250 4 | jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache 5 | jcs.default.cacheattributes.UseMemoryShrinker=true 6 | jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600 7 | jcs.default.cacheattributes.ShrinkerIntervalSeconds=60 8 | jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes 9 | jcs.default.elementattributes.IsEternal=false 10 | jcs.default.elementattributes.MaxLifeSeconds=3600 11 | jcs.default.elementattributes.IsSpool=false 12 | jcs.default.elementattributes.IsRemote=false 13 | jcs.default.elementattributes.IsLateral=false 14 | -------------------------------------------------------------------------------- /install/postgresql/functions/rmbt_get_distance_iso_a2.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION public.rmbt_get_distance_iso_a2(point geometry,a2 varchar(5)) 2 | RETURNS float 3 | LANGUAGE plpgsql 4 | IMMUTABLE STRICT 5 | AS $function$ 6 | DECLARE 7 | -- ISO3266 two digit country code (e.g. 'US') 8 | distance float; 9 | BEGIN 10 | -- returns the distance in meter (m) betweeen location in WGS84 (EPSG:4236) and a two digit country code (e.g. 'US') 11 | 12 | -- Example query: select rmbt_get_distance_iso_a2(st_setsrid(ST_GeomFromText('POINT(-71.064544 42.28787)'),4326),'CA'); 13 | 14 | return ST_DistanceSpheroid(point,(select geom from admin_0_countries ac where iso_a2=a2),'SPHEROID["WGS 84",6378137,298.257223563]'); 15 | 16 | END; 17 | $function$ 18 | ; 19 | -------------------------------------------------------------------------------- /RMBTUtil/src/test/resources/at/rtr/rmbt/util/model/option/test5.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "title": "test5-option0", 4 | "options": [ 5 | { 6 | "params": { 7 | "test": 1, 8 | "option": "a1" 9 | }, 10 | "default": true 11 | }, 12 | { 13 | "params": { 14 | "test": 2, 15 | "option": "a2" 16 | } 17 | } 18 | ] 19 | }, 20 | { 21 | "title": "test5-option1", 22 | "options": [ 23 | { 24 | "params": { 25 | "option": "a3" 26 | } 27 | }, 28 | { 29 | "params": { 30 | "option": "a4" 31 | } 32 | } 33 | ], 34 | "params": { 35 | "suboption": "option1" 36 | }, 37 | "default": true 38 | } 39 | ] -------------------------------------------------------------------------------- /RMBTUtil/src/test/resources/at/rtr/rmbt/util/model/option/test1.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "All", 3 | "options": [ 4 | { 5 | "title": "Download", 6 | "summary": "Map shows download speeds", 7 | "params": { 8 | "overlay_type": "shapes", 9 | "map_options": "all/download" 10 | } 11 | }, 12 | { 13 | "title": "Upload", 14 | "summary": "Map shows upload speeds", 15 | "params": { 16 | "overlay_type": "shapes", 17 | "map_options": "all/upload" 18 | } 19 | }, 20 | { 21 | "title": "Ping", 22 | "summary": "Map shows ping times", 23 | "params": { 24 | "overlay_type": "shapes", 25 | "map_options": "all/ping" 26 | } 27 | } 28 | ], 29 | "params": { 30 | "map_type_is_mobile": false 31 | } 32 | } -------------------------------------------------------------------------------- /RMBTUtil/src/test/resources/at/rtr/rmbt/util/model/option/test2.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "test2", 3 | "options": [ 4 | { 5 | "params": { 6 | "title": "a1", 7 | "option": "a1", 8 | "parent_param": true 9 | } 10 | }, 11 | { 12 | "params": { 13 | "title": "a2", 14 | "option": "a2" 15 | } 16 | }, 17 | { 18 | "params": { 19 | "titles": "a3", 20 | "option": "a3", 21 | "param3": 0.5 22 | } 23 | }, 24 | { 25 | "title": "no_params" 26 | } 27 | ], 28 | "params": { 29 | "parent_param": false 30 | }, 31 | "functions": [ 32 | { 33 | "func_name": "drop_param", 34 | "func_params": { 35 | "key": "title" 36 | } 37 | }, 38 | { 39 | "func_name": "unknown_func" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /install/postgresql/3rd_party_open_data/coverage/view_cov_mno_fn.sql: -------------------------------------------------------------------------------- 1 | BEGIN; 2 | CREATE MATERIALIZED VIEW cov_mno_fn AS 3 | SELECT 4 | operator, 5 | 'BBfixed' AS reference, 6 | 'CCBY4.0 BMLRT' AS license, 7 | substr(date,0,11) AS rfc_date, 8 | raster, 9 | NULL AS dl_normal, 10 | NULL AS ul_normal, 11 | ROUND(dl_max_mbit*1000000)::BIGINT AS dl_max, 12 | ROUND(ul_max_mbit*1000000)::BIGINT AS ul_max, 13 | technology 14 | 15 | FROM cov_bb_fixed 16 | UNION 17 | SELECT operator,reference,CONCAT(license,' ',operator) license,rfc_date,raster,dl_normal,ul_normal,dl_max,ul_max, 18 | '5G' AS technology FROM cov_mno where reference='F7/16' 19 | UNION 20 | SELECT operator,reference,CONCAT(license,' ',operator) license,rfc_date,raster,dl_normal,ul_normal,dl_max,ul_max, 21 | 'mobile' AS technology FROM cov_mno where reference='F1/16'; 22 | ANALYZE cov_mno_fn; 23 | CREATE INDEX cov_mno_fn_raster_idx 24 | ON cov_mno_fn(raster); 25 | COMMIT; 26 | 27 | -------------------------------------------------------------------------------- /RMBTUtil/src/test/resources/at/rtr/rmbt/util/model/option/test3.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "test3", 3 | "options": [ 4 | { 5 | "params": { 6 | "level1": "1", 7 | "option": "a1" 8 | }, 9 | "options": [ 10 | { 11 | "params": { 12 | "option": "a2" 13 | }, 14 | "options": [ 15 | { 16 | "params": { 17 | "option": "a3" 18 | }, 19 | "options": [ 20 | { 21 | "params": { 22 | "option": "a4" 23 | }, 24 | "functions": [ 25 | { 26 | "func_name": "drop_param", 27 | "func_params": { 28 | "key": "option" 29 | } 30 | } 31 | ] 32 | } 33 | ] 34 | } 35 | ] 36 | } 37 | ] 38 | } 39 | ] 40 | } -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/qos/OnResultReadyListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.client.qos; 18 | 19 | public interface OnResultReadyListener { 20 | 21 | public void onResultReady(T result); 22 | } 23 | -------------------------------------------------------------------------------- /RMBTMapServer/src/at/rtr/rmbt/res/Configuration.properties: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------- 2 | # Copyright 2013-2014 alladin-IT GmbH 3 | # Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | #------------------------------------------------------------------------------- 17 | RMBT_SUPPORTED_LANGUAGES = de, en, hr, sv, pl, es, is, fr, nb, cs 18 | RMBT_DEFAULT_LANGUAGE = en 19 | -------------------------------------------------------------------------------- /install/postgresql/functions/rmbt_purge_obsolete.sql: -------------------------------------------------------------------------------- 1 | CREATE OR REPLACE FUNCTION public.rmbt_purge_obsolete(age integer) 2 | returns integer 3 | LANGUAGE plpgsql 4 | AS $function$ 5 | DECLARE 6 | num integer; 7 | BEGIN 8 | if (age is null or age < 90) then 9 | return null; 10 | end if; 11 | 12 | -- function purges IP etc for all tests older than age days 13 | -- returns number of tests purged or NULL when age is less than 90 days 14 | 15 | UPDATE test 16 | SET client_public_ip = NULL, public_ip_rdns = NULL, source_ip = NULL, 17 | client_ip_local = NULL, wifi_bssid = NULL, wifi_ssid = NULL 18 | WHERE (now()::date - time::date) > age 19 | AND (client_public_ip IS NOT NULL OR public_ip_rdns IS NOT NULL OR source_ip IS NOT NULL OR 20 | client_ip_local IS NOT NULL OR wifi_bssid IS NOT NULL OR wifi_ssid IS NOT NULL); 21 | 22 | GET diagnostics num = ROW_COUNT; 23 | 24 | RAISE NOTICE 'rmbt_purge_obsolete for last % days: % rows purged', age, num ; 25 | 26 | return num; 27 | 28 | END; 29 | $function$ 30 | ; 31 | -------------------------------------------------------------------------------- /RMBTSharedCode/src/at/rtr/rmbt/shared/qos/MkitDashResult.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.shared.qos; 18 | 19 | /** 20 | * @author Felix Kendlbacher (alladin-IT GmbH) 21 | */ 22 | public class MkitDashResult extends MkitResult { 23 | } 24 | -------------------------------------------------------------------------------- /RMBTSharedCode/src/at/rtr/rmbt/shared/qos/MkitWebConnectivityResult.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.shared.qos; 18 | 19 | /** 20 | * @author Felix Kendlbacher (alladin-IT GmbH) 21 | */ 22 | public class MkitWebConnectivityResult extends MkitResult { 23 | } 24 | -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/model/shared/exception/ErrorStatus.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 Specure GmbH 3 | * Copyright 2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util.model.shared.exception; 18 | 19 | public enum ErrorStatus { 20 | TEST_REJECTED, 21 | OTHER 22 | } 23 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/v2/task/QoSTestErrorEnum.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client.v2.task; 18 | 19 | public enum QoSTestErrorEnum { 20 | NONE, 21 | UNKNOWN, 22 | TEST_INIT_TIMEOUT 23 | } 24 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/helper/NdtStatus.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client.helper; 18 | 19 | public enum NdtStatus 20 | { 21 | NOT_STARTED, RUNNING, RESULTS, FINISHED, ERROR, ABORTED; 22 | } 23 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/v2/task/QoSTestEnum.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client.v2.task; 18 | 19 | public enum QoSTestEnum { 20 | START, STOP, QOS_RUNNING, ERROR, QOS_FINISHED, NDT_RUNNING; 21 | } 22 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/helper/RMBTOutputCallback.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client.helper; 18 | 19 | public interface RMBTOutputCallback 20 | { 21 | // has to be thread-safe! 22 | public void log(CharSequence text); 23 | } 24 | -------------------------------------------------------------------------------- /RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/opendata/dto/PingGraphItemDTO.java: -------------------------------------------------------------------------------- 1 | package at.rtr.rmbt.statisticServer.opendata.dto; 2 | 3 | import com.fasterxml.jackson.annotation.JsonProperty; 4 | import io.swagger.annotations.ApiModelProperty; 5 | 6 | public class PingGraphItemDTO { 7 | private double pingMs; 8 | private long timeElapsed; 9 | 10 | public PingGraphItemDTO() { 11 | 12 | } 13 | 14 | @JsonProperty("ping_ms") 15 | @ApiModelProperty(value = "Ping (round-trip time) in milliseconds, measured on the server side.", 16 | example = "8") 17 | public double getPingMs() { 18 | return pingMs; 19 | } 20 | 21 | public void setPingMs(double pingMs) { 22 | this.pingMs = pingMs; 23 | } 24 | 25 | @JsonProperty("time_elapsed") 26 | @ApiModelProperty(value = "The time elapsed since the start of the test in milliseconds.", 27 | example = "55") 28 | public long getTimeElapsed() { 29 | return timeElapsed; 30 | } 31 | 32 | public void setTimeElapsed(long timeElapsed) { 33 | this.timeElapsed = timeElapsed; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build All 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-20.04 9 | 10 | steps: 11 | - uses: actions/checkout@v4 12 | - name: set up JDK 1.11 13 | uses: actions/setup-java@v4 14 | with: 15 | java-version: '11' 16 | distribution: 'corretto' 17 | - name: Move `private` folder 18 | run: mv private.sample private 19 | - name: Build with Gradle 20 | run: | 21 | ./gradlew build --info --stacktrace 22 | ./gradlew :RMBTClient:shadowJar 23 | ./gradlew :RMBTMapServer:war 24 | ./gradlew :RMBTStatisticServer:war 25 | ./gradlew :RMBTQoSServer:jar 26 | ./gradlew :RMBTControlServer:war 27 | 28 | - name: Archive files 29 | uses: actions/upload-artifact@v4 30 | with: 31 | name: outputs 32 | path: | 33 | RMBTClient/build/libs/*-all.jar 34 | RMBTQoSServer/build/libs/*.jar 35 | RMBTControlServer/build/libs/*.war 36 | RMBTMapServer/build/libs/*.war 37 | RMBTStatisticServer/build/libs/*.war 38 | retention-days: 365 -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/helper/TestStatus.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client.helper; 18 | 19 | public enum TestStatus 20 | { 21 | WAIT, INIT, PING, DOWN, UP, INIT_UP, SPEEDTEST_END, QOS_TEST_RUNNING, QOS_END, END, ERROR, ABORTED; 22 | } 23 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/v2/task/ControlConnectionResponseCallback.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.client.v2.task; 18 | 19 | 20 | public interface ControlConnectionResponseCallback { 21 | void onResponse(final String response, final String request); 22 | } 23 | -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/model/option/OptionFunctionCallback.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util.model.option; 18 | 19 | 20 | public interface OptionFunctionCallback { 21 | 22 | boolean onCall(final ServerOption callingOption, final OptionFunction function); 23 | } 24 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/v2/task/result/QoSTestResultEnum.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2017-2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.client.v2.task.result; 18 | 19 | /** 20 | * The specific QoS type 21 | * 22 | * @author bp 23 | * 24 | */ 25 | public enum QoSTestResultEnum { 26 | TRACEROUTE_MASKED, TRACEROUTE, VOIP, HTTP_PROXY, WEBSITE, NON_TRANSPARENT_PROXY, DNS, TCP, UDP; 27 | } 28 | -------------------------------------------------------------------------------- /RMBTSharedCode/src/at/rtr/rmbt/shared/qos/ResultOptions.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.shared.qos; 18 | 19 | import java.util.Locale; 20 | 21 | public class ResultOptions { 22 | final Locale locale; 23 | 24 | public ResultOptions(Locale locale) { 25 | this.locale = locale; 26 | } 27 | 28 | public Locale getLocale() { 29 | return locale; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/model/shared/exception/LoopModeRejectedException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 Specure GmbH 3 | * Copyright 2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util.model.shared.exception; 18 | 19 | public class LoopModeRejectedException extends Exception{ 20 | 21 | /** 22 | * 23 | */ 24 | private static final long serialVersionUID = 1L; 25 | } 26 | -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/tools/MemInfo.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util.tools; 18 | 19 | import java.util.Map; 20 | 21 | public interface MemInfo { 22 | 23 | public void update(); 24 | 25 | public Map getMemoryMap(); 26 | 27 | public long getTotalMem(); 28 | 29 | public long getFreeMem(); 30 | } 31 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/entity/Observable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 Specure GmbH 3 | * Copyright 2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.qos.testserver.entity; 18 | 19 | public interface Observable { 20 | 21 | /** 22 | * 23 | * @return 24 | */ 25 | public boolean isHealthy(); 26 | 27 | /** 28 | * 29 | * @return 30 | */ 31 | public String getStatusMessage(); 32 | } 33 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/tcp/competences/Action.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ***************************************************************************/ 16 | 17 | package at.rtr.rmbt.qos.testserver.tcp.competences; 18 | 19 | import java.io.FilterOutputStream; 20 | 21 | import at.rtr.rmbt.qos.testserver.tcp.TcpClientHandler; 22 | 23 | public interface Action { 24 | 25 | public boolean execute(final TcpClientHandler tcpClientHandler, final byte[] requestData, final FilterOutputStream fos); 26 | } 27 | -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/qos/ResultOptions.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.qos; 18 | 19 | import java.util.Locale; 20 | 21 | public class ResultOptions { 22 | final Locale locale; 23 | 24 | public ResultOptions(Locale locale) { 25 | this.locale = locale; 26 | } 27 | 28 | public Locale getLocale() { 29 | return locale; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/db/fields/IPField.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.db.fields; 18 | 19 | public class IPField extends StringField 20 | { 21 | private static final long serialVersionUID = 1L; 22 | 23 | public IPField(final String dbKey, final String jsonKey) 24 | { 25 | super(dbKey, jsonKey); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /RMBTMapServer/src/at/rtr/rmbt/mapServer/PngOutputRepresentation.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.mapServer; 18 | 19 | import org.restlet.data.MediaType; 20 | 21 | public class PngOutputRepresentation extends ByteArrayOutputRepresentation 22 | { 23 | 24 | public PngOutputRepresentation(byte[] data) 25 | { 26 | super(data, MediaType.IMAGE_PNG); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /RMBTSharedCode/src/at/rtr/rmbt/shared/smoothing/Smoothable.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.shared.smoothing; 18 | 19 | /** 20 | * 21 | * @author lb 22 | * 23 | */ 24 | public interface Smoothable { 25 | /** 26 | * the y-axis value 27 | * @return 28 | */ 29 | double getXValue(); 30 | 31 | /** 32 | * the x-axis value 33 | * @return 34 | */ 35 | double getYValue(); 36 | } 37 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/entity/QoSProtocolException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 Specure GmbH 3 | * Copyright 2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.qos.testserver.entity; 18 | 19 | public class QoSProtocolException extends QoSTestServerException { 20 | 21 | /** 22 | * 23 | */ 24 | private static final long serialVersionUID = 1L; 25 | 26 | public QoSProtocolException(String message) { 27 | super(message); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | Open-RMBT 3 | Copyright 2013-2015 alladin-IT GmbH 4 | Copyright 2013-2017 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 5 | 6 | This product includes software developed at 7 | Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 8 | (https://www.rtr.at/). 9 | 10 | This product includes software developed at 11 | alladin-IT GmbH (https://alladin.at/). 12 | 13 | This software contains code derived from the 14 | Web100 Network Diagnostic Tool (NDT), which is open source software, 15 | available under the "new BSD license". The original software is available 16 | from https://code.google.com/p/ndt/ 17 | 18 | This software contains code derived from the 19 | MaxMind GeoIP Java API, which is open source software, 20 | available under the "GNU Lesser General Public License" (version 2). 21 | The original software is available from 22 | https://github.com/maxmind/geoip-api-java 23 | 24 | This software contains code that is released under licenses different 25 | from the project license. In this case, the applicable license is stated 26 | in the file headers. 27 | ========================================================================= 28 | -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/NumberUtil.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util; 18 | 19 | 20 | public class NumberUtil { 21 | 22 | /** 23 | * 24 | * @param number 25 | * @return 26 | */ 27 | public final static boolean isInteger(Object number) { 28 | try { 29 | Integer.parseInt(String.valueOf(number)); 30 | return true; 31 | } 32 | catch (Throwable t) { 33 | return false; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/Ping.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client; 18 | 19 | public class Ping 20 | { 21 | public Ping(long client, long server, long timeNs) 22 | { 23 | this.client = client; 24 | this.server = server; 25 | this.timeNs = timeNs; 26 | } 27 | 28 | final public long client; 29 | final public long server; 30 | final public long timeNs; 31 | } 32 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/entity/QoSTestServerException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 Specure GmbH 3 | * Copyright 2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.qos.testserver.entity; 18 | 19 | /** 20 | * 21 | * @author lb 22 | * 23 | */ 24 | public class QoSTestServerException extends Exception { 25 | 26 | /** 27 | * 28 | */ 29 | private static final long serialVersionUID = 1L; 30 | 31 | public QoSTestServerException(String message) { 32 | super(message); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/TestServerException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.qos.testserver; 18 | 19 | /** 20 | * 21 | * @author lb 22 | * 23 | */ 24 | public class TestServerException extends Exception { 25 | 26 | /** 27 | * 28 | */ 29 | private static final long serialVersionUID = 1L; 30 | 31 | public TestServerException(String msg, Throwable cause) { 32 | super(msg, cause); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/udp/UdpTestCompleteCallback.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2016 alladin-IT GmbH 3 | * Copyright 2013-2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.qos.testserver.udp; 18 | 19 | import at.rtr.rmbt.qos.testserver.servers.AbstractUdpServer; 20 | 21 | /** 22 | * 23 | * @author lb 24 | * 25 | */ 26 | public interface UdpTestCompleteCallback { 27 | 28 | /** 29 | * 30 | * @param udpData 31 | */ 32 | public boolean onComplete(AbstractUdpServer udpData); 33 | } 34 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/test/java/at/rtr/rmbt/qos/testserver/rules/Repeat.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.qos.testserver.rules; 18 | 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | import java.lang.annotation.Target; 22 | 23 | /** 24 | * 25 | * @author Lukasz Budryk (lb@alladin.at) 26 | * 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Target(java.lang.annotation.ElementType.METHOD) 30 | public @interface Repeat { 31 | 32 | public int value() default 1; 33 | 34 | } -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/tools/NetStat.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util.tools; 18 | 19 | import java.util.List; 20 | 21 | import at.rtr.rmbt.util.tools.ConnectionInformation.ProtocolType; 22 | 23 | public interface NetStat { 24 | 25 | public List getConnectionList(); 26 | 27 | public List getConnectionList(ProtocolType protocolType); 28 | 29 | public String runSystemCommand(); 30 | } 31 | -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/db/dao/PrimaryKeyDao.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.db.dao; 18 | 19 | import java.sql.SQLException; 20 | import java.util.List; 21 | 22 | /** 23 | * 24 | * @author lb 25 | * 26 | * @param entity type 27 | * @param primary key type 28 | */ 29 | public interface PrimaryKeyDao { 30 | 31 | public E getById(K id) throws SQLException; 32 | 33 | public List getAll() throws SQLException; 34 | } 35 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/tcp/competences/RepeatAction.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ***************************************************************************/ 16 | 17 | package at.rtr.rmbt.qos.testserver.tcp.competences; 18 | 19 | import java.io.FilterOutputStream; 20 | 21 | import at.rtr.rmbt.qos.testserver.tcp.TcpClientHandler; 22 | 23 | public class RepeatAction implements Action { 24 | 25 | @Override 26 | public boolean execute(final TcpClientHandler tcpClientHandler, final byte[] requestData, FilterOutputStream os) { 27 | tcpClientHandler.getRepeat().set(true); 28 | return true; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /RMBTSharedCode/src/at/rtr/rmbt/shared/hstoreparser/annotation/HstoreKey.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.shared.hstoreparser.annotation; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | @Retention(RetentionPolicy.RUNTIME) 25 | @Target(ElementType.FIELD) 26 | public @interface HstoreKey { 27 | String value(); 28 | } 29 | -------------------------------------------------------------------------------- /RMBTMapServer/src/at/rtr/rmbt/mapServer/parameters/ShapeTileParameters.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.mapServer.parameters; 18 | 19 | import org.restlet.data.Form; 20 | 21 | public class ShapeTileParameters extends TileParameters 22 | { 23 | public ShapeTileParameters(Path path, Form params) 24 | { 25 | super(path, params, 0.4); 26 | } 27 | 28 | @Override 29 | public boolean isNoCache() 30 | { 31 | return false; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /RMBTMapServer/src/at/rtr/rmbt/mapServer/parameters/HeatmapTileParameters.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.mapServer.parameters; 18 | 19 | import org.restlet.data.Form; 20 | 21 | public class HeatmapTileParameters extends TileParameters 22 | { 23 | public HeatmapTileParameters(Path path, Form params) 24 | { 25 | super(path, params, 0.75); 26 | } 27 | 28 | @Override 29 | public boolean isNoCache() 30 | { 31 | return false; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/service/JobCallback.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.qos.testserver.service; 18 | 19 | import at.rtr.rmbt.qos.testserver.service.AbstractJob.JobState; 20 | 21 | 22 | /** 23 | * 24 | * @author lb 25 | * 26 | */ 27 | public interface JobCallback { 28 | 29 | /** 30 | * 31 | * @param newState 32 | * @return 33 | */ 34 | public boolean onEvent(AbstractJob service, JobState state, Object newResult); 35 | } 36 | -------------------------------------------------------------------------------- /RMBTQoSServer/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenCentral() 4 | } 5 | } 6 | 7 | apply plugin: 'java' 8 | sourceCompatibility = '1.8' 9 | 10 | tasks.withType(JavaCompile) { 11 | options.encoding = "UTF-8" 12 | } 13 | 14 | repositories { 15 | mavenCentral() 16 | maven{url 'http://maven.restlet.com'} 17 | } 18 | 19 | 20 | 21 | dependencies { 22 | compile project(':RMBTUtil') 23 | compile project(':RMBTSharedCode') 24 | compile 'org.jumpmind.symmetric.jdbc:postgresql:9.2-1002-jdbc4' 25 | compile 'org.apache.logging.log4j:log4j-core:2.16.0' 26 | compile "org.json:json:$jsonVersion" 27 | compile "org.restlet.jse:org.restlet:$restletVersion" 28 | 29 | testImplementation group: 'org.jmockit', name: 'jmockit', version: '1.45' 30 | testImplementation group: 'junit', name: 'junit', version: '4.12' 31 | } 32 | 33 | jar { 34 | from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } 35 | from(rootProject.file("private/qosserver.jks"),{ 36 | into('/crt') 37 | }) 38 | manifest { attributes 'Main-Class': 'at.rtr.rmbt.qos.testserver.TestServer' } 39 | } 40 | 41 | task wrapper(type: Wrapper) { 42 | gradleVersion = '2.2.1' 43 | } 44 | 45 | 46 | test { 47 | jvmArgs "-javaagent:${classpath.find { it.name.contains("jmockit") }.absolutePath}" 48 | } -------------------------------------------------------------------------------- /RMBTStatisticServer/src/at/rtr/rmbt/res/Configuration.properties: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------- 2 | # Copyright 2013-2014 alladin-IT GmbH 3 | # Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | #------------------------------------------------------------------------------- 17 | # limit in m 18 | RMBT_GEO_ACCURACY_BUTTON_LIMIT = 2000 19 | # limit in m 20 | RMBT_GEO_ACCURACY_DETAIL_LIMIT = 10000 21 | # limit in m 22 | RMBT_GEO_DISTANCE_DETAIL_LIMIT = 3000 23 | 24 | RMBT_SUPPORTED_LANGUAGES = de, en, hr, sv, pl, es, is, fr, nb, cs 25 | RMBT_DEFAULT_LANGUAGE = en 26 | 27 | WEASYPRINT_PATH=/usr/local/bin/weasyprint 28 | PRINCE_PATH=/usr/bin/prince 29 | PDF_TEMP_PATH=/tmp/pdf/ 30 | #weasyprint or prince 31 | PDF_CONVERTER=weasyprint -------------------------------------------------------------------------------- /RMBTClient/src/test/java/at/rtr/rmbt/client/QualityOfExperienceTest.java: -------------------------------------------------------------------------------- 1 | package at.rtr.rmbt.client; 2 | 3 | import at.rtr.rmbt.shared.QoEClassification; 4 | import org.junit.Test; 5 | 6 | import java.util.Arrays; 7 | import java.util.HashMap; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | import static org.junit.Assert.assertEquals; 12 | 13 | public class QualityOfExperienceTest { 14 | 15 | @Test 16 | public void testQoE() { 17 | Map thresholds = new HashMap<>(); 18 | thresholds.put(QoEClassification.QoEClassificationThresholds.Criteria.DOWN, new Long[]{8000L,4000L,2000L}); 19 | thresholds.put(QoEClassification.QoEClassificationThresholds.Criteria.UP, new Long[]{60000L,30000L,10000L}); 20 | thresholds.put(QoEClassification.QoEClassificationThresholds.Criteria.PING, new Long[]{5000000L,10000000L,50000000L}); 21 | 22 | List classification = QoEClassification.classify((long) (10 * 1e6), (long) (10 * 1e3), (long) (10 * 1e3), Arrays.asList( 23 | new QoEClassification.QoEClassificationThresholds(QoEClassification.Category.GAMING_CLOUD, thresholds) 24 | )); 25 | 26 | assertEquals(classification.get(0).getClassification(),2); 27 | assertEquals(classification.get(0).getQuality(),0.25,0.01); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/db/dao/CrudPrimaryKeyDao.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2015 alladin-IT GmbH 3 | * Copyright 2013-2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.db.dao; 18 | 19 | import java.sql.SQLException; 20 | 21 | /** 22 | * 23 | * @author lb 24 | * 25 | * @param entity type 26 | * @param primary key type 27 | */ 28 | public interface CrudPrimaryKeyDao extends PrimaryKeyDao { 29 | 30 | public int delete(E entity) throws SQLException; 31 | 32 | public int save(E entity) throws SQLException; 33 | 34 | public int update(E entity) throws SQLException; 35 | } 36 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/ThreadTestResult.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client; 18 | 19 | public class ThreadTestResult extends TestResult 20 | { 21 | public Results down; 22 | public Results up; 23 | 24 | public long totalDownBytes; 25 | public long totalUpBytes; 26 | 27 | public static long getLastEntry(final long[] data) 28 | { 29 | if (data == null || data.length == 0) 30 | return 0; 31 | return data[data.length - 1]; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/model/option/OptionFunctionUtil.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util.model.option; 18 | 19 | import java.util.Map; 20 | 21 | public class OptionFunctionUtil { 22 | 23 | /** 24 | * function: "drop_param": removes a specific parameter 25 | * @param paramMap 26 | * @param function 27 | */ 28 | public static void funcDropParam(Map paramMap, OptionFunction function) { 29 | if (paramMap != null) { 30 | paramMap.remove(function.getParameterMap().get("key")); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/udp/UdpPacketReceivedCallback.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2016 alladin-IT GmbH 3 | * Copyright 2013-2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.qos.testserver.udp; 18 | 19 | import java.net.DatagramPacket; 20 | 21 | import at.rtr.rmbt.qos.testserver.servers.AbstractUdpServer; 22 | 23 | /** 24 | * 25 | * @author lb 26 | * 27 | */ 28 | public interface UdpPacketReceivedCallback { 29 | 30 | /** 31 | * 32 | * @param data 33 | * @return 34 | */ 35 | public boolean onReceive(final DatagramPacket dp, final String uuid, final AbstractUdpServer udpServer); 36 | } 37 | -------------------------------------------------------------------------------- /RMBTSharedCode/src/at/rtr/rmbt/shared/hstoreparser/annotation/HstoreCollection.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.shared.hstoreparser.annotation; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | @Retention(RetentionPolicy.RUNTIME) 25 | @Target(ElementType.FIELD) 26 | public @interface HstoreCollection { 27 | 28 | /** 29 | * the class that will be used to fill this collection 30 | * @return 31 | */ 32 | Class value(); 33 | } 34 | -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/qos/annotations/NonComparableField.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 Specure GmbH 3 | * Copyright 2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.qos.annotations; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | import at.rtr.rmbt.qos.AbstractResult; 25 | 26 | /** 27 | * can be added to an {@link AbstractResult} field to exclude it from evaluation (makes it faster) 28 | * @author lb 29 | * 30 | */ 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Target(ElementType.FIELD) 33 | public @interface NonComparableField { 34 | 35 | } 36 | -------------------------------------------------------------------------------- /RMBTSharedCode/src/at/rtr/rmbt/shared/qos/annotations/NonComparableField.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2019 alladin-IT GmbH 3 | * Copyright 2014-2016 SPECURE GmbH 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | 18 | package at.rtr.rmbt.shared.qos.annotations; 19 | 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | import at.rtr.rmbt.shared.qos.AbstractResult; 26 | 27 | /** 28 | * can be added to an {@link AbstractResult} field to exclude it from evaluation (makes it faster) 29 | * @author lb 30 | * 31 | */ 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target(ElementType.FIELD) 34 | public @interface NonComparableField { 35 | 36 | } 37 | -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/db/fields/JsonField.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.db.fields; 18 | 19 | public class JsonField extends StringField 20 | { 21 | private static final long serialVersionUID = 1L; 22 | 23 | public JsonField(String dbKey, String jsonKey) 24 | { 25 | super(dbKey, jsonKey); 26 | } 27 | 28 | public JsonField(String dbKey, String jsonKey, boolean readOnly) 29 | { 30 | super(dbKey, jsonKey, readOnly); 31 | } 32 | 33 | @Override 34 | public CharSequence getSQLValue() 35 | { 36 | return super.getSQLValue()+"::json"; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/entity/AbstractTtlObject.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 Specure GmbH 3 | * Copyright 2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.qos.testserver.entity; 18 | 19 | /** 20 | * 21 | * @author lb 22 | * 23 | * @param 24 | */ 25 | public class AbstractTtlObject { 26 | 27 | /** 28 | * 29 | */ 30 | private long ttl = 0; 31 | 32 | /** 33 | * 34 | * @return 35 | */ 36 | public long getTtl() { 37 | return ttl; 38 | } 39 | 40 | /** 41 | * 42 | * @param ttl 43 | */ 44 | public void setTtl(long ttl) { 45 | this.ttl = ttl; 46 | } 47 | 48 | /** 49 | * 50 | */ 51 | public void resetTtl(long ttl) { 52 | setTtl(System.currentTimeMillis() + ttl); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/test/java/at/rtr/rmbt/qos/testserver/mock/SocketWithCountDownLatchMockup.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.qos.testserver.mock; 18 | 19 | import java.io.IOException; 20 | import java.net.Socket; 21 | import java.util.concurrent.CountDownLatch; 22 | 23 | import mockit.Mock; 24 | import mockit.MockUp; 25 | 26 | /** 27 | * 28 | * @author Lukasz Budryk (lb@alladin.at) 29 | * 30 | */ 31 | public class SocketWithCountDownLatchMockup extends MockUp { 32 | 33 | final CountDownLatch latch; 34 | 35 | public SocketWithCountDownLatchMockup(final CountDownLatch latch) { 36 | this.latch = latch; 37 | } 38 | 39 | @Mock 40 | public synchronized void close() throws IOException { 41 | latch.countDown(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/opendata/dto/SpeedGraphItemDTO.java: -------------------------------------------------------------------------------- 1 | package at.rtr.rmbt.statisticServer.opendata.dto; 2 | 3 | 4 | import com.fasterxml.jackson.annotation.JsonProperty; 5 | import io.swagger.annotations.ApiModelProperty; 6 | 7 | public class SpeedGraphItemDTO { 8 | protected long timeElapsedNs; 9 | protected double bytesTotal; 10 | 11 | 12 | @JsonProperty("time_elapsed") 13 | @ApiModelProperty(value = "The time elapsed since the start of the test phase in milliseconds.", 14 | example = "55") 15 | public long getTimeElapsed() { 16 | return Math.round(timeElapsedNs / 1e6); 17 | } 18 | 19 | public void setTimeElapsed(long timeElapsedNs) { 20 | this.timeElapsedNs = timeElapsedNs; 21 | } 22 | 23 | @JsonProperty("bytes_total") 24 | @ApiModelProperty(value = "The sum of all bytes transferred since the start of the test phase.", 25 | example = "4096") 26 | public double getBytesTotal() { 27 | return bytesTotal; 28 | } 29 | 30 | public void setBytesTotal(double bytesTotal) { 31 | this.bytesTotal = bytesTotal; 32 | } 33 | 34 | public static class SpeedItemThreadwise extends SpeedGraphItemDTO { 35 | @JsonProperty("time_elapsed_ns") 36 | @ApiModelProperty(value = "The time elapsed since the start of the test phase for this thread, in nanoseconds.", 37 | example = "41183662") 38 | public long getTimeElapsed() { 39 | return timeElapsedNs; 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /install/postgresql/create_rmbt_init_sql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # dz 4 | # 5 | # Create rmbt_init.sql - database initialization 6 | # GIT location: /install/postgresql/rmbt_init.sql 7 | 8 | 9 | # set -x 10 | 11 | export LANG=C 12 | DATE=`date '+%Y-%m-%d_%H-%M-%S'` 13 | OUTPUT=rmbt_init.sql 14 | # List of tables to be dumped 15 | declare -a TABLES=("provider" "as2provider" "client_type" "mcc2country" "mccmnc2name" "mccmnc2provider" "network_type" \ 16 | "qos_test_desc" "qos_test_type_desc" "qos_test_objective") 17 | 18 | # Check if file exists 19 | test -r $OUTPUT && echo "$OUTPUT exists, aborting." && exit 0 20 | # Create header with timestamp 21 | echo "-- $DATE $OUTPUT" > $OUTPUT 22 | echo "-- " > $OUTPUT 23 | # Dump tables 24 | 25 | # Loop through all tables 26 | for i in "${TABLES[@]}" 27 | do 28 | # Update on progress 29 | echo "Dumping table $i..." 30 | echo "-- $DATE $OUTPUT table $i" > $i.sql 31 | pg_dump rmbt --table=$i --column-inserts --data-only >> $i.sql 32 | cat $i.sql >> $OUTPUT 33 | done 34 | 35 | # Include dummy tables 36 | 37 | 38 | 39 | # List of tables to be included from templates 40 | declare -a TABLES=("device_map" "news" "settings" "test_server") 41 | 42 | # Include templates 43 | 44 | # Loop through all template tables 45 | for i in "${TABLES[@]}" 46 | do 47 | # Update on progress 48 | echo "Including template table $i..." 49 | echo "-- $DATE $OUTPUT template table $i" >> $OUTPUT 50 | cat $i-template.sql >> $OUTPUT 51 | done 52 | 53 | test -r $OUTPUT && echo "$OUTPUT created." && exit 1 54 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/v2/task/service/TrafficService.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2016 alladin-IT GmbH 3 | * Copyright 2013-2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | // based on: https://raw.githubusercontent.com/alladin-IT/open-rmbt/master/RMBTClient/src/at/alladin/rmbt/client/v2/task/service/TrafficService.java 18 | package at.rtr.rmbt.client.v2.task.service; 19 | 20 | /** 21 | * 22 | * @author lb 23 | * 24 | */ 25 | public interface TrafficService { 26 | public final static int SERVICE_NOT_SUPPORTED = -1; 27 | 28 | public final static int SERVICE_START_OK = 0; 29 | 30 | public int start(); 31 | 32 | public long getTxBytes(); 33 | 34 | public long getRxBytes(); 35 | 36 | public long getTotalTxBytes(); 37 | 38 | public long getTotalRxBytes(); 39 | 40 | public void stop(); 41 | } 42 | -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/db/fields/IllegalFieldTypeException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.db.fields; 18 | 19 | public class IllegalFieldTypeException extends RuntimeException 20 | { 21 | private static final long serialVersionUID = 1L; 22 | 23 | public IllegalFieldTypeException() 24 | { 25 | super(); 26 | } 27 | 28 | public IllegalFieldTypeException(final String message, final Throwable cause) 29 | { 30 | super(message, cause); 31 | } 32 | 33 | public IllegalFieldTypeException(final String message) 34 | { 35 | super(message); 36 | } 37 | 38 | public IllegalFieldTypeException(final Throwable cause) 39 | { 40 | super(cause); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /RMBTQoSServer/qos_server.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | 4 | ### BEGIN INIT INFO 5 | # Provides: qos_server 6 | # Required-Start: $local_fs $remote_fs $syslog $time 7 | # Required-Stop: $local_fs $remote_fs $syslog 8 | # Should-Start: 9 | # Should-Stop: 10 | # Default-Start: 2 3 4 5 11 | # Default-Stop: 0 1 6 12 | # Short-Description: Start/Stop the qos_server 13 | ### END INIT INFO 14 | 15 | 16 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 17 | DIR=/home/netztest/qos_server 18 | JAR=$DIR/RMBTQoSTesterver.jar 19 | EXEC=/usr/bin/java 20 | NAME=qos_server 21 | DESC=qos_server 22 | PIDFILE=/var/run/netztest/qos_server.pid 23 | USER=netztest 24 | 25 | if ! [ -x "/lib/lsb/init-functions" ]; then 26 | . /lib/lsb/init-functions 27 | else 28 | echo "E: /lib/lsb/init-functions not found, lsb-base (>= 3.0-6) needed" 29 | exit 1 30 | fi 31 | 32 | set -e 33 | 34 | case "$1" in 35 | start) 36 | log_daemon_msg "Starting $DESC" "$NAME" 37 | start-stop-daemon --start --quiet --chuid $USER --user $USER --pidfile $PIDFILE -m -b -d $DIR --oknodo --exec $EXEC -- -jar $JAR 38 | log_end_msg $? 39 | ;; 40 | stop) 41 | log_daemon_msg "Stopping $DESC" "$NAME" 42 | start-stop-daemon --stop --quiet --chuid $USER --user $USER --pidfile $PIDFILE --oknodo --exec $EXEC 43 | log_end_msg $? 44 | ;; 45 | restart) 46 | $0 stop 47 | sleep 1 48 | $0 start 49 | ;; 50 | *) 51 | log_failure_msg "Usage: $N {start|stop|restart}" 52 | exit 1 53 | ;; 54 | esac 55 | 56 | exit 0 57 | 58 | -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/capability/ClassificationCapability.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 Specure GmbH 3 | * Copyright 2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util.capability; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | 21 | public class ClassificationCapability { 22 | 23 | public final static int DEFAULT_CLASSIFICATON_COUNT = 3; 24 | 25 | @SerializedName("count") 26 | protected int count = DEFAULT_CLASSIFICATON_COUNT; 27 | 28 | /** 29 | * amount of classification items supported by client 30 | * @return 31 | */ 32 | public int getCount() { 33 | return count; 34 | } 35 | 36 | public void setCount(int count) { 37 | this.count = count; 38 | } 39 | 40 | @Override 41 | public String toString() { 42 | return "ClassificationCapability [count=" + count + "]"; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /install/postgresql/rmbt_globals.sql: -------------------------------------------------------------------------------- 1 | -- 2019-02-04_20-14-39 rmbt_globals.sql 2 | -- pg_dumpall -g >> rmbt_globals.sql 3 | 4 | -- 5 | -- PostgreSQL database cluster dump 6 | -- 7 | 8 | SET default_transaction_read_only = off; 9 | 10 | SET client_encoding = 'UTF8'; 11 | SET standard_conforming_strings = on; 12 | 13 | -- 14 | -- Roles 15 | -- 16 | 17 | CREATE ROLE nagios; 18 | ALTER ROLE nagios WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS; 19 | CREATE ROLE postgres; 20 | ALTER ROLE postgres WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN REPLICATION NOBYPASSRLS PASSWORD '-change-me'; 21 | CREATE ROLE replication; 22 | ALTER ROLE replication WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN REPLICATION NOBYPASSRLS PASSWORD '-change-me'; 23 | CREATE ROLE rmbt; 24 | ALTER ROLE rmbt WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD '-change-me'; 25 | CREATE ROLE rmbt_control; 26 | ALTER ROLE rmbt_control WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD '-change-me'; 27 | CREATE ROLE rmbt_group_control; 28 | ALTER ROLE rmbt_group_control WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN NOREPLICATION NOBYPASSRLS; 29 | CREATE ROLE rmbt_group_read_only; 30 | ALTER ROLE rmbt_group_read_only WITH NOSUPERUSER INHERIT NOCREATEROLE NOCREATEDB NOLOGIN NOREPLICATION NOBYPASSRLS; 31 | 32 | 33 | -- 34 | -- Role memberships 35 | -- 36 | 37 | GRANT rmbt_group_control TO rmbt_control; 38 | GRANT rmbt_group_read_only TO rmbt_control; 39 | 40 | 41 | 42 | 43 | -- 44 | -- PostgreSQL database cluster dump complete 45 | -- 46 | 47 | -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/res/Configuration.properties: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------- 2 | # Copyright 2013-2014 alladin-IT GmbH 3 | # Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | #------------------------------------------------------------------------------- 17 | RMBT_CLIENT_NAME = RMBT, RMBTjs, Open-RMBT, Open-RMBT, Open-RMBT, RMBTws, HW-PROBE 18 | # allowed versions of RMBT server given in npm-semver requirement notation 19 | RMBT_VERSION_NUMBER = 0.1.0 || 0.3.0 || ^1.0.0 20 | 21 | # limit in m 22 | RMBT_GEO_ACCURACY_BUTTON_LIMIT = 2000 23 | # limit in m 24 | RMBT_GEO_ACCURACY_DETAIL_LIMIT = 10000 25 | # limit in m 26 | RMBT_GEO_DISTANCE_DETAIL_LIMIT = 3000 27 | 28 | RMBT_RESULT_PATH = result 29 | 30 | #qos result path 31 | RMBT_QOS_RESULT_PATH = resultQoS 32 | 33 | RMBT_NUM_THREADS = 3 34 | RMBT_NUM_PINGS = 10 35 | 36 | RMBT_DURATION = 7 37 | 38 | RMBT_SUPPORTED_LANGUAGES = de, en, hr, sv, pl, es, is, fr, nb, cs, ru 39 | RMBT_DEFAULT_LANGUAGE = en 40 | 41 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/qos/QoSMeasurementClientControlAdapter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.client.qos; 18 | 19 | import java.util.List; 20 | 21 | import at.rtr.rmbt.shared.qos.QosMeasurementType; 22 | import at.rtr.rmbt.client.v2.task.result.QoSResultCollector; 23 | 24 | public abstract class QoSMeasurementClientControlAdapter implements QoSMeasurementClientControlListener { 25 | 26 | @Override 27 | public void onMeasurementStarted(List testsToBeExecuted) { 28 | 29 | } 30 | 31 | @Override 32 | public void onMeasurementStopped() { 33 | 34 | } 35 | 36 | @Override 37 | public void onMeasurementError(Exception e) { 38 | 39 | } 40 | 41 | @Override 42 | public void onMeasurementFinished(String qosTestUuid, QoSResultCollector qoSResultCollector) { 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/v2/task/service/TestProgressListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client.v2.task.service; 18 | 19 | import at.rtr.rmbt.client.QualityOfServiceTest; 20 | import at.rtr.rmbt.client.v2.task.AbstractQoSTask; 21 | 22 | /** 23 | * 24 | * @author lb 25 | * 26 | */ 27 | public interface TestProgressListener { 28 | public enum TestProgressEvent { 29 | ON_CREATED, ON_START, ON_END; 30 | } 31 | 32 | /** 33 | * 34 | * @param qosTest 35 | */ 36 | public void onQoSCreated(QualityOfServiceTest qosTest); 37 | 38 | /** 39 | * @return 40 | * 41 | */ 42 | public void onQoSTestStart(AbstractQoSTask test); 43 | 44 | /** 45 | * 46 | * @param test 47 | */ 48 | public void onQoSTestEnd(AbstractQoSTask test); 49 | } 50 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/qos/QoSMeasurementClientControlListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.client.qos; 18 | 19 | import java.util.List; 20 | 21 | import at.rtr.rmbt.shared.qos.QosMeasurementType; 22 | import at.rtr.rmbt.client.v2.task.result.QoSResultCollector; 23 | 24 | public interface QoSMeasurementClientControlListener { 25 | 26 | public void onMeasurementStarted(List testsToBeExecuted); 27 | 28 | /** 29 | * If the user stopped the test 30 | */ 31 | public void onMeasurementStopped(); 32 | 33 | /** 34 | * If the qos test ran into an error 35 | */ 36 | public void onMeasurementError(Exception e); 37 | 38 | /** 39 | * If the qos test finished naturally 40 | * @param 41 | */ 42 | public void onMeasurementFinished(String qostTestUuid, QoSResultCollector resultCollector); 43 | } 44 | -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/controlServer/TimerFilter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.controlServer; 18 | 19 | import org.restlet.Request; 20 | import org.restlet.Response; 21 | import org.restlet.routing.Filter; 22 | 23 | public class TimerFilter extends Filter { 24 | 25 | ThreadLocal timestamp = new ThreadLocal<>(); 26 | 27 | @Override 28 | protected int beforeHandle(Request request, Response response) { 29 | timestamp.set(System.currentTimeMillis()); 30 | return super.beforeHandle(request, response); 31 | } 32 | 33 | @Override 34 | protected void afterHandle(Request request, Response response) { 35 | System.out.println(request.getResourceRef().getIdentifier() + " Time needed: " + (System.currentTimeMillis() - timestamp.get()) + "ms"); 36 | super.afterHandle(request, response); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/capability/QualityOfServiceCapability.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 Specure GmbH 3 | * Copyright 2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util.capability; 18 | 19 | import com.google.gson.annotations.SerializedName; 20 | 21 | public class QualityOfServiceCapability { 22 | 23 | public static boolean DEFAULT_QOS_SUPPORTS_INFO = false; 24 | 25 | @SerializedName("supports_info") 26 | public boolean supportsInfo = DEFAULT_QOS_SUPPORTS_INFO; 27 | 28 | /** 29 | * if true the third state (=INFO) is supported 30 | * @return 31 | */ 32 | public boolean isSupportsInfo() { 33 | return supportsInfo; 34 | } 35 | 36 | public void setSupportsInfo(boolean supportsInfo) { 37 | this.supportsInfo = supportsInfo; 38 | } 39 | 40 | @Override 41 | public String toString() { 42 | return "QualityOfServiceCapability [supportsInfo=" + supportsInfo + "]"; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/tcp/competences/Competence.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ***************************************************************************/ 16 | 17 | package at.rtr.rmbt.qos.testserver.tcp.competences; 18 | 19 | import java.io.BufferedReader; 20 | import java.io.IOException; 21 | import java.util.List; 22 | 23 | /** 24 | * 25 | * @author lb@alladin.at 26 | * 27 | */ 28 | public interface Competence { 29 | 30 | /** 31 | * Check if the incoming data (first line) applies to this specific competence. 32 | * @param firstLine 33 | * @return 34 | */ 35 | boolean appliesTo(final String firstLine); 36 | 37 | /** 38 | * Read full request 39 | * @param firstLine 40 | * @return 41 | */ 42 | String readFullRequest(final String firstLine, final BufferedReader br) throws IOException; 43 | 44 | /** 45 | * Process request and return action(s). 46 | * @param tcpClientHandler 47 | * @return 48 | */ 49 | List processRequest(final String data); 50 | } 51 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/Results.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2015 alladin-IT GmbH 3 | * Copyright 2013-2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client; 18 | 19 | import java.util.Arrays; 20 | 21 | public class Results 22 | { 23 | public final long[] bytes; 24 | public final long[] nsec; 25 | 26 | public Results(int numResults) 27 | { 28 | bytes = new long[numResults]; 29 | nsec = new long[numResults]; 30 | } 31 | 32 | public Results(long[] bytes, long[] nsec) 33 | { 34 | if (bytes.length != nsec.length) 35 | throw new IllegalArgumentException("length of bytes and nsec not identical"); 36 | this.bytes = bytes; 37 | this.nsec = nsec; 38 | } 39 | 40 | @Override 41 | public String toString() { 42 | return "Results [bytes=" + Arrays.toString(bytes) + ", nsec=" 43 | + Arrays.toString(nsec) + "]"; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/tcp/competences/BasicCompetence.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ***************************************************************************/ 16 | 17 | package at.rtr.rmbt.qos.testserver.tcp.competences; 18 | 19 | import java.io.BufferedReader; 20 | import java.io.IOException; 21 | import java.util.ArrayList; 22 | import java.util.List; 23 | 24 | import at.rtr.rmbt.qos.testserver.ClientHandler; 25 | 26 | /** 27 | * 28 | * @author lb@alladin.at 29 | * 30 | */ 31 | public class BasicCompetence implements Competence { 32 | 33 | @Override 34 | public boolean appliesTo(final String data) { 35 | return true; 36 | } 37 | 38 | @Override 39 | public List processRequest(final String data) { 40 | final List result = new ArrayList<>(); 41 | result.add(new ResponseAction(ClientHandler.getBytesWithNewline(new String(data)))); 42 | return result; 43 | } 44 | 45 | @Override 46 | public String readFullRequest(String firstLine, BufferedReader br) throws IOException { 47 | return firstLine; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/controlServer/server/ProxyEchoResult.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.controlServer.server; 18 | 19 | /** 20 | * 21 | * @author lb 22 | * 23 | */ 24 | public class ProxyEchoResult { 25 | private boolean success; 26 | 27 | private String message; 28 | 29 | /** 30 | * 31 | */ 32 | public ProxyEchoResult() { 33 | 34 | } 35 | 36 | /** 37 | * 38 | * @return 39 | */ 40 | public boolean isSuccess() { 41 | return success; 42 | } 43 | 44 | /** 45 | * 46 | * @param success 47 | */ 48 | public void setSuccess(boolean success) { 49 | this.success = success; 50 | } 51 | 52 | /** 53 | * 54 | * @return 55 | */ 56 | public String getMessage() { 57 | return message; 58 | } 59 | 60 | /** 61 | * 62 | * @param message 63 | */ 64 | public void setMessage(String message) { 65 | this.message = message; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/TestResult.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client; 18 | 19 | import java.net.InetAddress; 20 | import java.util.ArrayList; 21 | import java.util.List; 22 | 23 | public abstract class TestResult 24 | { 25 | public InetAddress ip_local; 26 | public InetAddress ip_server; 27 | public int port_remote; 28 | public int num_threads; 29 | public String encryption = "NONE"; 30 | 31 | public long ping_shortest; 32 | public long ping_median; 33 | public String client_version; 34 | 35 | public final List pings = new ArrayList(); 36 | 37 | public final List speedItems = new ArrayList(); 38 | 39 | public static long getSpeedBitPerSec(final long bytes, final long nsec) 40 | { 41 | return Math.round((double) bytes / (double) nsec * 1e9 * 8.0); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/qos/QoSMeasurementClientProgressAdapter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.client.qos; 18 | 19 | import at.rtr.rmbt.shared.qos.QosMeasurementType; 20 | import at.rtr.rmbt.client.v2.task.QoSTestEnum; 21 | 22 | public abstract class QoSMeasurementClientProgressAdapter implements QoSMeasurementClientProgressListener { 23 | 24 | @Override 25 | public void onProgress(float progress) { 26 | 27 | } 28 | 29 | @Override 30 | public void onQoSTypeProgress(QosMeasurementType qosType, float progress) { 31 | 32 | } 33 | 34 | @Override 35 | public void onQoSTypeStarted(QosMeasurementType qosType) { 36 | 37 | } 38 | 39 | @Override 40 | public void onQoSTypeFinished(QosMeasurementType qosType) { 41 | 42 | } 43 | 44 | @Override 45 | public void onQoSStatusChanged(QoSTestEnum newStatus) { 46 | 47 | } 48 | 49 | @Override 50 | public void onQoSTestsDefined(int testCount) { 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/OutputStreamCounter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client; 18 | 19 | import java.io.FilterOutputStream; 20 | import java.io.IOException; 21 | import java.io.OutputStream; 22 | 23 | public class OutputStreamCounter extends FilterOutputStream 24 | { 25 | private long count; 26 | 27 | public OutputStreamCounter(final OutputStream out) 28 | { 29 | super(out); 30 | } 31 | 32 | public long getCount() 33 | { 34 | return count; 35 | } 36 | 37 | @Override 38 | public void write(final byte[] buffer, final int offset, final int length) throws IOException 39 | { 40 | out.write(buffer, offset, length); 41 | count += length; 42 | } 43 | 44 | @Override 45 | public void write(final int oneByte) throws IOException 46 | { 47 | out.write(oneByte); 48 | count++; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/entity/ClientToken.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.qos.testserver.entity; 18 | 19 | /** 20 | * 21 | * @author lb 22 | * 23 | */ 24 | public class ClientToken { 25 | private final String uuid; 26 | private final long timeStamp; 27 | private final String hmac; 28 | 29 | /** 30 | * 31 | * @param uuid 32 | * @param timeStamp 33 | * @param hmac 34 | */ 35 | public ClientToken(String uuid, long timeStamp, String hmac) { 36 | this.uuid = uuid; 37 | this.timeStamp = timeStamp; 38 | this.hmac = hmac; 39 | } 40 | 41 | /** 42 | * 43 | * @return 44 | */ 45 | public String getUuid() { 46 | return uuid; 47 | } 48 | 49 | /** 50 | * 51 | * @return 52 | */ 53 | public long getTimeStamp() { 54 | return timeStamp; 55 | } 56 | 57 | /** 58 | * 59 | * @return 60 | */ 61 | public String getHmac() { 62 | return hmac; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /RMBTStatisticServer/src/at/rtr/rmbt/db/DbConnection.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.db; 18 | 19 | import java.sql.Connection; 20 | import java.sql.SQLException; 21 | 22 | import javax.naming.InitialContext; 23 | import javax.naming.NamingException; 24 | import javax.sql.DataSource; 25 | 26 | public class DbConnection 27 | { 28 | 29 | private static DataSource ds; 30 | 31 | private static void init() 32 | { 33 | DataSource _ds = null; 34 | try 35 | { 36 | _ds = (DataSource) new InitialContext().lookup("java:comp/env/jdbc/rmbtro"); 37 | } 38 | catch (final NamingException e) 39 | { 40 | } 41 | ds = _ds; 42 | } 43 | 44 | public static Connection getConnection() throws NamingException, SQLException 45 | { 46 | if (ds == null) { 47 | init(); 48 | } 49 | return ds.getConnection(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/controlServer/server/ProxyEchoRequest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.controlServer.server; 18 | 19 | /** 20 | * 21 | * @author lb 22 | * 23 | */ 24 | public class ProxyEchoRequest { 25 | 26 | /** 27 | * 28 | */ 29 | private final int port; 30 | 31 | private final int timeout; 32 | 33 | private final String message; 34 | 35 | /** 36 | * 37 | * @param port 38 | */ 39 | public ProxyEchoRequest(int port, int timeout, String message) { 40 | this.port = port; 41 | this.timeout = timeout; 42 | this.message = message; 43 | } 44 | 45 | /** 46 | * 47 | * @return 48 | */ 49 | public int getPort() { 50 | return port; 51 | } 52 | 53 | /** 54 | * 55 | * @return 56 | */ 57 | public int getTimeout() { 58 | return timeout; 59 | } 60 | 61 | /** 62 | * 63 | * @return 64 | */ 65 | public String getMessage() { 66 | return message; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /RMBTMapServer/src/at/rtr/rmbt/mapServer/DbConnection.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.mapServer; 18 | 19 | import java.sql.Connection; 20 | import java.sql.SQLException; 21 | 22 | import javax.naming.InitialContext; 23 | import javax.naming.NamingException; 24 | import javax.sql.DataSource; 25 | 26 | public class DbConnection 27 | { 28 | 29 | private static DataSource ds; 30 | 31 | private static void init() 32 | { 33 | DataSource _ds = null; 34 | try 35 | { 36 | _ds = (DataSource) new InitialContext().lookup("java:comp/env/jdbc/rmbtro"); 37 | } 38 | catch (final NamingException e) 39 | { 40 | } 41 | ds = _ds; 42 | } 43 | 44 | public static Connection getConnection() throws NamingException, SQLException 45 | { 46 | if (ds == null) { 47 | init(); 48 | } 49 | return ds.getConnection(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /RMBTSharedCode/src/at/rtr/rmbt/shared/cache/CacheContextListener.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.shared.cache; 18 | 19 | import javax.servlet.ServletContextEvent; 20 | import javax.servlet.ServletContextListener; 21 | 22 | public class CacheContextListener implements ServletContextListener 23 | { 24 | @Override 25 | public void contextInitialized(ServletContextEvent sce) 26 | { 27 | String addresses = sce.getServletContext().getInitParameter("RMBT_MEMCACHED_ADDRESSES"); 28 | if (addresses == null || addresses.isEmpty()) 29 | System.out.println("RMBT_MEMCACHED_ADDRESSES not set, cache deactivated"); 30 | else 31 | { 32 | System.out.println("init memcached with: " + addresses); 33 | CacheHelper.getInstance().initMemcached(addresses); 34 | } 35 | } 36 | 37 | @Override 38 | public void contextDestroyed(ServletContextEvent sce) 39 | { 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/Randomizer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util; 18 | 19 | import java.util.ArrayList; 20 | import java.util.Collections; 21 | import java.util.List; 22 | 23 | /** 24 | * 25 | * @author lb 26 | * 27 | */ 28 | public class Randomizer { 29 | 30 | private final List numberList; 31 | private int indexPointer; 32 | 33 | public Randomizer(int minValue, int maxValue) { 34 | this(minValue, maxValue, 1); 35 | } 36 | 37 | public Randomizer(int minValue, int maxValue, int step) { 38 | numberList = new ArrayList<>(maxValue - minValue); 39 | for (int i = minValue; i <= maxValue; i += step) { 40 | numberList.add(i); 41 | } 42 | Collections.shuffle(numberList); 43 | } 44 | 45 | public synchronized int next() { 46 | final int nextInt = numberList.get(indexPointer++); 47 | if (indexPointer >= numberList.size()) { 48 | indexPointer = 0; 49 | } 50 | return nextInt; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/model/shared/MapOptions.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util.model.shared; 18 | 19 | import java.io.Serializable; 20 | import java.util.List; 21 | 22 | import at.rtr.rmbt.util.model.option.ServerOption; 23 | 24 | import com.google.gson.annotations.Expose; 25 | import com.google.gson.annotations.SerializedName; 26 | 27 | public class MapOptions implements Serializable { 28 | 29 | /** 30 | * 31 | */ 32 | private static final long serialVersionUID = 1L; 33 | 34 | @Expose 35 | @SerializedName("map_filters") 36 | public List mapFilterList; 37 | 38 | public List getMapFilterList() { 39 | return mapFilterList; 40 | } 41 | 42 | public void setMapFilterList(List mapFilterList) { 43 | this.mapFilterList = mapFilterList; 44 | } 45 | 46 | @Override 47 | public String toString() { 48 | return "MapOptions [mapFilterList=" + mapFilterList + "]"; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/helper/IntermediateResult.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2015 alladin-IT GmbH 3 | * Copyright 2013-2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client.helper; 18 | 19 | public class IntermediateResult 20 | { 21 | public long pingNano; 22 | public long downBitPerSec; 23 | public long upBitPerSec; 24 | public TestStatus status; 25 | public float progress; 26 | public double downBitPerSecLog; 27 | public double upBitPerSecLog; 28 | public long remainingWait; 29 | 30 | public void setLogValues() 31 | { 32 | downBitPerSecLog = toLog(downBitPerSec); 33 | upBitPerSecLog = toLog(upBitPerSec); 34 | } 35 | 36 | public static double toLog(final long value) 37 | { 38 | if (value < 1e5) 39 | return 0; 40 | return (2d + Math.log10(value / 1e7)) / 4d; 41 | // value in bps 42 | // < 0.1 -> 0 43 | // 0.1 Mbps -> 0 44 | // 1000 Mbps -> 1 45 | // > 1000 Mbps -> >1 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/qos/testscript/ScriptException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.qos.testscript; 18 | 19 | /** 20 | * 21 | * @author lb 22 | * 23 | */ 24 | public class ScriptException extends Exception { 25 | 26 | public final static String ERROR_INVALID_ARGUMENT_COUNT = "TestScript - Invalid argument count: "; 27 | 28 | public final static String ERROR_BAD_ARGUMENTS = "TestScript - Bad arguments: "; 29 | 30 | public final static String ERROR_UNKNOWN = "TestScript - Unknown error: "; 31 | 32 | public final static String ERROR_PARSER_IS_NULL = "TestScript - HstoreParser must not be NULL in "; 33 | 34 | public final static String ERROR_RESULT_IS_NULL = "TestScript - AsbtractResult must not be NULL in "; 35 | 36 | /** 37 | * 38 | */ 39 | private static final long serialVersionUID = 1L; 40 | 41 | /** 42 | * 43 | * @param errMsg 44 | */ 45 | public ScriptException(String errMsg) { 46 | super(errMsg); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/test/java/at/rtr/rmbt/qos/testserver/mock/RecordingFilterOutputStreamMock.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.qos.testserver.mock; 18 | 19 | import java.io.ByteArrayOutputStream; 20 | import java.io.FilterOutputStream; 21 | import java.io.IOException; 22 | 23 | import mockit.Mock; 24 | import mockit.MockUp; 25 | 26 | /** 27 | * 28 | * @author Lukasz Budryk (lb@alladin.at) 29 | * 30 | */ 31 | public class RecordingFilterOutputStreamMock extends MockUp { 32 | 33 | final ByteArrayOutputStream baos; 34 | 35 | public RecordingFilterOutputStreamMock() { 36 | this.baos = new ByteArrayOutputStream(); 37 | } 38 | 39 | @Mock 40 | public void write(byte b[]) throws IOException { 41 | baos.write(b); 42 | } 43 | 44 | public String getContentWithoutReset() { 45 | return baos.toString(); 46 | } 47 | 48 | public String getContent() { 49 | final String content = baos.toString(); 50 | baos.reset(); 51 | return content; 52 | } 53 | 54 | public ByteArrayOutputStream getStream() { 55 | return baos; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /RMBTMapServer/src/at/rtr/rmbt/mapServer/ByteArrayOutputRepresentation.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.mapServer; 18 | 19 | import java.io.IOException; 20 | import java.io.OutputStream; 21 | import java.util.logging.Logger; 22 | 23 | import org.restlet.data.MediaType; 24 | import org.restlet.representation.OutputRepresentation; 25 | 26 | public class ByteArrayOutputRepresentation extends OutputRepresentation 27 | { 28 | private final byte[] data; 29 | 30 | public ByteArrayOutputRepresentation(byte[] data, MediaType mediaType) 31 | { 32 | super(mediaType); 33 | this.data = data; 34 | } 35 | 36 | @Override 37 | public void write(OutputStream s) throws IOException 38 | { 39 | try { 40 | s.write(data); 41 | } 42 | catch (IOException e) { 43 | Logger.getLogger(ByteArrayOutputRepresentation.class.getCanonicalName()).fine("Caught OutputRepresentation:IOException: " + e.getMessage()); 44 | } 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /RMBTClient/src/test/java/at/rtr/rmbt/client/RMBTClientTestStub.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2020 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.client; 18 | 19 | import at.rtr.rmbt.client.helper.ControlServerConnection; 20 | import at.rtr.rmbt.client.v2.task.TaskDesc; 21 | 22 | import java.util.List; 23 | 24 | public class RMBTClientTestStub extends RMBTClient { 25 | 26 | //constructor used for unit testing 27 | public static RMBTClient getInstance(final List taskDescList, final String collectorUrl) { 28 | //used for unit testing 29 | final ControlServerConnection controlConnection = new ControlServerConnection(); 30 | final RMBTTestParameter params = controlConnection.getTestParameter(null); 31 | 32 | 33 | RMBTClient rmbtClient = new RMBTClientTestStub(params, controlConnection); 34 | rmbtClient.taskDescList = taskDescList; 35 | return rmbtClient; 36 | } 37 | 38 | 39 | RMBTClientTestStub(RMBTTestParameter params, ControlServerConnection controlConnection) { 40 | super(params, controlConnection, true); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /RMBTSharedCode/src/at/rtr/rmbt/shared/qos/testscript/ScriptException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.shared.qos.testscript; 18 | 19 | /** 20 | * 21 | * @author lb 22 | * 23 | */ 24 | public class ScriptException extends Exception { 25 | 26 | public final static String ERROR_INVALID_ARGUMENT_COUNT = "TestScript - Invalid argument count: "; 27 | 28 | public final static String ERROR_BAD_ARGUMENTS = "TestScript - Bad arguments: "; 29 | 30 | public final static String ERROR_UNKNOWN = "TestScript - Unknown error: "; 31 | 32 | public final static String ERROR_PARSER_IS_NULL = "TestScript - HstoreParser must not be NULL in "; 33 | 34 | public final static String ERROR_RESULT_IS_NULL = "TestScript - AsbtractResult must not be NULL in "; 35 | 36 | /** 37 | * 38 | */ 39 | private static final long serialVersionUID = 1L; 40 | 41 | /** 42 | * 43 | * @param errMsg 44 | */ 45 | public ScriptException(String errMsg) { 46 | super(errMsg); 47 | } 48 | 49 | public ScriptException(final String errMsg, final Exception ex) { 50 | super(errMsg, ex); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/db/DbConnection.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2015 alladin-IT GmbH 3 | * Copyright 2013-2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.db; 18 | 19 | import java.sql.Connection; 20 | import java.sql.SQLException; 21 | 22 | import javax.naming.InitialContext; 23 | import javax.naming.NamingException; 24 | import javax.sql.DataSource; 25 | 26 | public class DbConnection 27 | { 28 | 29 | private static DataSource ds; 30 | 31 | private static void init() 32 | { 33 | DataSource _ds = null; 34 | try 35 | { 36 | _ds = (DataSource) new InitialContext().lookup("java:comp/env/jdbc/rmbt"); 37 | } 38 | catch (final NamingException e) 39 | { 40 | } 41 | ds = _ds; 42 | } 43 | 44 | public static Connection getConnection() throws NamingException, SQLException 45 | { 46 | if (ds == null) { 47 | init(); 48 | } 49 | final Connection connection = ds.getConnection(); 50 | connection.setAutoCommit(true); 51 | return connection; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/test/java/at/rtr/rmbt/qos/testserver/mock/ServerSocketMockup.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.qos.testserver.mock; 18 | 19 | import java.io.IOException; 20 | import java.net.ServerSocket; 21 | import java.net.Socket; 22 | import java.net.SocketAddress; 23 | 24 | import at.rtr.rmbt.qos.testserver.TestServerImpl; 25 | import mockit.Mock; 26 | import mockit.MockUp; 27 | 28 | /** 29 | * 30 | * @author Lukasz Budryk (lb@alladin.at) 31 | * 32 | */ 33 | public class ServerSocketMockup extends MockUp { 34 | 35 | public final TestServerImpl testServer; 36 | 37 | public SocketAddress endpoint; 38 | 39 | public ServerSocketMockup(final TestServerImpl ts) throws IOException { 40 | this.testServer = ts; 41 | } 42 | 43 | @Mock 44 | public boolean isBound() { 45 | return true; 46 | } 47 | 48 | @Mock 49 | public void bind(SocketAddress endpoint) throws IOException { 50 | this.endpoint = endpoint; 51 | } 52 | 53 | @Mock 54 | public boolean isClosed() { 55 | return false; 56 | } 57 | 58 | @Mock 59 | public Socket accept() throws IOException { 60 | return new Socket(); 61 | } 62 | } -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/net/sip/SipRequestMessage.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.util.net.sip; 18 | 19 | /** 20 | * 21 | * @author lb@alladin.at 22 | * 23 | */ 24 | public class SipRequestMessage extends SipMessage { 25 | 26 | public enum SipRequestType { 27 | INVITE, 28 | ACK, 29 | BYE 30 | } 31 | 32 | private SipRequestType type; 33 | 34 | public SipRequestMessage(final SipRequestType type) { 35 | this.type = type; 36 | } 37 | 38 | public SipRequestMessage(final SipRequestType type, final SipResponseMessage response) { 39 | this.type = type; 40 | this.setTo(response.getFrom()); 41 | this.setFrom(response.getTo()); 42 | this.setVia(response.getVia()); 43 | } 44 | 45 | public SipRequestType getType() { 46 | return type; 47 | } 48 | 49 | public void setType(SipRequestType type) { 50 | this.type = type; 51 | } 52 | 53 | @Override 54 | String getFirstLine() { 55 | return type.toString() + " " + getTo() + " " + SIP_PROTOCOL_STRING; 56 | } 57 | 58 | @Override 59 | public String toString() { 60 | return "SipRequestMessage [type=" + type + ", toString()=" + super.toString() + "]"; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/tools/ToolUtils.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util.tools; 18 | 19 | import java.io.BufferedReader; 20 | import java.io.File; 21 | import java.io.FileInputStream; 22 | import java.io.IOException; 23 | import java.io.InputStreamReader; 24 | 25 | public class ToolUtils { 26 | 27 | /** 28 | * 29 | * @param path 30 | * @param file 31 | * @return 32 | */ 33 | public static String readFromProc(String file) { 34 | BufferedReader br = null; 35 | StringBuilder sb = new StringBuilder(); 36 | 37 | File f = new File(file); 38 | try { 39 | br = new BufferedReader(new InputStreamReader(new FileInputStream(f))); 40 | String currInputLine = null; 41 | 42 | while((currInputLine = br.readLine()) != null) { 43 | sb.append(currInputLine); 44 | sb.append("\n"); 45 | } 46 | } 47 | catch (Exception e) { 48 | e.printStackTrace(); 49 | } 50 | finally { 51 | try { 52 | if (br != null) { 53 | br.close(); 54 | } 55 | } catch (IOException e) { } 56 | } 57 | 58 | return sb.toString(); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/tools/UdpConnectionInformation.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util.tools; 18 | 19 | /** 20 | * holder for udp connection information 21 | * @author lb 22 | * 23 | */ 24 | public class UdpConnectionInformation extends ConnectionInformation { 25 | 26 | /** 27 | * parses a linux /proc/net/ address string and returns an object 28 | * @param str 29 | * @param addrSize 30 | * @return 31 | */ 32 | public static UdpConnectionInformation parseAndroid(String str, int addrSize) { 33 | UdpConnectionInformation conn = new UdpConnectionInformation(); 34 | 35 | String[] token = str.trim().replaceAll(" +", " ").split(" "); 36 | if (token.length < 12) 37 | return null; 38 | 39 | try { 40 | conn.setLocalAddr(getAddress(addrSize, token[1])); 41 | conn.setConnectionState(ConnectionState.ESTABLISHED); 42 | conn.setProtocolType(addrSize == 16 ? ProtocolType.UDP6 : ProtocolType.UDP); 43 | conn.setUid(Integer.parseInt(token[7])); 44 | } 45 | catch (Exception e) { 46 | //return null in case of an exception 47 | return null; 48 | } 49 | 50 | return conn; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/tcp/competences/ResponseAction.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ***************************************************************************/ 16 | 17 | package at.rtr.rmbt.qos.testserver.tcp.competences; 18 | 19 | import java.io.FilterOutputStream; 20 | 21 | import at.rtr.rmbt.qos.testserver.tcp.TcpMultiClientServer; 22 | import at.rtr.rmbt.qos.testserver.util.TestServerConsole; 23 | import at.rtr.rmbt.qos.testserver.ServerPreferences.TestServerServiceEnum; 24 | import at.rtr.rmbt.qos.testserver.tcp.TcpClientHandler; 25 | 26 | public class ResponseAction implements Action { 27 | 28 | private final byte[] data; 29 | 30 | public ResponseAction(final byte[] data) { 31 | this.data = data; 32 | } 33 | 34 | public byte[] getData() { 35 | return data; 36 | } 37 | 38 | @Override 39 | public boolean execute(final TcpClientHandler tcpClientHandler, final byte[] requestData, FilterOutputStream os) { 40 | if (data != null) { 41 | try { 42 | os.write(data); 43 | os.flush(); 44 | return true; 45 | } 46 | catch (final Exception e) { 47 | TestServerConsole.error("ResponseAction error!", e, 48 | TcpMultiClientServer.VERBOSE_LEVEL_REQUEST_RESPONSE, TestServerServiceEnum.TCP_SERVICE); 49 | } 50 | } 51 | return false; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/tools/TracerouteService.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 Specure GmbH 3 | * Copyright 2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util.tools; 18 | 19 | import java.io.IOException; 20 | import java.util.List; 21 | import java.util.Map; 22 | import java.util.concurrent.Callable; 23 | 24 | import org.json.JSONObject; 25 | 26 | import at.rtr.rmbt.util.tools.TracerouteService.HopDetail; 27 | 28 | public interface TracerouteService extends Callable> { 29 | 30 | public static final class PingException extends IOException { 31 | 32 | /** 33 | * 34 | */ 35 | private static final long serialVersionUID = 1L; 36 | 37 | public PingException(String msg) { 38 | super(msg); 39 | } 40 | } 41 | 42 | public interface HopDetail { 43 | public JSONObject toJson(); 44 | public Map toMap(); 45 | public Map toMap(boolean masked); 46 | } 47 | 48 | public String getHost(); 49 | 50 | public void setHost(String host); 51 | 52 | public void setResultListObject(List resultList); 53 | 54 | public int getMaxHops(); 55 | 56 | public void setMaxHops(int maxHops); 57 | 58 | public boolean hasMaxHopsExceeded(); 59 | } 60 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/SpeedItem.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2015 alladin-IT GmbH 3 | * Copyright 2013-2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client; 18 | 19 | import org.json.JSONException; 20 | import org.json.JSONObject; 21 | 22 | public class SpeedItem 23 | { 24 | public final boolean upload; 25 | public final int thread; 26 | public final long time; 27 | public final long bytes; 28 | 29 | public SpeedItem(final boolean upload, final int thread, final long time, final long bytes) 30 | { 31 | this.upload = upload; 32 | this.thread = thread; 33 | this.time = time; 34 | this.bytes = bytes; 35 | } 36 | 37 | public JSONObject toJSON() throws JSONException 38 | { 39 | final JSONObject result = new JSONObject(); 40 | result.put("direction", upload ? "upload" : "download"); 41 | result.put("thread", thread); 42 | result.put("time", time); 43 | result.put("bytes", bytes); 44 | return result; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return "SpeedItem [upload=" + upload + ", thread=" + thread + ", time=" 50 | + time + ", bytes=" + bytes + "]"; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/test/java/at/rtr/rmbt/qos/testserver/rules/RepeatRule.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.qos.testserver.rules; 18 | 19 | import org.junit.rules.TestRule; 20 | import org.junit.runner.Description; 21 | import org.junit.runners.model.Statement; 22 | 23 | /** 24 | * 25 | * @author Lukasz Budryk (lb@alladin.at) 26 | * 27 | */ 28 | public class RepeatRule implements TestRule { 29 | 30 | private static class RepeatStatement extends Statement { 31 | 32 | private final int times; 33 | private final Statement statement; 34 | 35 | private RepeatStatement( int times, Statement statement ) { 36 | this.times = times; 37 | this.statement = statement; 38 | } 39 | 40 | @Override 41 | public void evaluate() throws Throwable { 42 | for( int i = 0; i < times; i++ ) { 43 | statement.evaluate(); 44 | } 45 | } 46 | } 47 | 48 | @Override 49 | public Statement apply( Statement statement, Description description ) { 50 | Statement result = statement; 51 | Repeat repeat = description.getAnnotation( Repeat.class ); 52 | if( repeat != null ) { 53 | int times = repeat.value(); 54 | result = new RepeatStatement( times, statement ); 55 | } 56 | return result; 57 | } 58 | } -------------------------------------------------------------------------------- /RMBTMapServer/src/at/rtr/rmbt/mapServer/VersionResource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2015 alladin-IT GmbH 3 | * Copyright 2013-2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.mapServer; 18 | 19 | import org.json.JSONException; 20 | import org.json.JSONObject; 21 | import org.restlet.data.Parameter; 22 | import org.restlet.resource.Get; 23 | import org.restlet.util.Series; 24 | 25 | import at.rtr.rmbt.shared.RevisionHelper; 26 | 27 | public class VersionResource extends ServerResource 28 | { 29 | @Get("json") 30 | public String request(final String entity) 31 | { 32 | addAllowOrigin(); 33 | try 34 | { 35 | final JSONObject answer = new JSONObject(); 36 | answer.put("version", RevisionHelper.getVerboseRevision()); 37 | answer.put("system_UUID", getSetting("system_UUID","")); 38 | final Series ctxParams = getContext().getParameters(); 39 | final String hostId = ctxParams.getFirstValue("HOST_ID"); 40 | if (hostId != null) 41 | answer.put("host",hostId); 42 | return answer.toString(); 43 | } 44 | catch (JSONException e) 45 | { 46 | e.printStackTrace(); 47 | return null; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/tcp/competences/SleepAction.java: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ***************************************************************************/ 16 | 17 | package at.rtr.rmbt.qos.testserver.tcp.competences; 18 | 19 | import java.io.FilterOutputStream; 20 | 21 | import at.rtr.rmbt.qos.testserver.util.TestServerConsole; 22 | import at.rtr.rmbt.qos.testserver.ServerPreferences.TestServerServiceEnum; 23 | import at.rtr.rmbt.qos.testserver.tcp.TcpClientHandler; 24 | import at.rtr.rmbt.qos.testserver.tcp.TcpMultiClientServer; 25 | 26 | /** 27 | * 28 | * @author lb 29 | * 30 | */ 31 | public class SleepAction implements Action { 32 | 33 | private final long sleepMillis; 34 | 35 | public SleepAction(final long sleepMillis) { 36 | this.sleepMillis = sleepMillis; 37 | } 38 | 39 | public long getSleepMillis() { 40 | return sleepMillis; 41 | } 42 | 43 | @Override 44 | public boolean execute(final TcpClientHandler tcpClientHandler, final byte[] requestData, FilterOutputStream os) { 45 | try { 46 | Thread.sleep(sleepMillis); 47 | return true; 48 | } 49 | catch (final Exception e) { 50 | TestServerConsole.error("SleepAction error (sleepMillis: " + sleepMillis + ")", e, 51 | TcpMultiClientServer.VERBOSE_LEVEL_REQUEST_RESPONSE, TestServerServiceEnum.TCP_SERVICE); 52 | } 53 | 54 | return false; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /RMBTSharedCode/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | tasks.withType(JavaCompile) { 4 | options.encoding = "UTF-8" 5 | } 6 | 7 | //http://stackoverflow.com/questions/13925724/providedcompile-without-war-plugin 8 | configurations { providedCompile } 9 | sourceSets.main.compileClasspath += configurations.providedCompile 10 | sourceSets.test.compileClasspath += configurations.providedCompile 11 | sourceSets.test.runtimeClasspath += configurations.providedCompile 12 | 13 | sourceCompatibility = 1.8 14 | 15 | repositories { 16 | mavenCentral() 17 | } 18 | 19 | 20 | dependencies { 21 | testCompile group: 'junit', name: 'junit', version: '4.11' 22 | compile group: 'dnsjava', name: 'dnsjava', version: '2.1.7' 23 | compile group: 'net.spy', name: 'spymemcached', version: '2.12.1' 24 | compile group: 'joda-time', name: 'joda-time', version: '2.9.7' 25 | testCompile group: 'junit', name: 'junit', version: '4.11' 26 | compile group: 'org.postgresql', name: 'postgresql', version: '42.2.18' 27 | compile group: 'com.google.guava', name: 'guava', version: '20.0' 28 | providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: "$servletVersion" 29 | compile "org.json:json:$jsonVersion" 30 | compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0' 31 | compile group: 'com.github.jknack', name: 'handlebars', version: '4.1.2' 32 | 33 | compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: "$jacksonVersion" 34 | // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind 35 | compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "$jacksonVersion" 36 | compile 'com.maxmind.geoip2:geoip2:2.15.0' 37 | compile 'io.swagger:swagger-annotations:1.5.15' 38 | } 39 | 40 | sourceSets { 41 | main { 42 | java { srcDir 'src' } 43 | resources { srcDir 'src' } 44 | } 45 | } 46 | 47 | //processResources { 48 | // from ('src') { 49 | // include '**/*.properties' 50 | // include '**/*.csv' 51 | // } 52 | //} -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/plugin/rest/RestletApplication.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 Specure GmbH 3 | * Copyright 2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.qos.testserver.plugin.rest; 18 | 19 | import org.json.JSONException; 20 | import org.json.JSONObject; 21 | import org.restlet.Application; 22 | import org.restlet.Restlet; 23 | import org.restlet.resource.Get; 24 | import org.restlet.resource.ServerResource; 25 | import org.restlet.routing.Router; 26 | 27 | /** 28 | * 29 | * @author lb 30 | * 31 | */ 32 | public class RestletApplication extends Application { 33 | 34 | @Override 35 | public Restlet createInboundRoot() { 36 | 37 | Router router = new Router(getContext()); 38 | router.attach("/", StatusResource.class); 39 | router.attach("/info/{type}", InfoResource.class); 40 | router.attach("/info", InfoResource.class); 41 | router.attachDefault(ErrorHandlerResource.class); 42 | return router; 43 | } 44 | 45 | public final static class ErrorHandlerResource extends ServerResource { 46 | 47 | @Get 48 | public String request() throws JSONException { 49 | JSONObject json = new JSONObject(); 50 | RestService.addError(json, "resource not found"); 51 | return json.toString(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/VersionResource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2016 alladin-IT GmbH 3 | * Copyright 2013-2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.statisticServer; 18 | 19 | import org.json.JSONException; 20 | import org.json.JSONObject; 21 | import org.restlet.data.Parameter; 22 | import org.restlet.resource.Get; 23 | import org.restlet.util.Series; 24 | 25 | import at.rtr.rmbt.shared.RevisionHelper; 26 | 27 | public class VersionResource extends ServerResource 28 | { 29 | @Get("json") 30 | public String request(final String entity) 31 | { 32 | addAllowOrigin(); 33 | try 34 | { 35 | final JSONObject answer = new JSONObject(); 36 | answer.put("version", RevisionHelper.getVerboseRevision()); 37 | answer.put("system_UUID", getSetting("system_UUID","")); 38 | final Series ctxParams = getContext().getParameters(); 39 | final String hostId = ctxParams.getFirstValue("HOST_ID"); 40 | if (hostId != null) 41 | answer.put("host",hostId); 42 | return answer.toString(); 43 | } 44 | catch (JSONException e) 45 | { 46 | e.printStackTrace(); 47 | return null; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/v2/task/result/QoSResultCollector.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client.v2.task.result; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | import org.json.JSONArray; 23 | import org.json.JSONObject; 24 | 25 | /** 26 | * collects all test results 27 | * @author lb 28 | * 29 | */ 30 | public class QoSResultCollector { 31 | private List results = new ArrayList<>(); 32 | 33 | private String testToken; 34 | 35 | /** 36 | * 37 | * @return 38 | */ 39 | public List getResults() { 40 | return results; 41 | } 42 | 43 | public String getTestToken() { 44 | return testToken; 45 | } 46 | 47 | public void setTestToken(String testToken) { 48 | this.testToken = testToken; 49 | } 50 | 51 | /** 52 | * 53 | * @param results 54 | */ 55 | public void setResults(List results) { 56 | this.results = results; 57 | } 58 | 59 | /** 60 | * 61 | * @return 62 | */ 63 | public JSONArray toJson() { 64 | JSONArray json = null; 65 | json = new JSONArray(); 66 | for (QoSTestResult result : results) { 67 | json.put(new JSONObject(result.getResultMap())); 68 | } 69 | return json; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/controlServer/VersionResource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2015 alladin-IT GmbH 3 | * Copyright 2013-2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.controlServer; 18 | 19 | 20 | import org.json.JSONException; 21 | import org.json.JSONObject; 22 | import org.restlet.data.Parameter; 23 | import org.restlet.resource.Get; 24 | import org.restlet.util.Series; 25 | 26 | import at.rtr.rmbt.shared.RevisionHelper; 27 | 28 | public class VersionResource extends ServerResource 29 | { 30 | @Get("json") 31 | public String request(final String entity) 32 | { 33 | addAllowOrigin(); 34 | try 35 | { 36 | final JSONObject answer = new JSONObject(); 37 | answer.put("version", RevisionHelper.getVerboseRevision()); 38 | answer.put("system_UUID", getSetting("system_UUID","")); 39 | final Series ctxParams = getContext().getParameters(); 40 | final String hostId = ctxParams.getFirstValue("HOST_ID"); 41 | if (hostId != null) 42 | answer.put("host",hostId); 43 | 44 | return answer.toString(); 45 | } 46 | catch (JSONException e) 47 | { 48 | e.printStackTrace(); 49 | return null; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /RMBTSharedCode/src/at/rtr/rmbt/shared/qos/UdpPayload.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.shared.qos; 18 | 19 | public class UdpPayload { 20 | 21 | private int communicationFlag; 22 | 23 | private int packetNumber; 24 | 25 | private String uuid; 26 | 27 | private Long timestamp; 28 | 29 | public int getCommunicationFlag() { 30 | return communicationFlag; 31 | } 32 | 33 | public void setCommunicationFlag(int communicationFlag) { 34 | this.communicationFlag = communicationFlag; 35 | } 36 | 37 | public int getPacketNumber() { 38 | return packetNumber; 39 | } 40 | 41 | public void setPacketNumber(int packetNumber) { 42 | this.packetNumber = packetNumber; 43 | } 44 | 45 | public String getUuid() { 46 | return uuid; 47 | } 48 | 49 | public void setUuid(String uuid) { 50 | this.uuid = uuid; 51 | } 52 | 53 | public Long getTimestamp() { 54 | return timestamp; 55 | } 56 | 57 | public void setTimestamp(Long timestamp) { 58 | this.timestamp = timestamp; 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return "UdpPayload [communicationFlag=" + communicationFlag + ", packetNumber=" + packetNumber + ", uuid=" 64 | + uuid + ", timestamp=" + timestamp + "]"; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /RMBTUtil/src/main/java/at/rtr/rmbt/util/tools/TcpConnectionInformation.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2015 alladin-IT GmbH 3 | * Copyright 2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.util.tools; 18 | 19 | /** 20 | * holder for tcp connection information 21 | * @author lb 22 | * 23 | */ 24 | public class TcpConnectionInformation extends ConnectionInformation { 25 | 26 | /** 27 | * parses a linux /proc/net/ address string and returns an object 28 | * @param str 29 | * @param addrSize 30 | * @return 31 | */ 32 | public static TcpConnectionInformation parseAndroid(String str, int addrSize) { 33 | TcpConnectionInformation conn = new TcpConnectionInformation(); 34 | 35 | String[] token = str.trim().replaceAll(" +", " ").split(" "); 36 | if (token.length < 12) 37 | return null; 38 | 39 | try { 40 | System.out.println(str); 41 | System.out.println(token[1]); 42 | System.out.println(token[2]); 43 | conn.setLocalAddr(getAddress(addrSize, token[1])); 44 | conn.setRemoteAddr(getAddress(addrSize, token[2])); 45 | conn.setConnectionState(ConnectionState.values()[Integer.parseInt(token[3], 16)]); 46 | conn.setProtocolType(addrSize == 16 ? ProtocolType.TCP6 : ProtocolType.TCP); 47 | } 48 | catch (Exception e) { 49 | //return null in case of an exception 50 | return null; 51 | } 52 | 53 | return conn; 54 | } 55 | } 56 | 57 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/v2/task/QoSTask.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2015 alladin-IT GmbH 3 | * Copyright 2013-2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client.v2.task; 18 | 19 | import java.util.concurrent.Callable; 20 | 21 | import at.rtr.rmbt.shared.qos.QosMeasurementType; 22 | import at.rtr.rmbt.client.v2.task.result.QoSTestResult; 23 | 24 | /** 25 | * 26 | * @author lb 27 | * 28 | */ 29 | public interface QoSTask extends Callable, Comparable { 30 | 31 | /** 32 | * 33 | * @return 34 | */ 35 | public TaskDesc getTaskDesc(); 36 | 37 | /** 38 | * 39 | * @return 40 | */ 41 | public int getPriority(); 42 | 43 | /** 44 | * 45 | * @return 46 | */ 47 | public long getQoSObjectiveTestId(); 48 | 49 | /** 50 | * 51 | * @return 52 | */ 53 | public int getTestServerPort(); 54 | 55 | /** 56 | * 57 | * @return 58 | */ 59 | public int getConcurrencyGroup(); 60 | 61 | /** 62 | * 63 | * @return 64 | */ 65 | public String getTestServerAddr(); 66 | 67 | /** 68 | * 69 | * @return 70 | */ 71 | public QosMeasurementType getTestType(); 72 | 73 | /** 74 | * 75 | * @return 76 | */ 77 | public boolean needsQoSControlConnection(); 78 | 79 | /** 80 | * kill the QoSTask, if the task needs specific cleanup 81 | */ 82 | public void interrupt(); 83 | } 84 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/test/java/at/rtr/rmbt/qos/testserver/mock/DataInputStreamMockup.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2019 alladin-IT GmbH 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | ******************************************************************************/ 16 | 17 | package at.rtr.rmbt.qos.testserver.mock; 18 | 19 | import java.io.DataInputStream; 20 | import java.io.IOException; 21 | import java.util.concurrent.atomic.AtomicInteger; 22 | 23 | import mockit.Mock; 24 | import mockit.MockUp; 25 | 26 | /** 27 | * 28 | * @author Lukasz Budryk (lb@alladin.at) 29 | * 30 | */ 31 | public class DataInputStreamMockup extends MockUp { 32 | 33 | private final String[] messages; 34 | 35 | private final AtomicInteger indexAvailable = new AtomicInteger(0); 36 | 37 | private final AtomicInteger index = new AtomicInteger(0); 38 | 39 | public DataInputStreamMockup(final String[] messages) throws IOException { 40 | this.messages = messages; 41 | } 42 | 43 | @Mock 44 | public int available() throws IOException { 45 | if (indexAvailable.get() >= messages.length) { 46 | return -1; 47 | } 48 | final String msg = messages[indexAvailable.getAndAdd(1)]; 49 | return msg.length(); 50 | } 51 | 52 | @Mock 53 | public int read(byte b[]) throws IOException { 54 | if (index.get() >= messages.length) { 55 | return -1; 56 | } 57 | final byte[] msg = messages[index.getAndAdd(1)].getBytes(); 58 | System.arraycopy(msg, 0, b, 0, msg.length); 59 | return msg.length; 60 | } 61 | 62 | } -------------------------------------------------------------------------------- /install/postgresql/3rd_party_open_data/admin_0_countries/get_admin_0_countries.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #/******************************************************************************* 3 | # * Copyright 2022 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | # * 5 | # * Licensed under the Apache License, Version 2.0 (the "License"); 6 | # * you may not use this file except in compliance with the License. 7 | # * You may obtain a copy of the License at 8 | # * 9 | # * http://www.apache.org/licenses/LICENSE-2.0 10 | # * 11 | # * Unless required by applicable law or agreed to in writing, software 12 | # * distributed under the License is distributed on an "AS IS" BASIS, 13 | # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # * See the License for the specific language governing permissions and 15 | # * limitations under the License. 16 | # ******************************************************************************/ 17 | set -x 18 | export LANG=C 19 | 20 | # import country boarders from https://www.naturalearthdata.com 21 | 22 | # 23 | # https://www.naturalearthdata.com/downloads/10m-cultural-vectors/ 24 | # 25 | # latest release 5.1.1, with boundary lakes 26 | URL=https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_countries_lakes.zip 27 | 28 | # name of postgres table 29 | TABLE=admin_0_countries 30 | 31 | # create tmp dir (remains after finalization) 32 | mkdir -p ~/open/$TABLE 33 | cd ~/open/$TABLE && rm * 34 | 35 | wget $URL -O $TABLE.zip 36 | unzip -o $TABLE.zip 37 | # rm $TABLE.zip 38 | SHP=$(ls *.shp) 39 | 40 | # import as table statistik_austria_gem (takes some time) 41 | # -I create geo index 42 | # -s data is WGS84 => EPSG4326 43 | # -d drop table if it exists 44 | # -W encoding - eg. LATIN1 (not used, is in UTF8) 45 | shp2pgsql -I -s 4326 -d $SHP $TABLE | psql rmbt > /dev/null 46 | 47 | # final fixup (owner, permissions etc.) 48 | sql=$(cat < code 31287 52 | # -d drop table if it exists 53 | # -W encoding LATIN1 54 | shp2pgsql -I -s 31287 -d $SHP.shp $DB | psql rmbt > /dev/null 55 | 56 | 57 | sql=$(cat < valueList, final int index, final int dataAmount); 36 | 37 | /** 38 | * 39 | * @param valueList 40 | * @param index 41 | * @param dataAmount 42 | * @return 43 | */ 44 | double smoothYPoint(final List valueList, final int index, final int dataAmount); 45 | 46 | /** 47 | * index of the possible first point that can be calculated with this smoothing function 48 | * @param valueList 49 | * @param dataAmount 50 | * @return 51 | */ 52 | int getStartingIndex(final List valueList, final int dataAmount); 53 | 54 | /** 55 | * index of the possible last point that can be calculated with this smoothing function 56 | * @param valueList 57 | * @param dataAmount 58 | * @return 59 | */ 60 | int getEndingIndex(final List valueList, final int dataAmount); 61 | } -------------------------------------------------------------------------------- /RMBTControlServer/src/at/rtr/rmbt/db/dao/DaoUtil.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.db.dao; 18 | 19 | import java.sql.PreparedStatement; 20 | import java.sql.SQLException; 21 | 22 | /** 23 | * 24 | * @author lb 25 | * 26 | */ 27 | public class DaoUtil { 28 | 29 | /** 30 | * 31 | * @param length 32 | * @return 33 | */ 34 | public static String preparePlaceHolders(int length) { 35 | StringBuilder builder = new StringBuilder(); 36 | for (int i = 0; i < length;) { 37 | builder.append("?"); 38 | if (++i < length) { 39 | builder.append(","); 40 | } 41 | } 42 | return builder.toString(); 43 | } 44 | 45 | /** 46 | * 47 | * @param preparedStatement 48 | * @param values 49 | * @throws SQLException 50 | */ 51 | public static void setStrings(PreparedStatement preparedStatement, String... values) throws SQLException { 52 | setStrings(preparedStatement, 1, values); 53 | } 54 | 55 | /** 56 | * 57 | * @param preparedStatement 58 | * @param start 59 | * @param values 60 | * @throws SQLException 61 | */ 62 | public static void setStrings(PreparedStatement preparedStatement, int start, String... values) throws SQLException { 63 | for (int i = 0; i < values.length; i++) { 64 | preparedStatement.setString(start + i, values[i]); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /RMBTStatisticServer/src/at/rtr/rmbt/statisticServer/opendata/dto/OpenTestGraphDTO.java: -------------------------------------------------------------------------------- 1 | package at.rtr.rmbt.statisticServer.opendata.dto; 2 | 3 | 4 | import io.swagger.annotations.ApiModelProperty; 5 | 6 | import java.util.*; 7 | 8 | public class OpenTestGraphDTO { 9 | 10 | private List download = new ArrayList<>(); 11 | private List upload = new ArrayList<>(); 12 | private List ping = new ArrayList<>(); 13 | private List signal = new ArrayList<>(); 14 | private List location = new ArrayList<>(); 15 | 16 | 17 | @ApiModelProperty(value = "Measurements of downloaded bytes at various times during the test.") 18 | public List getDownload() { 19 | return download; 20 | } 21 | 22 | public void setDownload(List download) { 23 | this.download = download; 24 | } 25 | 26 | @ApiModelProperty(value = "Measurements of uploaded bytes at various times during the test.") 27 | public List getUpload() { 28 | return upload; 29 | } 30 | 31 | public void setUpload(List upload) { 32 | this.upload = upload; 33 | } 34 | 35 | @ApiModelProperty(value = "The client’s pings throughout the test") 36 | public List getPing() { 37 | return ping; 38 | } 39 | 40 | public void setPing(List ping) { 41 | this.ping = ping; 42 | } 43 | 44 | @ApiModelProperty(value = "Measurements of signal strength and network type at various times during the test.") 45 | public List getSignal() { 46 | return signal; 47 | } 48 | 49 | public void setSignal(List signal) { 50 | this.signal = signal; 51 | } 52 | 53 | @ApiModelProperty(value = "The client’s locations throughout the test.") 54 | public List getLocation() { 55 | return location; 56 | } 57 | 58 | public void setLocation(List location) { 59 | this.location = location; 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /RMBTMapServer/src/at/rtr/rmbt/mapServer/MapServer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2015 alladin-IT GmbH 3 | * Copyright 2013-2015 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.mapServer; 18 | 19 | import org.restlet.Application; 20 | import org.restlet.Restlet; 21 | import org.restlet.routing.Router; 22 | 23 | public class MapServer extends Application 24 | { 25 | @Override 26 | public Restlet createInboundRoot() 27 | { 28 | final Router router = new Router(getContext()); 29 | 30 | router.attach("/version", VersionResource.class); 31 | 32 | final PointTiles pointTiles = new PointTiles(); 33 | router.attach("/tiles/points/{zoom}/{x}/{y}.png", pointTiles); 34 | router.attach("/tiles/points", pointTiles); 35 | 36 | final HeatmapTiles heatmapTiles = new HeatmapTiles(); 37 | router.attach("/tiles/heatmap/{zoom}/{x}/{y}.png", heatmapTiles); 38 | router.attach("/tiles/heatmap", heatmapTiles); 39 | 40 | final ShapeTiles shapeTiles = new ShapeTiles(); 41 | router.attach("/tiles/shapes/{zoom}/{x}/{y}.png", shapeTiles); 42 | router.attach("/tiles/shapes", shapeTiles); 43 | 44 | router.attach("/tiles/markers", MarkerResource.class); 45 | 46 | router.attach("/tiles/info", InfoResource.class); 47 | router.attach("/v2/tiles/info", at.rtr.rmbt.mapServer.v2.InfoResource.class); 48 | 49 | return router; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /RMBTQoSServer/src/main/java/at/rtr/rmbt/qos/testserver/plugin/rest/StatusResource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2016 Specure GmbH 3 | * Copyright 2016 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *******************************************************************************/ 17 | package at.rtr.rmbt.qos.testserver.plugin.rest; 18 | 19 | import org.json.JSONArray; 20 | import org.json.JSONException; 21 | import org.json.JSONObject; 22 | import org.restlet.data.Status; 23 | import org.restlet.resource.Get; 24 | import org.restlet.resource.ServerResource; 25 | 26 | import at.rtr.rmbt.qos.testserver.TestServer; 27 | import at.rtr.rmbt.qos.testserver.util.TestServerConsole; 28 | import at.rtr.rmbt.qos.testserver.util.TestServerConsole.ErrorReport; 29 | 30 | /** 31 | * 32 | * @author lb 33 | * 34 | */ 35 | public class StatusResource extends ServerResource { 36 | 37 | @Get 38 | public String request() throws JSONException { 39 | JSONObject json = new JSONObject(); 40 | 41 | json.put("starttime", TestServer.getInstance().serverPreferences.getStartTimestamp()); 42 | json.put("version", TestServer.TEST_SERVER_VERSION_MAJOR + "." + TestServer.TEST_SERVER_VERSION_MINOR + "." + TestServer.TEST_SERVER_VERSION_PATCH); 43 | 44 | if (TestServerConsole.errorReportMap.size() > 0) { 45 | setStatus(Status.SERVER_ERROR_INTERNAL); 46 | 47 | JSONArray errors = new JSONArray(); 48 | for (ErrorReport er : TestServerConsole.errorReportMap.values()) { 49 | errors.put(er.toJson()); 50 | } 51 | 52 | json.put("errors", errors); 53 | } 54 | 55 | return json.toString(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /RMBTMapServer/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenCentral() 4 | } 5 | } 6 | 7 | apply plugin: 'war' 8 | sourceCompatibility = '1.8' 9 | 10 | tasks.withType(JavaCompile) { 11 | options.encoding = "UTF-8" 12 | } 13 | 14 | project.webAppDirName = 'WebContent' 15 | 16 | repositories { 17 | mavenCentral() 18 | maven{url 'http://maven.restlet.com'} 19 | maven{url 'https://oss.sonatype.org/content/repositories/snapshots/'} 20 | } 21 | 22 | sourceSets { 23 | main { 24 | java { srcDir 'src' } 25 | resources { srcDir 'src' } 26 | } 27 | } 28 | 29 | subprojects{ 30 | evaluationDependsOn(':RMBTSharedCode') 31 | evaluationDependsOn(':RMBTUtil') 32 | } 33 | 34 | dependencies { 35 | providedCompile "org.apache.tomcat:tomcat-catalina:$catalinaVersion" 36 | providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version: "$servletVersion" 37 | compile "org.json:json:$jsonVersion" 38 | compile "org.restlet.jse:org.restlet.ext.json:$restletVersion" 39 | compile "org.restlet.jee:org.restlet.ext.servlet:$restletVersion" 40 | compile 'org.postgis:postgis-jdbc:1.3.3' 41 | compile(group: 'net.bull.javamelody', name: 'javamelody-core', version: "$javaMelodyVersion") 42 | compile project(':RMBTSharedCode') 43 | compile project(':RMBTUtil') 44 | } 45 | 46 | 47 | war { 48 | exclude 'WEB-INF/lib/**' 49 | exclude 'WEB-INF/classes/**' 50 | exclude 'META-INF/context.xml' 51 | from(buildDir){ 52 | into('META-INF') 53 | include 'context.xml' 54 | } 55 | } 56 | 57 | 58 | def revisionPropertiesFile = file("${buildDir}/resources/main/revision.properties") 59 | processResources { 60 | doLast { 61 | String revisionProperties = "git.describe=" + getVersionNameFromGit() + "\n" 62 | revisionProperties = revisionProperties + "git.branch=" + getBranchFromGit() + "\n" 63 | revisionProperties = revisionProperties + "git.dirty=" + getDirtyFromGit() + "\n" 64 | revisionProperties = revisionProperties + "git.id=" + getHashFromGit() + "\n" 65 | revisionProperties = revisionProperties + "git.revision=" + getVersionCodeFromGit() + "\n" 66 | revisionPropertiesFile.write(revisionProperties, 'UTF-8') 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /RMBTClient/src/main/java/at/rtr/rmbt/client/v2/task/result/QoSServerResultTestDesc.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright 2013-2014 alladin-IT GmbH 3 | * Copyright 2013-2014 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | ******************************************************************************/ 17 | package at.rtr.rmbt.client.v2.task.result; 18 | 19 | import java.io.Serializable; 20 | 21 | import at.rtr.rmbt.shared.qos.QosMeasurementType; 22 | 23 | /** 24 | * 25 | * @author lb 26 | * 27 | */ 28 | public class QoSServerResultTestDesc implements Serializable { 29 | 30 | /** 31 | * 32 | */ 33 | private static final long serialVersionUID = 1L; 34 | 35 | private QosMeasurementType resultType; 36 | private String description; 37 | private String name; 38 | 39 | public QoSServerResultTestDesc(QosMeasurementType type, String description, String name) { 40 | this.resultType = type; 41 | this.description = description; 42 | this.name = name; 43 | } 44 | 45 | public QosMeasurementType getResultType() { 46 | return resultType; 47 | } 48 | public void setResultType(QosMeasurementType resultType) { 49 | this.resultType = resultType; 50 | } 51 | public String getDescription() { 52 | return description; 53 | } 54 | public void setDescription(String description) { 55 | this.description = description; 56 | } 57 | public String getName() { 58 | return name; 59 | } 60 | public void setName(String name) { 61 | this.name = name; 62 | } 63 | 64 | @Override 65 | public String toString() { 66 | return "QoSServerResultTestDesc [resultType=" + resultType 67 | + ", description=" + description + ", name=" + name + "]"; 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /install/postgresql/3rd_party_open_data/coverage/get_cov_bb_fixed.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #/******************************************************************************* 3 | # * Copyright 2019 Rundfunk und Telekom Regulierungs-GmbH (RTR-GmbH) 4 | # * 5 | # * Licensed under the Apache License, Version 2.0 (the "License"); 6 | # * you may not use this file except in compliance with the License. 7 | # * You may obtain a copy of the License at 8 | # * 9 | # * http://www.apache.org/licenses/LICENSE-2.0 10 | # * 11 | # * Unless required by applicable law or agreed to in writing, software 12 | # * distributed under the License is distributed on an "AS IS" BASIS, 13 | # * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # * See the License for the specific language governing permissions and 15 | # * limitations under the License. 16 | # ******************************************************************************/ 17 | 18 | set -x 19 | export LANG=C 20 | 21 | # Import open data fixed network coverage information 22 | 23 | # Open data site: 24 | # https://www.data.gv.at/katalog/dataset/breitbandatlas 25 | # current release 26 | URL=https://www.data.gv.at/katalog/dataset/588b9fdc-d2dd-4628-b186-f7b974065d40/resource/8ef9c0a4-f1ef-4b5b-96ec-ce1da03c35c5/download/festnetz_2020q4_20210429.zip 27 | # old releases: 28 | # URL=https://www.data.gv.at/katalog/dataset/588b9fdc-d2dd-4628-b186-f7b974065d40/resource/3eb11c2d-9567-4a07-abb1-ca06d7d27a55/download/festnetz_2020q2_20210129.zip 29 | # URL=https://www.data.gv.at/katalog/dataset/588b9fdc-d2dd-4628-b186-f7b974065d40/resource/3eb11c2d-9567-4a07-abb1-ca06d7d27a55/download/festnetz_2020q1_20201016.zip 30 | 31 | m 32 | 33 | mkdir ~/open 34 | cd ~/open 35 | 36 | rm *.csv 37 | 38 | wget $URL 39 | unzip *.zip 40 | rm *.zip 41 | 42 | # Note file name contains date, might change in the future 43 | ls -l *.csv 44 | mv *.csv import.csv 45 | 46 | # import CSV 47 | 48 | sql=$(cat <