From fd295d28659142224f1adf355f23cf4f1ea9b63d Mon Sep 17 00:00:00 2001 From: Shay Carter Date: Wed, 23 Aug 2023 11:45:18 -0600 Subject: [PATCH] First step on bringing over v20 python code - brought over all the pythonPackages from the following repos/packages: - awips2/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.alertviz/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.mpe/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.dataplugin.text/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.dataplugin.grid/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.activetable/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.management/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.dataplugin.radar/pythonPackages - awips2/edexOsgi/com.raytheon.uf.common.site/pythonPackages - awips2-core/common/com.raytheon.uf.common.auth/pythonPackages - awips2-core/common/com.raytheon.uf.common.message/pythonPackages - awips2-core/common/com.raytheon.uf.common.localization/pythonPackages - awips2-core/common/com.raytheon.uf.common.datastorage/pythonPackages - awips2-core/common/com.raytheon.uf.common.pointdata/pythonPackages - awips2-core/common/com.raythoen.uf.common.pypies/pythonPackages - awips2-core/common/com.raytheon.uf.common.dataaccess/pythonPackages - awips2-core/common/com.raytheon.uf.common.dataplugin.level/pythonPackages - awips2-core/common/com.raytheon.uf.common.serialization/pythonPackages - awips2-core/common/com.raytheon.uf.common.time/pythonPackages - awips2-core/common/com.raytheon.uf.common.dataplugin/pythonPackages - awips2-core/common/com.raytheon.uf.common.dataquery/pythonPackages - updated the _init_.py file in dynamicserialize/dstypes/com/raytheon/uf/common to have all the proper elements listed - started to replace "ufpy" instances with "awips" - awips/test/testQpidTimeToLive.py - awips/test/dafTests/testWarning.py - awips/test/dafTests/testCombinedTimeQuery.py - will continue the "ufpy" replacement in a separate commit for easier clarity --- awips/AlertVizHandler.py | 87 ++++ awips/ConfigFileUtil.py | 56 ++ awips/DateTimeConverter.py | 47 +- awips/NotificationMessage.py | 136 +++++ awips/QpidSubscriber.py | 193 ++++--- awips/ThriftClient.py | 100 ++-- awips/TimeUtil.py | 56 +- awips/UsageArgumentParser.py | 35 +- awips/UsageOptionParser.py | 22 +- awips/__init__.py | 36 +- awips/dataaccess/CombinedTimeQuery.py | 48 +- awips/dataaccess/DataAccessLayer.py | 227 ++------- awips/dataaccess/DataNotificationLayer.py | 73 ++- awips/dataaccess/DataQueue.py | 43 +- awips/dataaccess/PyData.py | 49 +- awips/dataaccess/PyGeometryData.py | 93 ++-- awips/dataaccess/PyGeometryNotification.py | 38 +- awips/dataaccess/PyGridData.py | 49 +- awips/dataaccess/PyGridNotification.py | 30 +- awips/dataaccess/PyNotification.py | 65 ++- awips/dataaccess/SoundingsSupport.py | 283 +++++++++++ awips/dataaccess/ThriftClientRouter.py | 64 +-- awips/dataaccess/__init__.py | 47 +- awips/gfe/IFPClient.py | 107 ++-- awips/gfe/__init__.py | 36 +- awips/ignite_password.py | 64 +++ awips/localization/LocalizationFileManager.py | 477 ++++++++++++++++++ awips/localization/LocalizationUtil.py | 45 ++ awips/localization/__init__.py | 32 ++ awips/qpidingest.py | 139 ++--- awips/test/Record.py | 50 +- awips/test/Test | 48 ++ awips/test/__init__.py | 34 +- awips/test/dafTests/__init__.py | 34 ++ awips/test/dafTests/baseBufrMosTestCase.py | 34 +- awips/test/dafTests/baseDafTestCase.py | 80 ++- awips/test/dafTests/baseRadarTestCase.py | 41 +- awips/test/dafTests/params.py | 28 +- awips/test/dafTests/testAcars.py | 29 +- awips/test/dafTests/testAirep.py | 32 +- awips/test/dafTests/testBinLightning.py | 91 ++-- awips/test/dafTests/testBufrMosAvn.py | 44 ++ awips/test/dafTests/testBufrMosEta.py | 44 ++ awips/test/dafTests/testBufrMosGfs.py | 26 +- awips/test/dafTests/testBufrMosHpc.py | 46 ++ awips/test/dafTests/testBufrMosLamp.py | 44 ++ awips/test/dafTests/testBufrMosMrf.py | 45 ++ awips/test/dafTests/testBufrUa.py | 34 +- awips/test/dafTests/testClimate.py | 419 +++++++++++++++ awips/test/dafTests/testCombinedTimeQuery.py | 56 +- awips/test/dafTests/testCommonObsSpatial.py | 38 +- awips/test/dafTests/testDataTime.py | 44 +- awips/test/dafTests/testFfmp.py | 222 ++++++++ awips/test/dafTests/testGfe.py | 49 +- awips/test/dafTests/testGfeEditArea.py | 215 ++++++++ awips/test/dafTests/testGrid.py | 62 ++- awips/test/dafTests/testHydro.py | 243 +++++++++ awips/test/dafTests/testLdadMesonet.py | 84 +++ awips/test/dafTests/testMaps.py | 39 +- awips/test/dafTests/testModelSounding.py | 45 +- awips/test/dafTests/testObs.py | 34 +- awips/test/dafTests/testPirep.py | 91 ++++ awips/test/dafTests/testPracticeWarning.py | 44 ++ awips/test/dafTests/testRadarGraphics.py | 35 +- awips/test/dafTests/testRadarGrid.py | 31 +- awips/test/dafTests/testRadarSpatial.py | 41 +- awips/test/dafTests/testRequestConstraint.py | 103 +++- awips/test/dafTests/testSatellite.py | 38 +- awips/test/dafTests/testSfcObs.py | 37 +- awips/test/dafTests/testTopo.py | 49 +- awips/test/dafTests/testWarning.py | 55 +- awips/test/localization/__init__.py | 32 ++ awips/test/localization/smallTestImage.png | Bin 0 -> 379 bytes awips/test/localization/testLF.py | 91 ++++ .../testLocalizationFileManager.py | 173 +++++++ .../test/localization/testLocalizationRest.py | 365 ++++++++++++++ awips/test/testQpidTimeToLive.py | 98 ++++ .../DynamicSerializationManager.py | 54 +- .../SelfDescribingBinaryProtocol.py | 191 ++++--- .../ThriftSerializationContext.py | 184 +++---- dynamicserialize/__init__.py | 47 +- .../adapters/ActiveTableModeAdapter.py | 51 ++ .../adapters/ByteBufferAdapter.py | 37 +- dynamicserialize/adapters/CalendarAdapter.py | 33 +- .../adapters/CommutativeTimestampAdapter.py | 35 +- dynamicserialize/adapters/CoordAdapter.py | 38 +- .../adapters/DatabaseIDAdapter.py | 37 +- dynamicserialize/adapters/DateAdapter.py | 35 +- dynamicserialize/adapters/EnumSetAdapter.py | 47 +- .../adapters/FloatBufferAdapter.py | 37 +- .../adapters/FormattedDateAdapter.py | 36 +- .../adapters/GeomDataRespAdapter.py | 33 +- .../adapters/GeometryTypeAdapter.py | 40 +- .../adapters/GregorianCalendarAdapter.py | 33 +- .../adapters/JTSEnvelopeAdapter.py | 37 +- .../adapters/JobProgressAdapter.py | 51 ++ .../LocalizationLevelSerializationAdapter.py | 37 +- .../LocalizationTypeSerializationAdapter.py | 38 +- dynamicserialize/adapters/LockTableAdapter.py | 89 ++++ dynamicserialize/adapters/ParmIDAdapter.py | 37 +- dynamicserialize/adapters/PointAdapter.py | 32 +- .../adapters/StackTraceElementAdapter.py | 34 +- .../adapters/TimeConstraintsAdapter.py | 43 +- .../adapters/TimeRangeTypeAdapter.py | 45 +- dynamicserialize/adapters/TimestampAdapter.py | 35 +- dynamicserialize/adapters/WsIdAdapter.py | 50 +- dynamicserialize/adapters/__init__.py | 46 +- dynamicserialize/dstypes/__init__.py | 23 + dynamicserialize/dstypes/com/__init__.py | 24 +- .../dstypes/com/raytheon/__init__.py | 23 + .../dstypes/com/raytheon/uf/__init__.py | 23 + .../com/raytheon/uf/common/__init__.py | 25 + .../uf/common/activetable/ActiveTableKey.py | 86 ++++ .../uf/common/activetable/ActiveTableMode.py | 29 ++ .../common/activetable/ActiveTableRecord.py | 291 +++++++++++ .../activetable/DumpActiveTableRequest.py | 103 ++++ .../activetable/DumpActiveTableResponse.py | 51 ++ .../activetable/GetActiveTableDictRequest.py | 44 ++ .../activetable/GetActiveTableDictResponse.py | 40 ++ .../activetable/GetFourCharSitesRequest.py | 32 ++ .../activetable/GetFourCharSitesResponse.py | 32 ++ .../activetable/GetVtecAttributeRequest.py | 44 ++ .../activetable/GetVtecAttributeResponse.py | 30 ++ .../OperationalActiveTableRecord.py | 35 ++ .../activetable/PracticeActiveTableRecord.py | 34 ++ .../activetable/SendPracticeProductRequest.py | 47 ++ .../uf/common/activetable/VTECChange.py | 54 ++ .../VTECTableChangeNotification.py | 59 +++ .../uf/common/activetable/__init__.py | 60 +++ .../request/ClearPracticeVTECTableRequest.py | 40 ++ .../request/MergeActiveTableRequest.py | 94 ++++ .../RetrieveRemoteActiveTableRequest.py | 99 ++++ .../request/SendActiveTableRequest.py | 140 +++++ .../uf/common/activetable/request/__init__.py | 34 ++ .../response/ActiveTableSharingResponse.py | 40 ++ .../common/activetable/response/__init__.py | 28 + .../uf/common/alertviz/AlertVizRequest.py | 43 +- .../raytheon/uf/common/alertviz/__init__.py | 21 + .../com/raytheon/uf/common/auth/__init__.py | 23 + .../auth/resp/AbstractFailedResponse.py | 26 +- .../auth/resp/AuthServerErrorResponse.py | 31 +- .../common/auth/resp/SuccessfulExecution.py | 21 + .../uf/common/auth/resp/UserNotAuthorized.py | 22 + .../raytheon/uf/common/auth/resp/__init__.py | 22 + .../com/raytheon/uf/common/auth/user/User.py | 24 +- .../raytheon/uf/common/auth/user/UserId.py | 44 +- .../raytheon/uf/common/auth/user/__init__.py | 21 + .../raytheon/uf/common/dataaccess/__init__.py | 23 + .../dataaccess/impl/DefaultDataRequest.py | 54 +- .../impl/DefaultNotificationFilter.py | 37 +- .../uf/common/dataaccess/impl/__init__.py | 23 +- .../request/AbstractDataAccessRequest.py | 31 +- .../request/AbstractIdentifierRequest.py | 30 +- .../request/GetAvailableLevelsRequest.py | 32 +- .../GetAvailableLocationNamesRequest.py | 32 +- .../request/GetAvailableParametersRequest.py | 30 +- .../request/GetAvailableTimesRequest.py | 32 +- .../request/GetGeometryDataRequest.py | 32 +- .../dataaccess/request/GetGridDataRequest.py | 33 +- .../request/GetGridLatLonRequest.py | 26 +- .../request/GetIdentifierValuesRequest.py | 24 +- .../request/GetNotificationFilterRequest.py | 32 +- .../request/GetOptionalIdentifiersRequest.py | 33 +- .../request/GetRequiredIdentifiersRequest.py | 32 +- .../request/GetSupportedDatatypesRequest.py | 30 +- .../uf/common/dataaccess/request/__init__.py | 21 + .../response/AbstractResponseData.py | 43 +- .../response/GeometryResponseData.py | 28 +- .../response/GetGeometryDataResponse.py | 21 + .../response/GetGridDataResponse.py | 29 +- .../response/GetGridLatLonResponse.py | 27 +- .../response/GetNotificationFilterResponse.py | 20 + .../dataaccess/response/GridResponseData.py | 37 +- .../uf/common/dataaccess/response/__init__.py | 21 + .../raytheon/uf/common/dataplugin/__init__.py | 31 +- .../uf/common/dataplugin/events/__init__.py | 23 + .../dataplugin/events/hazards/__init__.py | 23 + .../hazards/requests/RegionLookupRequest.py | 27 +- .../events/hazards/requests/__init__.py | 22 + .../common/dataplugin/gfe/GridDataHistory.py | 26 +- .../uf/common/dataplugin/gfe/__init__.py | 31 +- .../dataplugin/gfe/config/ProjectionData.py | 29 +- .../common/dataplugin/gfe/config/__init__.py | 22 + .../uf/common/dataplugin/gfe/db/__init__.py | 23 + .../dataplugin/gfe/db/objects/DatabaseID.py | 61 ++- .../dataplugin/gfe/db/objects/GFERecord.py | 31 +- .../dataplugin/gfe/db/objects/GridLocation.py | 47 +- .../dataplugin/gfe/db/objects/GridParmInfo.py | 69 ++- .../dataplugin/gfe/db/objects/ParmID.py | 74 ++- .../gfe/db/objects/TimeConstraints.py | 75 +-- .../dataplugin/gfe/db/objects/__init__.py | 22 + .../dataplugin/gfe/discrete/DiscreteKey.py | 52 +- .../dataplugin/gfe/discrete/__init__.py | 22 + .../common/dataplugin/gfe/grid/Grid2DByte.py | 29 +- .../common/dataplugin/gfe/grid/Grid2DFloat.py | 28 +- .../uf/common/dataplugin/gfe/grid/__init__.py | 22 + .../gfe/request/AbstractGfeRequest.py | 25 +- .../gfe/request/CommitGridsRequest.py | 21 + .../request/ConfigureTextProductsRequest.py | 21 + .../request/ExecuteIfpNetCDFGridRequest.py | 70 ++- .../gfe/request/ExecuteIscMosaicRequest.py | 255 ++++++++++ .../gfe/request/ExportGridsRequest.py | 37 +- .../gfe/request/GetASCIIGridsRequest.py | 21 + .../gfe/request/GetGridDataRequest.py | 31 +- .../gfe/request/GetGridInventoryRequest.py | 21 + .../gfe/request/GetLatestDbTimeRequest.py | 37 +- .../gfe/request/GetLatestModelDbIdRequest.py | 37 +- .../gfe/request/GetLockTablesRequest.py | 21 + .../gfe/request/GetOfficialDbNameRequest.py | 21 + .../gfe/request/GetParmListRequest.py | 21 + .../gfe/request/GetSelectTimeRangeRequest.py | 21 + .../gfe/request/GetSingletonDbIdsRequest.py | 21 + .../gfe/request/GetSiteTimeZoneInfoRequest.py | 29 +- .../gfe/request/GfeClientRequest.py | 20 +- .../dataplugin/gfe/request/GridLocRequest.py | 21 + .../gfe/request/IscDataRecRequest.py | 47 ++ .../gfe/request/LockChangeRequest.py | 21 + .../gfe/request/ProcessReceivedConfRequest.py | 22 +- .../ProcessReceivedDigitalDataRequest.py | 22 +- .../gfe/request/PurgeGfeGridsRequest.py | 27 +- .../gfe/request/RsyncGridsToCWFRequest.py | 25 +- .../gfe/request/SaveASCIIGridsRequest.py | 21 + .../gfe/request/SmartInitRequest.py | 21 + .../common/dataplugin/gfe/request/__init__.py | 34 +- .../common/dataplugin/gfe/server/__init__.py | 23 + .../common/dataplugin/gfe/server/lock/Lock.py | 40 +- .../dataplugin/gfe/server/lock/LockTable.py | 33 +- .../dataplugin/gfe/server/lock/__init__.py | 22 + .../gfe/server/message/ServerMsg.py | 21 + .../gfe/server/message/ServerResponse.py | 34 +- .../dataplugin/gfe/server/message/__init__.py | 22 + .../CombinationsFileChangedNotification.py | 35 +- .../server/notify/DBInvChangeNotification.py | 30 +- .../gfe/server/notify/GfeNotification.py | 29 +- .../notify/GridHistoryUpdateNotification.py | 32 +- .../server/notify/GridUpdateNotification.py | 32 +- .../gfe/server/notify/LockNotification.py | 28 +- .../ServiceBackupJobStatusNotification.py | 54 ++ .../server/notify/UserMessageNotification.py | 28 +- .../dataplugin/gfe/server/notify/__init__.py | 24 + .../gfe/server/request/CommitGridRequest.py | 21 + .../gfe/server/request/GetGridRequest.py | 24 + .../gfe/server/request/LockRequest.py | 21 + .../gfe/server/request/LockTableRequest.py | 21 + .../dataplugin/gfe/server/request/__init__.py | 22 + .../dataplugin/gfe/slice/AbstractGridSlice.py | 29 +- .../dataplugin/gfe/slice/DiscreteGridSlice.py | 42 +- .../dataplugin/gfe/slice/ScalarGridSlice.py | 25 +- .../dataplugin/gfe/slice/VectorGridSlice.py | 28 +- .../dataplugin/gfe/slice/WeatherGridSlice.py | 24 +- .../common/dataplugin/gfe/slice/__init__.py | 22 + .../dataplugin/gfe/svcbu/JobProgress.py | 37 ++ .../common/dataplugin/gfe/svcbu/__init__.py | 33 ++ .../dataplugin/gfe/weather/WeatherKey.py | 34 +- .../dataplugin/gfe/weather/WeatherSubKey.py | 24 +- .../common/dataplugin/gfe/weather/__init__.py | 22 + .../uf/common/dataplugin/grid/__init__.py | 23 + .../grid/request/DeleteAllGridDataRequest.py | 21 + .../dataplugin/grid/request/__init__.py | 22 + .../uf/common/dataplugin/level/Level.py | 98 ++-- .../uf/common/dataplugin/level/MasterLevel.py | 82 ++- .../uf/common/dataplugin/level/__init__.py | 22 + .../message/DataURINotificationMessage.py | 21 + .../uf/common/dataplugin/message/__init__.py | 22 + .../persist/PersistableDataObject.py | 42 ++ .../uf/common/dataplugin/persist/__init__.py | 28 + .../uf/common/dataplugin/radar/__init__.py | 23 + .../request/GetRadarDataRecordRequest.py | 27 +- .../dataplugin/radar/request/__init__.py | 22 + .../response/GetRadarDataRecordResponse.py | 27 +- .../radar/response/RadarDataRecord.py | 27 +- .../dataplugin/radar/response/__init__.py | 22 + .../uf/common/dataplugin/text/__init__.py | 23 + .../dataplugin/text/dbsrv/TextDBRequest.py | 21 + .../common/dataplugin/text/dbsrv/__init__.py | 22 + .../dataplugin/text/subscription/__init__.py | 23 + .../request/SubscriptionRequest.py | 27 +- .../text/subscription/request/__init__.py | 22 + .../raytheon/uf/common/dataquery/__init__.py | 23 + .../dataquery/requests/RequestConstraint.py | 95 ++-- .../uf/common/dataquery/requests/__init__.py | 22 + .../raytheon/uf/common/datastorage/Request.py | 23 +- .../common/datastorage/StorageProperties.py | 21 + .../uf/common/datastorage/StorageStatus.py | 19 + .../uf/common/datastorage/__init__.py | 42 +- .../datastorage/records/ByteDataRecord.py | 96 +++- .../records/DataUriMetadataIdentifier.py | 48 ++ .../datastorage/records/DoubleDataRecord.py | 104 +++- .../datastorage/records/FloatDataRecord.py | 96 +++- .../datastorage/records/IntegerDataRecord.py | 93 +++- .../datastorage/records/LongDataRecord.py | 94 +++- .../records/NoMetadataIdentifier.py | 40 ++ .../datastorage/records/RecordAndMetadata.py | 47 ++ .../datastorage/records/ShortDataRecord.py | 95 +++- .../datastorage/records/StringDataRecord.py | 104 +++- .../uf/common/datastorage/records/__init__.py | 32 +- .../localization/LocalizationContext.py | 25 +- .../common/localization/LocalizationLevel.py | 53 +- .../common/localization/LocalizationType.py | 27 +- .../uf/common/localization/__init__.py | 28 +- .../localization/msgs/DeleteUtilityCommand.py | 23 +- .../msgs/DeleteUtilityResponse.py | 20 + .../localization/msgs/ListResponseEntry.py | 23 +- .../localization/msgs/ListUtilityCommand.py | 21 + .../localization/msgs/ListUtilityResponse.py | 20 + .../msgs/PrivilegedUtilityRequestMessage.py | 24 +- .../msgs/UtilityRequestMessage.py | 21 + .../msgs/UtilityResponseMessage.py | 21 + .../uf/common/localization/msgs/__init__.py | 22 + .../AbstractLocalizationStreamRequest.py | 31 +- .../stream/LocalizationStreamGetRequest.py | 26 +- .../stream/LocalizationStreamPutRequest.py | 32 +- .../uf/common/localization/stream/__init__.py | 22 + .../raytheon/uf/common/management/__init__.py | 23 + .../request/ChangeContextRequest.py | 21 + .../management/request/PassThroughRequest.py | 21 + .../uf/common/management/request/__init__.py | 26 +- .../diagnostic/GetClusterMembersRequest.py | 20 + .../request/diagnostic/GetContextsRequest.py | 21 + .../request/diagnostic/StatusRequest.py | 20 + .../management/request/diagnostic/__init__.py | 22 + .../uf/common/management/response/__init__.py | 23 + .../diagnostic/ClusterMembersResponse.py | 23 +- .../response/diagnostic/ContextsResponse.py | 23 +- .../response/diagnostic/StatusResponse.py | 23 +- .../response/diagnostic/__init__.py | 22 + .../com/raytheon/uf/common/message/Body.py | 21 + .../com/raytheon/uf/common/message/Header.py | 24 +- .../com/raytheon/uf/common/message/Message.py | 21 + .../raytheon/uf/common/message/Property.py | 21 + .../com/raytheon/uf/common/message/WsId.py | 79 +-- .../raytheon/uf/common/message/__init__.py | 28 +- .../com/raytheon/uf/common/mpe/__init__.py | 27 + .../DQCPreProcRunConfiguration.py | 60 +++ .../DQCPreProcessorExecuteRequest.py | 39 ++ .../DQCPreProcessorExecuteResponse.py | 32 ++ .../uf/common/mpe/dqcpreprocessor/__init__.py | 32 ++ .../raytheon/uf/common/pointdata/__init__.py | 23 + .../requests/NewAdaptivePlotRequest.py | 21 + .../uf/common/pointdata/requests/__init__.py | 22 + .../raytheon/uf/common/pypies/PointTest.py | 21 + .../com/raytheon/uf/common/pypies/__init__.py | 26 +- .../pypies/records/CompressedDataRecord.py | 45 +- .../uf/common/pypies/records/__init__.py | 37 +- .../uf/common/pypies/request/CopyRequest.py | 20 + .../pypies/request/CreateDatasetRequest.py | 21 + .../pypies/request/DatasetDataRequest.py | 21 + .../pypies/request/DatasetNamesRequest.py | 21 + .../pypies/request/DeleteFilesRequest.py | 21 + .../pypies/request/DeleteOrphansRequest.py | 27 +- .../uf/common/pypies/request/DeleteRequest.py | 21 + .../uf/common/pypies/request/GroupsRequest.py | 21 + .../uf/common/pypies/request/RepackRequest.py | 20 + .../common/pypies/request/RetrieveRequest.py | 21 + .../uf/common/pypies/request/StoreRequest.py | 31 +- .../uf/common/pypies/request/__init__.py | 21 + .../common/pypies/response/DeleteResponse.py | 21 + .../common/pypies/response/ErrorResponse.py | 32 +- .../pypies/response/FileActionResponse.py | 20 + .../pypies/response/RetrieveResponse.py | 21 + .../common/pypies/response/StoreResponse.py | 21 + .../uf/common/pypies/response/__init__.py | 21 + .../SerializableExceptionWrapper.py | 27 +- .../uf/common/serialization/__init__.py | 40 +- .../uf/common/serialization/comm/__init__.py | 39 +- .../comm/response/ServerErrorResponse.py | 19 + .../serialization/comm/response/__init__.py | 36 +- .../com/raytheon/uf/common/site/__init__.py | 25 +- .../notify/ClusterActivationNotification.py | 35 +- .../site/notify/SiteActivationNotification.py | 36 +- .../uf/common/site/notify/__init__.py | 24 +- .../site/requests/ActivateSiteRequest.py | 25 +- .../site/requests/DeactivateSiteRequest.py | 25 +- .../site/requests/GetActiveSitesRequest.py | 21 + .../site/requests/GetPrimarySiteRequest.py | 21 + .../site/requests/ValidateConfigRequest.py | 25 +- .../uf/common/site/requests/__init__.py | 24 +- .../uf/common/time/CommutativeTimestamp.py | 24 +- .../com/raytheon/uf/common/time/DataTime.py | 121 +++-- .../raytheon/uf/common/time/FormattedDate.py | 23 +- .../com/raytheon/uf/common/time/TimeRange.py | 55 +- .../com/raytheon/uf/common/time/__init__.py | 26 +- .../dstypes/com/vividsolutions/__init__.py | 4 - .../com/vividsolutions/jts/__init__.py | 4 - .../com/vividsolutions/jts/geom/Coordinate.py | 25 - .../com/vividsolutions/jts/geom/Geometry.py | 17 - .../com/vividsolutions/jts/geom/__init__.py | 10 - dynamicserialize/dstypes/gov/__init__.py | 4 + dynamicserialize/dstypes/gov/noaa/__init__.py | 4 + .../dstypes/gov/noaa/nws/__init__.py | 4 + .../dstypes/gov/noaa/nws/ncep/__init__.py | 4 + .../gov/noaa/nws/ncep/common/__init__.py | 4 + .../nws/ncep/common/dataplugin/__init__.py | 4 + .../ncep/common/dataplugin/atcf/__init__.py | 4 + .../atcf/request/RetrieveAtcfDeckRequest.py | 2 + .../dataplugin/atcf/request/__init__.py | 3 + .../ncep/common/dataplugin/gempak/__init__.py | 4 + .../gempak/request/GetGridDataRequest.py | 8 +- .../gempak/request/GetGridInfoRequest.py | 8 +- .../gempak/request/GetGridNavRequest.py | 8 +- .../gempak/request/GetStationsRequest.py | 8 +- .../gempak/request/GetTimesRequest.py | 8 +- .../gempak/request/GetTimesResponse.py | 8 +- .../dataplugin/gempak/request/Station.py | 8 +- .../gempak/request/StationDataRequest.py | 8 +- .../gempak/request/SurfaceDataRequest.py | 8 +- .../gempak/request/UpperAirDataRequest.py | 8 +- .../dataplugin/gempak/request/__init__.py | 3 + .../ncep/common/dataplugin/gpd/__init__.py | 2 + .../gpd/query/GenericPointDataReqMsg.py | 6 +- .../common/dataplugin/gpd/query/__init__.py | 2 + .../common/dataplugin/pgen/ActivityInfo.py | 2 + .../common/dataplugin/pgen/DerivedProduct.py | 2 + .../pgen/ResponseMessageValidate.py | 2 + .../ncep/common/dataplugin/pgen/__init__.py | 9 +- .../request/RetrieveActivityMapRequest.py | 7 +- .../request/RetrieveAllProductsRequest.py | 2 + .../pgen/request/StoreActivityRequest.py | 2 + .../request/StoreDerivedProductRequest.py | 2 + .../dataplugin/pgen/request/__init__.py | 7 +- .../pgen/response/ActivityMapData.py | 8 +- .../response/RetrieveActivityMapResponse.py | 8 +- .../dataplugin/pgen/response/__init__.py | 3 + dynamicserialize/dstypes/java/__init__.py | 25 +- dynamicserialize/dstypes/java/awt/Point.py | 36 +- dynamicserialize/dstypes/java/awt/__init__.py | 36 +- .../dstypes/java/lang/StackTraceElement.py | 52 +- .../dstypes/java/lang/__init__.py | 22 + .../dstypes/java/sql/Timestamp.py | 31 +- dynamicserialize/dstypes/java/sql/__init__.py | 21 + .../dstypes/java/util/Calendar.py | 42 +- dynamicserialize/dstypes/java/util/Date.py | 31 +- dynamicserialize/dstypes/java/util/EnumSet.py | 42 +- .../dstypes/java/util/GregorianCalendar.py | 41 +- .../dstypes/java/util/__init__.py | 24 +- dynamicserialize/dstypes/org/__init__.py | 27 + .../dstypes/org/locationtech/__init__.py | 27 + .../dstypes/org/locationtech/jts/__init__.py | 27 + .../org/locationtech/jts/geom/Coordinate.py | 46 ++ .../locationtech}/jts/geom/Envelope.py | 33 +- .../org/locationtech/jts/geom/Geometry.py | 37 ++ .../org/locationtech/jts/geom/__init__.py | 32 ++ thrift/ThriftStreamSerializer.class | Bin 0 -> 1667 bytes 443 files changed, 16089 insertions(+), 2334 deletions(-) create mode 100644 awips/AlertVizHandler.py create mode 100644 awips/ConfigFileUtil.py create mode 100755 awips/NotificationMessage.py create mode 100644 awips/dataaccess/SoundingsSupport.py create mode 100644 awips/ignite_password.py create mode 100644 awips/localization/LocalizationFileManager.py create mode 100644 awips/localization/LocalizationUtil.py create mode 100644 awips/localization/__init__.py create mode 100644 awips/test/Test create mode 100644 awips/test/dafTests/testBufrMosAvn.py create mode 100644 awips/test/dafTests/testBufrMosEta.py create mode 100644 awips/test/dafTests/testBufrMosHpc.py create mode 100644 awips/test/dafTests/testBufrMosLamp.py create mode 100644 awips/test/dafTests/testBufrMosMrf.py create mode 100644 awips/test/dafTests/testClimate.py create mode 100644 awips/test/dafTests/testFfmp.py create mode 100644 awips/test/dafTests/testGfeEditArea.py create mode 100644 awips/test/dafTests/testHydro.py create mode 100644 awips/test/dafTests/testLdadMesonet.py create mode 100644 awips/test/dafTests/testPirep.py create mode 100644 awips/test/dafTests/testPracticeWarning.py create mode 100644 awips/test/localization/__init__.py create mode 100644 awips/test/localization/smallTestImage.png create mode 100644 awips/test/localization/testLF.py create mode 100644 awips/test/localization/testLocalizationFileManager.py create mode 100644 awips/test/localization/testLocalizationRest.py create mode 100644 awips/test/testQpidTimeToLive.py create mode 100644 dynamicserialize/adapters/ActiveTableModeAdapter.py create mode 100644 dynamicserialize/adapters/JobProgressAdapter.py create mode 100644 dynamicserialize/adapters/LockTableAdapter.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/ActiveTableKey.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/ActiveTableMode.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/ActiveTableRecord.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/DumpActiveTableRequest.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/DumpActiveTableResponse.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetActiveTableDictRequest.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetActiveTableDictResponse.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetFourCharSitesRequest.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetFourCharSitesResponse.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetVtecAttributeRequest.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetVtecAttributeResponse.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/OperationalActiveTableRecord.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/PracticeActiveTableRecord.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/SendPracticeProductRequest.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/VTECChange.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/VTECTableChangeNotification.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/__init__.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/ClearPracticeVTECTableRequest.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/MergeActiveTableRequest.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/RetrieveRemoteActiveTableRequest.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/SendActiveTableRequest.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/__init__.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/response/ActiveTableSharingResponse.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/activetable/response/__init__.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExecuteIscMosaicRequest.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/IscDataRecRequest.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/ServiceBackupJobStatusNotification.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/svcbu/JobProgress.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/svcbu/__init__.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/persist/PersistableDataObject.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/persist/__init__.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/DataUriMetadataIdentifier.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/NoMetadataIdentifier.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/RecordAndMetadata.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/mpe/__init__.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/mpe/dqcpreprocessor/DQCPreProcRunConfiguration.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/mpe/dqcpreprocessor/DQCPreProcessorExecuteRequest.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/mpe/dqcpreprocessor/DQCPreProcessorExecuteResponse.py create mode 100644 dynamicserialize/dstypes/com/raytheon/uf/common/mpe/dqcpreprocessor/__init__.py delete mode 100644 dynamicserialize/dstypes/com/vividsolutions/__init__.py delete mode 100644 dynamicserialize/dstypes/com/vividsolutions/jts/__init__.py delete mode 100644 dynamicserialize/dstypes/com/vividsolutions/jts/geom/Coordinate.py delete mode 100644 dynamicserialize/dstypes/com/vividsolutions/jts/geom/Geometry.py delete mode 100644 dynamicserialize/dstypes/com/vividsolutions/jts/geom/__init__.py create mode 100644 dynamicserialize/dstypes/org/__init__.py create mode 100644 dynamicserialize/dstypes/org/locationtech/__init__.py create mode 100644 dynamicserialize/dstypes/org/locationtech/jts/__init__.py create mode 100644 dynamicserialize/dstypes/org/locationtech/jts/geom/Coordinate.py rename dynamicserialize/dstypes/{com/vividsolutions => org/locationtech}/jts/geom/Envelope.py (55%) create mode 100644 dynamicserialize/dstypes/org/locationtech/jts/geom/Geometry.py create mode 100644 dynamicserialize/dstypes/org/locationtech/jts/geom/__init__.py create mode 100644 thrift/ThriftStreamSerializer.class diff --git a/awips/AlertVizHandler.py b/awips/AlertVizHandler.py new file mode 100644 index 0000000..562ee62 --- /dev/null +++ b/awips/AlertVizHandler.py @@ -0,0 +1,87 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +# +# Pure python logging mechanism for logging to AlertViz from +# pure python (ie not JEP). DO NOT USE IN PYTHON CALLED +# FROM JAVA. +# +# Sends local-delivery messages only, but needs to know the EDEX host name in +# order to forward the message. If the DEFAULT_HOST environment variable is +# not set correctly then this will not work. +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 08/18/10 njensen Initial Creation. +# Apr 16, 2020 8144 tgurney Reference AlertViz stomp port +# specified in NotificationMessage +# Aug 25, 2020 8220 tgurney Change local-delivery strategy +# +# +# + +import logging +import os +from . import NotificationMessage +import socket + +class AlertVizHandler(logging.Handler): + + def __init__(self, host=None, port=None, + category='LOCAL', source='ANNOUNCER', level=logging.NOTSET, filters=None): + logging.Handler.__init__(self, level) + if host is None: + host = os.getenv('DEFAULT_HOST', 'localhost') + if port is None: + port = os.getenv('DEFAULT_PORT', 9581) + self._category = category + self._host = host + self._port = port + self._source = source + self._filters = filters + filters['WORKSTATION'] = socket.getfqdn() + + + def emit(self, record): + "Implements logging.Handler's interface. Record argument is a logging.LogRecord." + priority = None + if record.levelno >= 50: + priority = 'CRITICAL' + elif record.levelno >= 40: + priority = 'SIGNIFICANT' + elif record.levelno >= 30: + priority = 'PROBLEM' + elif record.levelno >= 20: + priority = 'EVENTA' + elif record.levelno >= 10: + priority = 'EVENTB' + else: + priority = 'VERBOSE' + + msg = self.format(record) + + notify = NotificationMessage.NotificationMessage(self._host, self._port, msg, priority, self._category, self._source, + filters=self._filters) + notify.send() + diff --git a/awips/ConfigFileUtil.py b/awips/ConfigFileUtil.py new file mode 100644 index 0000000..58f8d67 --- /dev/null +++ b/awips/ConfigFileUtil.py @@ -0,0 +1,56 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# +# A set of utility functions for dealing with configuration files. +# +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 09/27/10 dgilling Initial Creation. +# +# +# + + +def parseKeyValueFile(fileName): + propDict= dict() + + try: + propFile= open(fileName, "rU") + for propLine in propFile: + propDef= propLine.strip() + if len(propDef) == 0: + continue + if propDef[0] in ( '#' ): + continue + punctuation= [ propDef.find(c) for c in ':= ' ] + [ len(propDef) ] + found= min( [ pos for pos in punctuation if pos != -1 ] ) + name= propDef[:found].rstrip() + value= propDef[found:].lstrip(":= ").rstrip() + propDict[name]= value + propFile.close() + except: + pass + + return propDict \ No newline at end of file diff --git a/awips/DateTimeConverter.py b/awips/DateTimeConverter.py index bab093b..3032c10 100644 --- a/awips/DateTimeConverter.py +++ b/awips/DateTimeConverter.py @@ -1,10 +1,30 @@ +# # +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# # + # # Functions for converting between the various "Java" dynamic serialize types # used by EDEX to the native python time datetime. -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/24/15 #4480 dgilling Initial Creation. @@ -17,22 +37,23 @@ from dynamicserialize.dstypes.java.util import Date from dynamicserialize.dstypes.java.sql import Timestamp from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange + MAX_TIME = pow(2, 31) - 1 MICROS_IN_SECOND = 1000000 def convertToDateTime(timeArg): - """ - Converts the given object to a python datetime object. Supports native + """ + Converts the given object to a python datetime object. Supports native python representations like datetime and struct_time, but also the dynamicserialize types like Date and Timestamp. Raises TypeError if no conversion can be performed. - + Args: timeArg: a python object representing a date and time. Supported types include datetime, struct_time, float, int, long and the dynamicserialize types Date and Timestamp. - + Returns: A datetime that represents the same date/time as the passed in object. """ @@ -56,7 +77,6 @@ def convertToDateTime(timeArg): objType = str(type(timeArg)) raise TypeError("Cannot convert object of type " + objType + " to datetime.") - def _convertSecsAndMicros(seconds, micros): if seconds < MAX_TIME: rval = datetime.datetime.utcfromtimestamp(seconds) @@ -65,20 +85,19 @@ def _convertSecsAndMicros(seconds, micros): rval = datetime.datetime.utcfromtimestamp(MAX_TIME) + extraTime return rval.replace(microsecond=micros) - def constructTimeRange(*args): - """ + """ Builds a python dynamicserialize TimeRange object from the given arguments. - + Args: - args*: must be a TimeRange or a pair of objects that can be + args*: must be a TimeRange or a pair of objects that can be converted to a datetime via convertToDateTime(). - + Returns: A TimeRange. """ - + if len(args) == 1 and isinstance(args[0], TimeRange): return args[0] if len(args) != 2: diff --git a/awips/NotificationMessage.py b/awips/NotificationMessage.py new file mode 100755 index 0000000..81832f3 --- /dev/null +++ b/awips/NotificationMessage.py @@ -0,0 +1,136 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + + +import socket +import sys + +from . import ThriftClient +from dynamicserialize.dstypes.com.raytheon.uf.common.alertviz import AlertVizRequest + +# +# Provides a capability of constructing notification messages and sending +# them to a STOMP data source. +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 09/30/08 chammack Initial Creation. +# 11/03/10 5849 cjeanbap Moved to ufpy package from +# com.raytheon.uf.tools.cli +# 01/07/11 5645 cjeanbap Added audio file to Status Message. +# 05/27/11 3050 cjeanbap Added if-statement to check Priority +# value +# 07/27/15 4654 skorolev Added filters +# 11/11/15 5120 rferrel Cannot serialize empty filters. +# 03/05/18 6899 dgilling Update to latest version of stomp.py API. +# 09/14/18 7464 dgilling Only serialize audioFile if provided. +# Apr 16, 2020 8144 tgurney Change AlertViz stomp port to +# calculated value based on uid +# May 15, 2020 8144 tgurney Remove local-delivery logic +# (no longer works as of 19.3.4) + +class NotificationMessage: + + priorityMap = { + 0: 'CRITICAL', + 1: 'SIGNIFICANT', + 2: 'PROBLEM', + 3: 'EVENTA', + 4: 'EVENTB', + 5: 'VERBOSE'} + + def __init__(self, host='localhost', port=9581, message='', priority='PROBLEM', category="LOCAL", source="ANNOUNCER", audioFile=None, filters=None): + self.host = host + self.port = port + self.message = message + self.audioFile = audioFile + self.source = source + self.category = category + self.filters = filters + + priorityInt = None + + try: + priorityInt = int(priority) + except: + pass + + if priorityInt is None: + #UFStatus.java contains mapping of Priority to Logging level mapping + if priority == 'CRITICAL' or priority == 'FATAL': + priorityInt = int(0) + elif priority == 'SIGNIFICANT' or priority == 'ERROR': + priorityInt = int(1) + elif priority == 'PROBLEM' or priority == 'WARN': + priorityInt = int(2) + elif priority == 'EVENTA' or priority == 'INFO': + priorityInt = int(3) + elif priority == 'EVENTB': + priorityInt = int(4) + elif priority == 'VERBOSE' or priority == 'DEBUG': + priorityInt = int(5) + + if (priorityInt < 0 or priorityInt > 5): + print("Error occurred, supplied an invalid Priority value:", str(priorityInt)) + print("Priority values are 0, 1, 2, 3, 4 and 5.") + sys.exit(1) + + if priorityInt is not None: + self.priority = self.priorityMap[priorityInt] + else: + self.priority = priority + + def send(self): + alertVizRequest = createRequest(self.message, self.priority, self.source, self.category, self.audioFile, self.filters) + thriftClient = ThriftClient.ThriftClient(self.host, self.port, "/services") + + serverResponse = None + try: + serverResponse = thriftClient.sendRequest(alertVizRequest) + except Exception as ex: + print("Caught exception submitting AlertVizRequest:", str(ex)) + + if (serverResponse != "None"): + print("Error occurred submitting Notification Message to AlertViz receiver:", serverResponse) + sys.exit(1) + else: + print("Response:", str(serverResponse)) + +def createRequest(message, priority, source, category, audioFile, filters): + obj = AlertVizRequest() + + obj.setMachine(socket.gethostname()) + obj.setPriority(priority) + obj.setCategory(category) + obj.setSourceKey(source) + obj.setMessage(message) + if (audioFile is not None): + obj.setAudioFile(audioFile) + else: + obj.setAudioFile('\0') + obj.setFilters(filters) + return obj + +if __name__ == '__main__': + main() diff --git a/awips/QpidSubscriber.py b/awips/QpidSubscriber.py index 833511e..1520aeb 100644 --- a/awips/QpidSubscriber.py +++ b/awips/QpidSubscriber.py @@ -1,103 +1,170 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + # # Provides a Python-based interface for subscribing to qpid queues and topics. +# +# SOFTWARE HISTORY # +# Date Ticket# Engineer Description +# ------------- -------- ------------ -------------------------------------------- +# Nov 17, 2010 njensen Initial Creation. +# Aug 15, 2013 2169 bkowal Optionally gzip decompress any data that is read. +# Aug 04, 2016 2416 tgurney Add queueStarted property +# Feb 16, 2017 6084 bsteffen Support ssl connections +# Sep 07, 2017 6175 tgurney Remove "decompressing" log message +# Jul 23, 2019 7724 mrichardson Upgrade Qpid to Qpid Proton +# Nov 04, 2019 7724 tgurney Fix topic creation +# Jun 24, 2020 8187 randerso Added qpid connection_id # -# -# SOFTWARE HISTORY -# -# Date Ticket# Engineer Description -# ------------ ---------- ----------- -------------------------- -# 11/17/10 njensen Initial Creation. -# 08/15/13 2169 bkowal Optionally gzip decompress any data that is read. -# 08/04/16 2416 tgurney Add queueStarted property -# 02/16/17 6084 bsteffen Support ssl connections -# 09/07/17 6175 tgurney Remove "decompressing" log message -# -# + +from __future__ import print_function +import logging import os import os.path -import qpid +import pwd +import socket import zlib +from ssl import SSLContext, PROTOCOL_TLS -from Queue import Empty -from qpid.exceptions import Closed +from proton import SSLDomain +from proton.handlers import MessagingHandler +from proton.reactor import Container +logging.basicConfig(level=logging.INFO, datefmt='%H:%M:%S', + format='[%(process)s] %(asctime)s %(levelname)s: %(message)s') +log = logging.getLogger('QpidSubscriber') -class QpidSubscriber: +SSL_PASSWORD = 'password' +QPID_USERNAME = 'guest' +QPID_PASSWORD = 'guest' - def __init__(self, host='127.0.0.1', port=5672, decompress=False, ssl=None): +class QpidSubscriber(MessagingHandler): + + def __init__(self, host='127.0.0.1', port=5672, decompress=False, ssl=None, program="QpidSubscriber"): + super(QpidSubscriber, self).__init__(auto_accept=True) + #__init__ should only handle setting up properties; + # any connection and subscription actions should be handled + # by the reactor functions + + self.queues = {} + + self.scheme = 'amqp' + self.rest_scheme = 'https' + self.ssl_context = None self.host = host self.port = port self.decompress = decompress - socket = qpid.util.connect(host, port) + self.__queueStarted = False + self.__subscribed = False + + pwuid = pwd.getpwuid(os.getuid()) if "QPID_SSL_CERT_DB" in os.environ: - certdb = os.environ["QPID_SSL_CERT_DB"] + certdbloc = os.environ["QPID_SSL_CERT_DB"] else: - certdb = os.path.expanduser("~/.qpid/") + certdbloc = pwuid.pw_dir + "/.qpid/" if "QPID_SSL_CERT_NAME" in os.environ: certname = os.environ["QPID_SSL_CERT_NAME"] else: - certname = "guest" - certfile = os.path.join(certdb, certname + ".crt") - if ssl or (ssl is None and os.path.exists(certfile)): - keyfile = os.path.join(certdb, certname + ".key") - trustfile = os.path.join(certdb, "root.crt") - socket = qpid.util.ssl(socket, keyfile=keyfile, certfile=certfile, ca_certs=trustfile) - self.__connection = qpid.connection.Connection(sock=socket, username='guest', password='guest') - self.__connection.start() - self.__session = self.__connection.session(str(qpid.datatypes.uuid4())) - self.subscribed = True - self.__queueStarted = False + certname = QPID_USERNAME + + certfile = os.path.join(certdbloc, certname + ".crt") + certkey = os.path.join(certdbloc, certname + ".key") + if ssl or (ssl is None and os.path.isfile(certfile) and os.path.isfile(certkey)): + self.scheme = "amqps" + self.rest_scheme = 'https' + self.ssl_context = SSLContext(PROTOCOL_TLS) + self.ssl_context.load_cert_chain(certfile, certkey) + self.cert_file = certfile + self.cert_key = certkey + self.url = '{}://{}:{}@{}:{}'.format(self.scheme, QPID_USERNAME, QPID_PASSWORD, self.host, self.port) + self.clientID = ":".join([ + socket.gethostname(), + pwuid.pw_name, + program, + str(os.getpid()), + ]) def topicSubscribe(self, topicName, callback): + self.topicName = topicName + self.callback = callback + Container(self).run() + + def on_start(self, event): + ''' # if the queue is edex.alerts, set decompress to true always for now to # maintain compatibility with existing python scripts. - if topicName == 'edex.alerts': + ''' + if self.topicName == 'edex.alerts': self.decompress = True - print("Establishing connection to broker on", self.host) - queueName = topicName + self.__session.name - self.__session.queue_declare(queue=queueName, exclusive=True, auto_delete=True, - arguments={'qpid.max_count': 100, 'qpid.policy_type': 'ring'}) - self.__session.exchange_bind(exchange='amq.topic', queue=queueName, binding_key=topicName) - self.__innerSubscribe(queueName, callback) + self.container = event.container + queueName = 'amq.topic/' + self.topicName - def __innerSubscribe(self, serverQueueName, callback): - local_queue_name = 'local_queue_' + serverQueueName - queue = self.__session.incoming(local_queue_name) - self.__session.message_subscribe(serverQueueName, destination=local_queue_name) - queue.start() - print("Connection complete to broker on", self.host) + self.ssl_domain = None + if self.scheme == "amqps" and self.cert_file and self.cert_key: + self.ssl_domain = SSLDomain(mode=SSLDomain.MODE_CLIENT) + self.ssl_domain.set_credentials(self.cert_file, self.cert_key, SSL_PASSWORD) + + event.container.container_id = self.clientID + self.conn = event.container.connect(self.url, ssl_domain=self.ssl_domain) + self.receiver = event.container.create_receiver(self.conn, queueName) self.__queueStarted = True + self.__subscribed = True - while self.subscribed: + def on_message(self, event): + message = event.message + content = message.body + self.process_message(content) + if not self.__subscribed: + self.close() + + def process_message(self, content): + if (self.decompress): try: - message = queue.get(timeout=10) - content = message.body - self.__session.message_accept(qpid.datatypes.RangedSet(message.id)) - if self.decompress: - try: - # http://stackoverflow.com/questions/2423866/python-decompressing-gzip-chunk-by-chunk - d = zlib.decompressobj(16+zlib.MAX_WBITS) - content = d.decompress(content) - except ValueError: - # decompression failed, return the original content - pass - callback(content) - except Empty: + # http://stackoverflow.com/questions/2423866/python-decompressing-gzip-chunk-by-chunk + d = zlib.decompressobj(16 + zlib.MAX_WBITS) + content = d.decompress(content) + except Exception: + # decompression failed, return the original content pass - except Closed: - self.close() + self.callback(content) def close(self): self.__queueStarted = False - self.subscribed = False + self.unsubscribe() try: - self.__session.close(timeout=10) - except ValueError: + self.receiver.close() + self.conn.close() + except: + # already closed pass @property def queueStarted(self): return self.__queueStarted + + @property + def subscribed(self): + return self.__subscribed + + def unsubscribe(self): + self.__subscribed = False diff --git a/awips/ThriftClient.py b/awips/ThriftClient.py index 34c0e5c..4a856ca 100644 --- a/awips/ThriftClient.py +++ b/awips/ThriftClient.py @@ -1,80 +1,102 @@ -# -# Provides a Python-based interface for executing Thrift requests. -# -# -# -# SOFTWARE HISTORY -# -# Date Ticket# Engineer Description -# ------------ ---------- ----------- -------------------------- -# 09/20/10 dgilling Initial Creation. -# -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +import http.client -try: - import http.client as httpcl -except ImportError: - import httplib as httpcl from dynamicserialize import DynamicSerializationManager -class ThriftClient: +# +# Provides a Python-based interface for executing Thrift requests. +# +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 09/20/10 dgilling Initial Creation. +# +# +# + +class ThriftClient: + # How to call this constructor: - # 1. Pass in all arguments separately (e.g., + # 1. Pass in all arguments separately (e.g., # ThriftClient.ThriftClient("localhost", 9581, "/services")) # will return a Thrift client pointed at http://localhost:9581/services. - # 2. Pass in all arguments through the host string (e.g., + # 2. Pass in all arguments through the host string (e.g., # ThriftClient.ThriftClient("localhost:9581/services")) # will return a Thrift client pointed at http://localhost:9581/services. - # 3. Pass in host/port arguments through the host string (e.g., + # 3. Pass in host/port arguments through the host string (e.g., # ThriftClient.ThriftClient("localhost:9581", "/services")) # will return a Thrift client pointed at http://localhost:9581/services. def __init__(self, host, port=9581, uri="/services"): hostParts = host.split("/", 1) - if len(hostParts) > 1: + if (len(hostParts) > 1): hostString = hostParts[0] self.__uri = "/" + hostParts[1] - self.__httpConn = httpcl.HTTPConnection(hostString) + self.__httpConn = http.client.HTTPConnection(hostString) else: - if port is None: - self.__httpConn = httpcl.HTTPConnection(host) + if (port is None): + self.__httpConn = http.client.HTTPConnection(host) else: - self.__httpConn = httpcl.HTTPConnection(host, port) - + self.__httpConn = http.client.HTTPConnection(host, port) + self.__uri = uri - + self.__dsm = DynamicSerializationManager.DynamicSerializationManager() - + def sendRequest(self, request, uri="/thrift"): message = self.__dsm.serializeObject(request) - + self.__httpConn.connect() self.__httpConn.request("POST", self.__uri + uri, message) - + response = self.__httpConn.getresponse() - if response.status != 200: + if (response.status != 200): raise ThriftRequestException("Unable to post request to server") - + rval = self.__dsm.deserializeBytes(response.read()) self.__httpConn.close() - + # let's verify we have an instance of ServerErrorResponse # IF we do, through an exception up to the caller along # with the original Java stack trace # ELSE: we have a valid response and pass it back try: - forceError = rval.getException() - raise ThriftRequestException(forceError) + forceError = rval.getException() + raise ThriftRequestException(forceError) except AttributeError: pass - + return rval - - + + class ThriftRequestException(Exception): def __init__(self, value): self.parameter = value - + def __str__(self): return repr(self.parameter) + + \ No newline at end of file diff --git a/awips/TimeUtil.py b/awips/TimeUtil.py index 6543bea..3ea4773 100644 --- a/awips/TimeUtil.py +++ b/awips/TimeUtil.py @@ -1,3 +1,22 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## # ---------------------------------------------------------------------------- # This software is in the public domain, furnished "as is", without technical # support, and with no warranty, express or implied, as to its usefulness for @@ -9,9 +28,9 @@ # Author: hansen/romberg # ---------------------------------------------------------------------------- -import string import time + # Given the timeStr, return the offset (in seconds) # from the current time. # Also return the launchStr i.e. Programs launched from this @@ -20,7 +39,7 @@ import time # negative for time in the past. # # May still want it to be normalized to the most recent midnight. -# +# # NOTES about synchronizing: # --With synchronizing on, the "current time" for all processes started # within a given hour will be the same. @@ -33,7 +52,7 @@ import time # For example, if someone starts the GFE at 12:59 and someone # else starts it at 1:01, they will have different offsets and # current times. -# --With synchronizing off, when the process starts, the current time +# --With synchronizing off, when the process starts, the current time # matches the drtTime in the command line. However, with synchronizing # on, the current time will be offset by the fraction of the hour at # which the process was started. Examples: @@ -44,15 +63,14 @@ import time # Synchronizing on: # GFE Spatial Editor at StartUp: 20040616_0030 # - - def determineDrtOffset(timeStr): launchStr = timeStr # Check for time difference - if timeStr.find(",") >= 0: + if timeStr.find(",") >=0: times = timeStr.split(",") t1 = makeTime(times[0]) t2 = makeTime(times[1]) + #print "time offset", t1-t2, (t1-t2)/3600 return t1-t2, launchStr # Check for synchronized mode synch = 0 @@ -60,28 +78,30 @@ def determineDrtOffset(timeStr): timeStr = timeStr[1:] synch = 1 drt_t = makeTime(timeStr) + #print "input", year, month, day, hour, minute gm = time.gmtime() cur_t = time.mktime(gm) - + # Synchronize to most recent hour # i.e. "truncate" cur_t to most recent hour. + #print "gmtime", gm if synch: cur_t = time.mktime((gm[0], gm[1], gm[2], gm[3], 0, 0, 0, 0, 0)) - curStr = '%4s%2s%2s_%2s00\n' % (repr(gm[0]), repr(gm[1]), - repr(gm[2]), repr(gm[3])) - curStr = curStr.replace(' ', '0') + curStr = time.strftime('%Y%m%d_%H00\n', gm) launchStr = timeStr + "," + curStr - - offset = drt_t - cur_t + + #print "drt, cur", drt_t, cur_t + offset = drt_t - cur_t + #print "offset", offset, offset/3600, launchStr return int(offset), launchStr - def makeTime(timeStr): - year = string.atoi(timeStr[0:4]) - month = string.atoi(timeStr[4:6]) - day = string.atoi(timeStr[6:8]) - hour = string.atoi(timeStr[9:11]) - minute = string.atoi(timeStr[11:13]) + year = int(timeStr[0:4]) + month = int(timeStr[4:6]) + day = int(timeStr[6:8]) + hour = int(timeStr[9:11]) + minute = int(timeStr[11:13]) # Do not use daylight savings because gmtime is not in daylight # savings time. return time.mktime((year, month, day, hour, minute, 0, 0, 0, 0)) + diff --git a/awips/UsageArgumentParser.py b/awips/UsageArgumentParser.py index 66823fc..313d206 100644 --- a/awips/UsageArgumentParser.py +++ b/awips/UsageArgumentParser.py @@ -1,3 +1,22 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## # # SOFTWARE HISTORY # @@ -5,6 +24,7 @@ # ------------- -------- --------- --------------------------------------------- # Feb 13, 2017 6092 randerso Added StoreTimeAction # +## import argparse import sys @@ -15,7 +35,6 @@ from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects i TIME_FORMAT = "%Y%m%d_%H%M" - class UsageArgumentParser(argparse.ArgumentParser): """ A subclass of ArgumentParser that overrides error() to print the @@ -26,8 +45,7 @@ class UsageArgumentParser(argparse.ArgumentParser): self.print_help() sys.exit(2) - -# Custom actions for ArgumentParser objects +## Custom actions for ArgumentParser objects ## class StoreDatabaseIDAction(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): did = DatabaseID(values) @@ -36,19 +54,18 @@ class StoreDatabaseIDAction(argparse.Action): else: parser.error("DatabaseID [" + values + "] not a valid identifier") - class AppendParmNameAndLevelAction(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): tx = ParmID.parmNameAndLevel(values) comp = tx[0] + '_' + tx[1] - if (hasattr(namespace, self.dest)) and (getattr(namespace, self.dest) is not None): + if (hasattr(namespace, self.dest)) and \ + (getattr(namespace, self.dest) is not None): currentValues = getattr(namespace, self.dest) currentValues.append(comp) setattr(namespace, self.dest, currentValues) else: setattr(namespace, self.dest, [comp]) - class StoreTimeAction(argparse.Action): """ argparse.Action subclass to validate GFE formatted time strings @@ -57,6 +74,8 @@ class StoreTimeAction(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): try: timeStruct = time.strptime(values, TIME_FORMAT) - setattr(namespace, self.dest, timeStruct) - except ValueError: + except: parser.error(str(values) + " is not a valid time string of the format YYYYMMDD_hhmm") + + setattr(namespace, self.dest, timeStruct) + diff --git a/awips/UsageOptionParser.py b/awips/UsageOptionParser.py index 2f3ae77..0f2938f 100644 --- a/awips/UsageOptionParser.py +++ b/awips/UsageOptionParser.py @@ -1,7 +1,26 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + import sys from optparse import OptionParser - class UsageOptionParser(OptionParser): """ A subclass of OptionParser that prints that overrides error() to print the @@ -16,3 +35,4 @@ class UsageOptionParser(OptionParser): sys.stderr.write(msg) sys.stderr.write("\n") sys.exit(2) + diff --git a/awips/__init__.py b/awips/__init__.py index b6e95a6..6ed9ac6 100644 --- a/awips/__init__.py +++ b/awips/__init__.py @@ -1,3 +1,37 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## -__all__ = [ + +# +# __init__.py for ufpy package +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 09/21/10 dgilling Initial Creation. +# +# +# + + +__all__ = [ ] diff --git a/awips/dataaccess/CombinedTimeQuery.py b/awips/dataaccess/CombinedTimeQuery.py index 06651ee..fcf9ba4 100644 --- a/awips/dataaccess/CombinedTimeQuery.py +++ b/awips/dataaccess/CombinedTimeQuery.py @@ -1,23 +1,41 @@ +# # +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# # + # # Method for performing a DAF time query where all parameter/level/location # combinations must be available at the same time. # -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/22/16 #5591 bsteffen Initial Creation. # -from awips.dataaccess import DataAccessLayer - +from ufpy.dataaccess import DataAccessLayer def getAvailableTimes(request, refTimeOnly=False): return __getAvailableTimesForEachParameter(request, refTimeOnly) - def __getAvailableTimesForEachParameter(request, refTimeOnly=False): parameters = request.getParameters() if parameters: @@ -36,7 +54,6 @@ def __getAvailableTimesForEachParameter(request, refTimeOnly=False): else: return __getAvailableTimesForEachLevel(request, refTimeOnly) - def __getAvailableTimesForEachLevel(request, refTimeOnly=False): levels = request.getLevels() if levels: @@ -55,7 +72,6 @@ def __getAvailableTimesForEachLevel(request, refTimeOnly=False): else: return __getAvailableTimesForEachLocation(request, refTimeOnly) - def __getAvailableTimesForEachLocation(request, refTimeOnly=False): locations = request.getLocationNames() if locations: @@ -73,12 +89,12 @@ def __getAvailableTimesForEachLocation(request, refTimeOnly=False): return times else: return DataAccessLayer.getAvailableTimes(request, refTimeOnly) - - + + def __cloneRequest(request): - return DataAccessLayer.newDataRequest(datatype=request.getDatatype(), - parameters=request.getParameters(), - levels=request.getLevels(), - locationNames=request.getLocationNames(), - envelope=request.getEnvelope(), - **request.getIdentifiers()) + return DataAccessLayer.newDataRequest(datatype = request.getDatatype(), + parameters = request.getParameters(), + levels = request.getLevels(), + locationNames = request.getLocationNames(), + envelope = request.getEnvelope(), + **request.getIdentifiers()) \ No newline at end of file diff --git a/awips/dataaccess/DataAccessLayer.py b/awips/dataaccess/DataAccessLayer.py index 58943ce..d1d460c 100644 --- a/awips/dataaccess/DataAccessLayer.py +++ b/awips/dataaccess/DataAccessLayer.py @@ -1,33 +1,62 @@ +# # +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. # -# Published interface for awips.dataaccess package +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# # + + +# +# Published interface for ufpy.dataaccess package # # # SOFTWARE HISTORY # -# Date Ticket# Engineer Description -# ------------ ------- ---------- ------------------------- -# 12/10/12 njensen Initial Creation. -# Feb 14, 2013 1614 bsteffen refactor data access framework to use single request. -# 04/10/13 1871 mnash move getLatLonCoords to JGridData and add default args -# 05/29/13 2023 dgilling Hook up ThriftClientRouter. -# 03/03/14 2673 bsteffen Add ability to query only ref times. -# 07/22/14 3185 njensen Added optional/default args to newDataRequest -# 07/30/14 3185 njensen Renamed valid identifiers to optional -# Apr 26, 2015 4259 njensen Updated for new JEP API -# Apr 13, 2016 5379 tgurney Add getIdentifierValues(), getRequiredIdentifiers(), -# and getOptionalIdentifiers() -# Oct 07, 2016 ---- mjames@ucar Added getForecastRun -# Oct 18, 2016 5916 bsteffen Add setLazyLoadGridLatLon -# Oct 11, 2018 ---- mjames@ucar Added getMetarObs() getSynopticObs() +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 12/10/12 njensen Initial Creation. +# Feb 14, 2013 1614 bsteffen refactor data access framework +# to use single request. +# 04/10/13 1871 mnash move getLatLonCoords to JGridData and add default args +# 05/29/13 2023 dgilling Hook up ThriftClientRouter. +# 03/03/14 2673 bsteffen Add ability to query only ref times. +# 07/22/14 3185 njensen Added optional/default args to newDataRequest +# 07/30/14 3185 njensen Renamed valid identifiers to optional +# Apr 26, 2015 4259 njensen Updated for new JEP API +# Apr 13, 2016 5379 tgurney Add getIdentifierValues() +# Jun 01, 2016 5587 tgurney Add new signatures for +# getRequiredIdentifiers() and +# getOptionalIdentifiers() +# Oct 18, 2016 5916 bsteffen Add setLazyLoadGridLatLon +# # + import sys +import subprocess import warnings -THRIFT_HOST = "edex" +THRIFT_HOST = subprocess.check_output( + "source /awips2/fxa/bin/setup.env; echo $DEFAULT_HOST", + shell=True).decode().strip() + USING_NATIVE_THRIFT = False + if 'jep' in sys.modules: # intentionally do not catch if this fails to import, we want it to # be obvious that something is configured wrong when running from within @@ -35,152 +64,11 @@ if 'jep' in sys.modules: import JepRouter router = JepRouter else: - from awips.dataaccess import ThriftClientRouter + from ufpy.dataaccess import ThriftClientRouter router = ThriftClientRouter.ThriftClientRouter(THRIFT_HOST) USING_NATIVE_THRIFT = True -def getRadarProductIDs(availableParms): - """ - Get only the numeric idetifiers for NEXRAD3 products. - - Args: - availableParms: Full list of radar parameters - - Returns: - List of filtered parameters - """ - productIDs = [] - for p in list(availableParms): - try: - if isinstance(int(p), int): - productIDs.append(str(p)) - except ValueError: - pass - - return productIDs - - -def getRadarProductNames(availableParms): - """ - Get only the named idetifiers for NEXRAD3 products. - - Args: - availableParms: Full list of radar parameters - - Returns: - List of filtered parameters - """ - productNames = [] - for p in list(availableParms): - if len(p) > 3: - productNames.append(p) - - return productNames - - -def getMetarObs(response): - """ - Processes a DataAccessLayer "obs" response into a dictionary, - with special consideration for multi-value parameters - "presWeather", "skyCover", and "skyLayerBase". - - Args: - response: DAL getGeometry() list - - Returns: - A dictionary of METAR obs - """ - from datetime import datetime - single_val_params = ["timeObs", "stationName", "longitude", "latitude", - "temperature", "dewpoint", "windDir", - "windSpeed", "seaLevelPress"] - multi_val_params = ["presWeather", "skyCover", "skyLayerBase"] - params = single_val_params + multi_val_params - station_names, pres_weather, sky_cov, sky_layer_base = [], [], [], [] - obs = dict({params: [] for params in params}) - for ob in response: - avail_params = ob.getParameters() - if "presWeather" in avail_params: - pres_weather.append(ob.getString("presWeather")) - elif "skyCover" in avail_params and "skyLayerBase" in avail_params: - sky_cov.append(ob.getString("skyCover")) - sky_layer_base.append(ob.getNumber("skyLayerBase")) - else: - # If we already have a record for this stationName, skip - if ob.getString('stationName') not in station_names: - station_names.append(ob.getString('stationName')) - for param in single_val_params: - if param in avail_params: - if param == 'timeObs': - obs[param].append(datetime.fromtimestamp(ob.getNumber(param) / 1000.0)) - else: - try: - obs[param].append(ob.getNumber(param)) - except TypeError: - obs[param].append(ob.getString(param)) - else: - obs[param].append(None) - - obs['presWeather'].append(pres_weather) - obs['skyCover'].append(sky_cov) - obs['skyLayerBase'].append(sky_layer_base) - pres_weather = [] - sky_cov = [] - sky_layer_base = [] - return obs - - -def getSynopticObs(response): - """ - Processes a DataAccessLayer "sfcobs" response into a dictionary - of available parameters. - - Args: - response: DAL getGeometry() list - - Returns: - A dictionary of synop obs - """ - from datetime import datetime - station_names = [] - params = response[0].getParameters() - sfcobs = dict({params: [] for params in params}) - for sfcob in response: - # If we already have a record for this stationId, skip - if sfcob.getString('stationId') not in station_names: - station_names.append(sfcob.getString('stationId')) - for param in params: - if param == 'timeObs': - sfcobs[param].append(datetime.fromtimestamp(sfcob.getNumber(param) / 1000.0)) - else: - try: - sfcobs[param].append(sfcob.getNumber(param)) - except TypeError: - sfcobs[param].append(sfcob.getString(param)) - - return sfcobs - - -def getForecastRun(cycle, times): - """ - Get the latest forecast run (list of objects) from all - all cycles and times returned from DataAccessLayer "grid" - response. - - Args: - cycle: Forecast cycle reference time - times: All available times/cycles - - Returns: - DataTime array for a single forecast run - """ - fcstRun = [] - for t in times: - if str(t)[:19] == str(cycle): - fcstRun.append(t) - return fcstRun - def getAvailableTimes(request, refTimeOnly=False): """ @@ -189,7 +77,7 @@ def getAvailableTimes(request, refTimeOnly=False): Args: request: the IDataRequest to get data for refTimeOnly: optional, use True if only unique refTimes should be - returned (without a forecastHr) + returned (without a forecastHr) Returns: a list of DataTimes @@ -206,7 +94,7 @@ def getGridData(request, times=[]): Args: request: the IDataRequest to get data for times: a list of DataTimes, a TimeRange, or None if the data is time - agnostic + agnostic Returns: a list of IGridData @@ -223,10 +111,10 @@ def getGeometryData(request, times=[]): Args: request: the IDataRequest to get data for times: a list of DataTimes, a TimeRange, or None if the data is time - agnostic + agnostic Returns: - a list of IGeometryData + a list of IGeometryData """ return router.getGeometryData(request, times) @@ -319,9 +207,8 @@ def getIdentifierValues(request, identifierKey): """ return router.getIdentifierValues(request, identifierKey) - def newDataRequest(datatype=None, **kwargs): - """ + """" Creates a new instance of IDataRequest suitable for the runtime environment. All args are optional and exist solely for convenience. @@ -331,14 +218,13 @@ def newDataRequest(datatype=None, **kwargs): levels: a list of levels to set on the request locationNames: a list of locationNames to set on the request envelope: an envelope to limit the request - kwargs: any leftover kwargs will be set as identifiers + **kwargs: any leftover kwargs will be set as identifiers Returns: a new IDataRequest """ return router.newDataRequest(datatype, **kwargs) - def getSupportedDatatypes(): """ Gets the datatypes that are supported by the framework @@ -356,7 +242,7 @@ def changeEDEXHost(newHostName): method will throw a TypeError. Args: - newHostName: the EDEX host to connect to + newHostHame: the EDEX host to connect to """ if USING_NATIVE_THRIFT: global THRIFT_HOST @@ -366,7 +252,6 @@ def changeEDEXHost(newHostName): else: raise TypeError("Cannot call changeEDEXHost when using JepRouter.") - def setLazyLoadGridLatLon(lazyLoadGridLatLon): """ Provide a hint to the Data Access Framework indicating whether to load the @@ -379,7 +264,7 @@ def setLazyLoadGridLatLon(lazyLoadGridLatLon): set to False if it is guaranteed that all lat/lon information is needed and it would be better to get any performance overhead for generating the lat/lon data out of the way during the initial request. - + Args: lazyLoadGridLatLon: Boolean value indicating whether to lazy load. @@ -388,4 +273,4 @@ def setLazyLoadGridLatLon(lazyLoadGridLatLon): router.setLazyLoadGridLatLon(lazyLoadGridLatLon) except AttributeError: # The router is not required to support this capability. - pass + pass \ No newline at end of file diff --git a/awips/dataaccess/DataNotificationLayer.py b/awips/dataaccess/DataNotificationLayer.py index d1297fd..cb06c6f 100644 --- a/awips/dataaccess/DataNotificationLayer.py +++ b/awips/dataaccess/DataNotificationLayer.py @@ -1,13 +1,34 @@ +# # +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. # -# Published interface for retrieving data updates via awips.dataaccess package +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. # +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 # -# SOFTWARE HISTORY +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# # + # -# Date Ticket# Engineer Description -# ------------ ---------- ----------- -------------------------- -# May 26, 2016 2416 rjpeter Initial Creation. -# Aug 1, 2016 2416 tgurney Finish implementation +# Published interface for retrieving data updates via ufpy.dataaccess package +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------- -------- ------------ -------------------------------------------- +# May 26, 2016 2416 rjpeter Initial Creation. +# Aug 01, 2016 2416 tgurney Finish implementation +# Nov 05, 2019 7884 tgurney Python 3 fixes +# Jun 24, 2020 8187 randerso Added program for qpid connection_id # # @@ -17,7 +38,7 @@ retrieval of new data as it is coming into the system. There are two ways to access this feature: -1. The DataQueue module (awips.dataaccess.DataQueue) offers a collection that +1. The DataQueue module (ufpy.dataaccess.DataQueue) offers a collection that automatically fills up with new data as it receives notifications. See that module for more information. @@ -29,8 +50,8 @@ each time new data is received. Example code follows. This example prints temperature as observed from KOMA each time a METAR is received from there. - from awips.dataaccess import DataAccessLayer as DAL - from awips.dataaccess import DataNotificationLayer as DNL + from ufpy.dataaccess import DataAccessLayer as DAL + from ufpy.dataaccess import DataNotificationLayer as DNL def process_obs(list_of_data): for item in list_of_data: @@ -39,25 +60,25 @@ each time a METAR is received from there. request = DAL.newDataRequest('obs') request.setParameters('temperature') request.setLocationNames('KOMA') - + notifier = DNL.getGeometryDataUpdates(request) notifier.subscribe(process_obs) # process_obs will called with a list of data each time new data comes in """ -import re import sys -from awips.dataaccess.PyGeometryNotification import PyGeometryNotification -from awips.dataaccess.PyGridNotification import PyGridNotification +import subprocess +from ufpy.dataaccess.PyGeometryNotification import PyGeometryNotification +from ufpy.dataaccess.PyGridNotification import PyGridNotification -THRIFT_HOST = "edex" +THRIFT_HOST = subprocess.check_output( + "source /awips2/fxa/bin/setup.env; echo $DEFAULT_HOST", + shell=True).decode().strip() USING_NATIVE_THRIFT = False -JMS_HOST_PATTERN = re.compile('tcp://([^:]+):([0-9]+)') - if 'jep' in sys.modules: # intentionally do not catch if this fails to import, we want it to # be obvious that something is configured wrong when running from within @@ -65,7 +86,7 @@ if 'jep' in sys.modules: import JepRouter router = JepRouter else: - from awips.dataaccess import ThriftClientRouter + from ufpy.dataaccess import ThriftClientRouter router = ThriftClientRouter.ThriftClientRouter(THRIFT_HOST) USING_NATIVE_THRIFT = True @@ -73,9 +94,9 @@ else: def _getJmsConnectionInfo(notifFilterResponse): serverString = notifFilterResponse.getJmsConnectionInfo() try: - host, port = JMS_HOST_PATTERN.match(serverString).groups() - except AttributeError: - raise RuntimeError('Got bad JMS connection info from server: ' + serverString) + host, port = serverString.split(':') + except Exception as e: + raise ValueError('Got bad JMS connection info from server: "' + serverString + '"') from e return {'host': host, 'port': port} @@ -91,10 +112,9 @@ def getGridDataUpdates(request): calling its subscribe() method """ response = router.getNotificationFilter(request) - notificationFilter = response.getNotificationFilter() + filter = response.getNotificationFilter() jmsInfo = _getJmsConnectionInfo(response) - notifier = PyGridNotification(request, notificationFilter, - requestHost=THRIFT_HOST, **jmsInfo) + notifier = PyGridNotification(request, filter, requestHost=THRIFT_HOST, program="daf-gridDataUpdates", **jmsInfo) return notifier @@ -110,10 +130,9 @@ def getGeometryDataUpdates(request): calling its subscribe() method """ response = router.getNotificationFilter(request) - notificationFilter = response.getNotificationFilter() + filter = response.getNotificationFilter() jmsInfo = _getJmsConnectionInfo(response) - notifier = PyGeometryNotification(request, notificationFilter, - requestHost=THRIFT_HOST, **jmsInfo) + notifier = PyGeometryNotification(request, filter, requestHost=THRIFT_HOST, program="daf-geometryDataUpdates", **jmsInfo) return notifier @@ -124,7 +143,7 @@ def changeEDEXHost(newHostName): method will throw a TypeError. Args: - newHostName: the EDEX host to connect to + newHostHame: the EDEX host to connect to """ if USING_NATIVE_THRIFT: global THRIFT_HOST diff --git a/awips/dataaccess/DataQueue.py b/awips/dataaccess/DataQueue.py index 2ea2d71..c37339e 100644 --- a/awips/dataaccess/DataQueue.py +++ b/awips/dataaccess/DataQueue.py @@ -1,3 +1,23 @@ +# # +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# # + # # Convenience class for using the DAF's notifications feature. This is a # collection that, once connected to EDEX by calling start(), fills with @@ -13,25 +33,24 @@ # 07/29/16 2416 tgurney Initial creation # -from awips.dataaccess import DataNotificationLayer as DNL +from ufpy.dataaccess import DataNotificationLayer as DNL import time from threading import Thread -import sys -if sys.version_info.major == 2: - from Queue import Queue, Empty -else: # Python 3 module renamed to 'queue' - from queue import Queue, Empty +from queue import Queue, Empty -# Used to indicate a DataQueue that will produce geometry data. + +"""Used to indicate a DataQueue that will produce geometry data.""" GEOMETRY = object() -# Used to indicate a DataQueue that will produce grid data. + +"""Used to indicate a DataQueue that will produce grid data.""" GRID = object() -# Default maximum queue size. + +"""Default maximum queue size.""" _DEFAULT_MAXSIZE = 100 @@ -128,12 +147,12 @@ class DataQueue(object): return self._queue.get(block, timeout) except Empty: return None - + def get_all(self): """ Get all data waiting for processing, in a single list. Always returns immediately. Returns an empty list if no data has arrived yet. - + Returns: List of IData """ @@ -187,4 +206,4 @@ class DataQueue(object): return self def __exit__(self, *unused): - self.close() + self.close() \ No newline at end of file diff --git a/awips/dataaccess/PyData.py b/awips/dataaccess/PyData.py index 01e3150..757105b 100644 --- a/awips/dataaccess/PyData.py +++ b/awips/dataaccess/PyData.py @@ -1,23 +1,40 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + # # Implements IData for use by native Python clients to the Data Access # Framework. -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/03/13 dgilling Initial Creation. -# 10/05/18 mjames@ucar Encode/decode attribute names. -# +# # -from awips.dataaccess import IData -import six - +from ufpy.dataaccess import IData class PyData(IData): - + def __init__(self, dataRecord): self.__time = dataRecord.getTime() self.__level = dataRecord.getLevel() @@ -26,19 +43,15 @@ class PyData(IData): def getAttribute(self, key): return self.__attributes[key] - + def getAttributes(self): - return self.__attributes.keys() - + return list(self.__attributes.keys()) + def getDataTime(self): return self.__time - + def getLevel(self): - if six.PY2: - return self.__level - if not isinstance(self.__level, str): - return self.__level.decode('utf-8') return self.__level - + def getLocationName(self): return self.__locationName diff --git a/awips/dataaccess/PyGeometryData.py b/awips/dataaccess/PyGeometryData.py index cc09f2c..cacd387 100644 --- a/awips/dataaccess/PyGeometryData.py +++ b/awips/dataaccess/PyGeometryData.py @@ -1,81 +1,76 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + # # Implements IGeometryData for use by native Python clients to the Data Access # Framework. -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/03/13 dgilling Initial Creation. # 01/06/14 2537 bsteffen Share geometry WKT. # 03/19/14 2882 dgilling Raise an exception when getNumber() -# is called for data that is not a +# is called for data that is not a # numeric Type. # 06/09/16 5574 mapeters Handle 'SHORT' type in getNumber(). -# 10/05/18 mjames@ucar Encode/decode string, number val, and type -# +# # -from awips.dataaccess import IGeometryData -from awips.dataaccess import PyData -import six - +from ufpy.dataaccess import IGeometryData +from ufpy.dataaccess import PyData class PyGeometryData(IGeometryData, PyData.PyData): - + def __init__(self, geoDataRecord, geometry): PyData.PyData.__init__(self, geoDataRecord) self.__geometry = geometry self.__dataMap = {} tempDataMap = geoDataRecord.getDataMap() - for key, value in list(tempDataMap.items()): + for key, value in tempDataMap.items(): self.__dataMap[key] = (value[0], value[1], value[2]) def getGeometry(self): return self.__geometry - - def getParameters(self): - if six.PY2: - return list(self.__dataMap.keys()) - else: - return [x.decode('utf-8') for x in list(self.__dataMap.keys())] - + + def getParameters(self): + return list(self.__dataMap.keys()) + def getString(self, param): - if six.PY2: - return self.__dataMap[param][0] - value = self.__dataMap[param.encode('utf-8')][0] - if isinstance(value, bytes): - return str(value.decode('utf-8')) + value = self.__dataMap[param][0] return str(value) - - def getNumber(self, param): - t = self.getType(param) - if six.PY2: - value = self.__dataMap[param][0] - else: - value = self.__dataMap[param.encode('utf-8')][0] - if t == 'INT' or t == 'SHORT' or t == 'LONG': + + def getNumber(self, param): + value = self.__dataMap[param][0] + t = self.getType(param) + if t in ('INT', 'SHORT', 'LONG'): return int(value) - elif t == 'FLOAT': - return float(value) - elif t == 'DOUBLE': + elif t in ('DOUBLE', 'FLOAT'): return float(value) else: raise TypeError("Data for parameter " + param + " is not a numeric type.") - + def getUnit(self, param): - if six.PY2: - return self.__dataMap[param][2] - unit = self.__dataMap[param.encode('utf-8')][2] - if unit is not None: - return unit.decode('utf-8') - return unit - + return self.__dataMap[param][2] + def getType(self, param): - if six.PY2: - return self.__dataMap[param][1] - datatype = self.__dataMap[param.encode('utf-8')][1] - if datatype is not None: - return datatype.decode('utf-8') - return datatype + return self.__dataMap[param][1] diff --git a/awips/dataaccess/PyGeometryNotification.py b/awips/dataaccess/PyGeometryNotification.py index 8884d43..a8b433e 100644 --- a/awips/dataaccess/PyGeometryNotification.py +++ b/awips/dataaccess/PyGeometryNotification.py @@ -1,19 +1,39 @@ +# # +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# # + # # Notification object that produces geometry data -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 07/22/16 2416 tgurney Initial creation -# 09/07/17 6175 tgurney Override messageReceived +# 07/22/2016 2416 tgurney Initial creation +# 09/07/2017 6175 tgurney Override messageReceived +# 11/05/2019 7884 tgurney Add missing import # -import traceback import dynamicserialize -from awips.dataaccess.PyNotification import PyNotification - +import traceback +from ufpy.dataaccess.PyNotification import PyNotification class PyGeometryNotification(PyNotification): @@ -28,7 +48,7 @@ class PyGeometryNotification(PyNotification): try: data = self.getData(self.request, list(dataTimes)) self.callback(data) - except ValueError: + except Exception as e: traceback.print_exc() def getData(self, request, dataTimes): diff --git a/awips/dataaccess/PyGridData.py b/awips/dataaccess/PyGridData.py index 4dece5b..991e1d9 100644 --- a/awips/dataaccess/PyGridData.py +++ b/awips/dataaccess/PyGridData.py @@ -1,25 +1,45 @@ +# # +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# # + # # Implements IGridData for use by native Python clients to the Data Access # Framework. -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/03/13 #2023 dgilling Initial Creation. # 10/13/16 #5916 bsteffen Correct grid shape, allow lat/lon # 11/10/16 #5900 bsteffen Correct grid shape # to be requested by a delegate +# # -# + import numpy import warnings -import six -from awips.dataaccess import IGridData -from awips.dataaccess import PyData +from ufpy.dataaccess import IGridData +from ufpy.dataaccess import PyData NO_UNIT_CONVERT_WARNING = """ The ability to unit convert grid data is not currently available in this version of the Data Access Framework. @@ -27,8 +47,8 @@ The ability to unit convert grid data is not currently available in this version class PyGridData(IGridData, PyData.PyData): - - def __init__(self, gridDataRecord, nx, ny, latLonGrid=None, latLonDelegate=None): + + def __init__(self, gridDataRecord, nx, ny, latLonGrid = None, latLonDelegate = None): PyData.PyData.__init__(self, gridDataRecord) nx = nx ny = ny @@ -38,16 +58,13 @@ class PyGridData(IGridData, PyData.PyData): self.__latLonGrid = latLonGrid self.__latLonDelegate = latLonDelegate + def getParameter(self): return self.__parameter - + def getUnit(self): - if six.PY2: - return self.__unit - if self.__unit is not None and not isinstance(self.__unit, str): - return self.__unit.decode('utf-8') return self.__unit - + def getRawData(self, unit=None): # TODO: Find a proper python library that deals will with numpy and # javax.measure style unit strings and hook it in to this method to @@ -55,7 +72,7 @@ class PyGridData(IGridData, PyData.PyData): if unit is not None: warnings.warn(NO_UNIT_CONVERT_WARNING, stacklevel=2) return self.__gridData - + def getLatLonCoords(self): if self.__latLonGrid is not None: return self.__latLonGrid diff --git a/awips/dataaccess/PyGridNotification.py b/awips/dataaccess/PyGridNotification.py index 340fb65..ff57f69 100644 --- a/awips/dataaccess/PyGridNotification.py +++ b/awips/dataaccess/PyGridNotification.py @@ -1,3 +1,23 @@ +# # +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# # + # # Notification object that produces grid data # @@ -6,14 +26,14 @@ # # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 06/03/16 2416 rjpeter Initial Creation. -# 09/06/17 6175 tgurney Override messageReceived +# 06/03/2016 2416 rjpeter Initial Creation. +# 09/06/2017 6175 tgurney Override messageReceived +# 11/05/2019 7884 tgurney Add missing import # import dynamicserialize import traceback -from awips.dataaccess.PyNotification import PyNotification - +from ufpy.dataaccess.PyNotification import PyNotification class PyGridNotification(PyNotification): @@ -33,7 +53,7 @@ class PyGridNotification(PyNotification): newReq.setParameters(self.request.getParameters()) data = self.getData(newReq, []) self.callback(data) - except ValueError: + except Exception as e: traceback.print_exc() def getData(self, request, dataTimes): diff --git a/awips/dataaccess/PyNotification.py b/awips/dataaccess/PyNotification.py index f24851c..86e9842 100644 --- a/awips/dataaccess/PyNotification.py +++ b/awips/dataaccess/PyNotification.py @@ -1,39 +1,61 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + # # Implements IData for use by native Python clients to the Data Access # Framework. # +# SOFTWARE HISTORY # -# SOFTWARE HISTORY -# -# Date Ticket# Engineer Description -# ------------ ---------- ----------- -------------------------- -# Jun 22, 2016 2416 rjpeter Initial creation -# Jul 22, 2016 2416 tgurney Finish implementation -# Sep 07, 2017 6175 tgurney Override messageReceived in subclasses +# Date Ticket# Engineer Description +# ------------- -------- ------------ -------------------------------------------- +# Jun 22, 2016 2416 rjpeter Initial creation +# Jul 22, 2016 2416 tgurney Finish implementation +# Sep 07, 2017 6175 tgurney Override messageReceived in subclasses +# Nov 05, 2019 7884 tgurney Fix in subscribed() +# Jun 24, 2020 8187 randerso Added program for qpid connection_id # -from six import with_metaclass + import abc -from awips.dataaccess import DataAccessLayer -from awips.dataaccess import INotificationSubscriber -from awips.QpidSubscriber import QpidSubscriber +from ufpy.dataaccess import DataAccessLayer +from ufpy.dataaccess import INotificationSubscriber +from ufpy.QpidSubscriber import QpidSubscriber from dynamicserialize.dstypes.com.raytheon.uf.common.time import DataTime -class PyNotification(with_metaclass(abc.ABCMeta, INotificationSubscriber)): +class PyNotification(INotificationSubscriber, metaclass=abc.ABCMeta): """ Receives notifications for new data and retrieves the data that meets specified filtering criteria. """ - def __init__(self, request, notificationFilter, host='localhost', - port=5672, requestHost='localhost'): + def __init__(self, request, filter, host='localhost', port=5672, requestHost='localhost', program="PyNotification"): self.DAL = DataAccessLayer self.DAL.changeEDEXHost(requestHost) self.request = request - self.notificationFilter = notificationFilter - self.__topicSubscriber = QpidSubscriber(host, port, decompress=True) + self.notificationFilter = filter + self.host = host + self.port = port + self.program=program self.__topicName = "edex.alerts" self.callback = None @@ -47,12 +69,12 @@ class PyNotification(with_metaclass(abc.ABCMeta, INotificationSubscriber)): """ assert hasattr(callback, '__call__'), 'callback arg must be callable' self.callback = callback - self.__topicSubscriber.topicSubscribe(self.__topicName, self.messageReceived) + self.qs = QpidSubscriber(host=self.host, port=self.port, decompress=True, program=self.program) + self.qs.topicSubscribe(self.__topicName, self.messageReceived) # Blocks here def close(self): - if self.__topicSubscriber.subscribed: - self.__topicSubscriber.close() + self.qs.close() def getDataTime(self, dataURI): dataTimeStr = dataURI.split('/')[2] @@ -82,4 +104,7 @@ class PyNotification(with_metaclass(abc.ABCMeta, INotificationSubscriber)): @property def subscribed(self): """True if currently subscribed to notifications.""" - return self.__topicSubscriber.queueStarted + try: + return self.qs.queueStarted + except AttributeError: + return False diff --git a/awips/dataaccess/SoundingsSupport.py b/awips/dataaccess/SoundingsSupport.py new file mode 100644 index 0000000..f5474cc --- /dev/null +++ b/awips/dataaccess/SoundingsSupport.py @@ -0,0 +1,283 @@ +# # +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# # + +# +# Classes for retrieving soundings based on gridded data from the Data Access +# Framework +# +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 06/24/15 #4480 dgilling Initial Creation. +# + +from collections import defaultdict +from shapely.geometry import Point + +from ufpy import DateTimeConverter +from ufpy.dataaccess import DataAccessLayer + +from dynamicserialize.dstypes.com.raytheon.uf.common.time import DataTime +from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.level import Level + + +def getSounding(modelName, weatherElements, levels, samplePoint, refTime=None, timeRange=None): + """" + Performs a series of Data Access Framework requests to retrieve a sounding object + based on the specified request parameters. + + Args: + modelName: the grid model datasetid to use as the basis of the sounding. + weatherElements: a list of parameters to return in the sounding. + levels: a list of levels to sample the given weather elements at + samplePoint: a lat/lon pair to perform the sampling of data at. + refTime: (optional) the grid model reference time to use for the sounding. + If not specified, the latest ref time in the system will be used. + timeRange: (optional) a TimeRange to specify which forecast hours to use. + If not specified, will default to all forecast hours. + + Returns: + A _SoundingCube instance, which acts a 3-tiered dictionary, keyed + by DataTime, then by level and finally by weather element. If no + data is available for the given request parameters, None is returned. + """ + + (locationNames, parameters, levels, envelope, refTime, timeRange) = \ + __sanitizeInputs(modelName, weatherElements, levels, samplePoint, refTime, timeRange) + + requestArgs = { 'datatype' : 'grid', + 'locationNames' : locationNames, + 'parameters' : parameters, + 'levels' : levels, + 'envelope' : envelope, + } + + req = DataAccessLayer.newDataRequest(**requestArgs) + + forecastHours = __determineForecastHours(req, refTime, timeRange) + if not forecastHours: + return None + + response = DataAccessLayer.getGeometryData(req, forecastHours) + soundingObject = _SoundingCube(response) + + return soundingObject + +def setEDEXHost(host): + """ + Changes the EDEX host the Data Access Framework is communicating with. + + Args: + host: the EDEX host to connect to + """ + + if host: + DataAccessLayer.changeEDEXHost(str(host)) + +def __sanitizeInputs(modelName, weatherElements, levels, samplePoint, refTime, timeRange): + locationNames = [str(modelName)] + parameters = __buildStringList(weatherElements) + levels = __buildStringList(levels) + envelope = Point(samplePoint) + if refTime is not None: + refTime = DataTime(refTime=DateTimeConverter.convertToDateTime(refTime)) + if timeRange is not None: + timeRange = DateTimeConverter.constructTimeRange(*timeRange) + return (locationNames, parameters, levels, envelope, refTime, timeRange) + +def __determineForecastHours(request, refTime, timeRange): + dataTimes = DataAccessLayer.getAvailableTimes(request, False) + timesGen = [(DataTime(refTime=dataTime.getRefTime()), dataTime) for dataTime in dataTimes] + dataTimesMap = defaultdict(list) + for baseTime, dataTime in timesGen: + dataTimesMap[baseTime].append(dataTime) + + if refTime is None: + refTime = max(dataTimesMap.keys()) + + forecastHours = dataTimesMap[refTime] + if timeRange is None: + return forecastHours + else: + return [forecastHour for forecastHour in forecastHours if timeRange.contains(forecastHour.getValidPeriod())] + +def __buildStringList(param): + if __notStringIter(param): + return [str(item) for item in param] + else: + return [str(param)] + +def __notStringIter(iterable): + if not isinstance(iterable, str): + try: + iter(iterable) + return True + except TypeError: + return False + + + +class _SoundingCube(object): + """ + The top-level sounding object returned when calling SoundingsSupport.getSounding. + + This object acts as a 3-tiered dict which is keyed by time then level + then parameter name. Calling times() will return all valid keys into this + object. + """ + + def __init__(self, geometryDataObjects): + self._dataDict = {} + self._sortedTimes = [] + if geometryDataObjects: + for geometryData in geometryDataObjects: + dataTime = geometryData.getDataTime() + level = geometryData.getLevel() + for parameter in geometryData.getParameters(): + self.__addItem(parameter, dataTime, level, geometryData.getNumber(parameter)) + + def __addItem(self, parameter, dataTime, level, value): + timeLayer = self._dataDict.get(dataTime, _SoundingTimeLayer(dataTime)) + self._dataDict[dataTime] = timeLayer + timeLayer._addItem(parameter, level, value) + if dataTime not in self._sortedTimes: + self._sortedTimes.append(dataTime) + self._sortedTimes.sort() + + def __getitem__(self, key): + return self._dataDict[key] + + def __len__(self): + return len(self._dataDict) + + def times(self): + """ + Returns the valid times for this sounding. + + Returns: + A list containing the valid DataTimes for this sounding in order. + """ + return self._sortedTimes + + +class _SoundingTimeLayer(object): + """ + The second-level sounding object returned when calling SoundingsSupport.getSounding. + + This object acts as a 2-tiered dict which is keyed by level then parameter + name. Calling levels() will return all valid keys into this + object. Calling time() will return the DataTime for this particular layer. + """ + + def __init__(self, dataTime): + self._dataTime = dataTime + self._dataDict = {} + + def _addItem(self, parameter, level, value): + asString = str(level) + levelLayer = self._dataDict.get(asString, _SoundingTimeAndLevelLayer(self._dataTime, asString)) + levelLayer._addItem(parameter, value) + self._dataDict[asString] = levelLayer + + def __getitem__(self, key): + asString = str(key) + if asString in self._dataDict: + return self._dataDict[asString] + else: + raise KeyError("Level " + str(key) + " is not a valid level for this sounding.") + + def __len__(self): + return len(self._dataDict) + + def time(self): + """ + Returns the DataTime for this sounding cube layer. + + Returns: + The DataTime for this sounding layer. + """ + return self._dataTime + + def levels(self): + """ + Returns the valid levels for this sounding. + + Returns: + A list containing the valid levels for this sounding in order of + closest to surface to highest from surface. + """ + sortedLevels = [Level(level) for level in list(self._dataDict.keys())] + sortedLevels.sort() + return [str(level) for level in sortedLevels] + + +class _SoundingTimeAndLevelLayer(object): + """ + The bottom-level sounding object returned when calling SoundingsSupport.getSounding. + + This object acts as a dict which is keyed by parameter name. Calling + parameters() will return all valid keys into this object. Calling time() + will return the DataTime for this particular layer. Calling level() will + return the level for this layer. + """ + + def __init__(self, time, level): + self._time = time + self._level = level + self._parameters = {} + + def _addItem(self, parameter, value): + self._parameters[parameter] = value + + def __getitem__(self, key): + return self._parameters[key] + + def __len__(self): + return len(self._parameters) + + def level(self): + """ + Returns the level for this sounding cube layer. + + Returns: + The level for this sounding layer. + """ + return self._level + + def parameters(self): + """ + Returns the valid parameters for this sounding. + + Returns: + A list containing the valid parameter names. + """ + return list(self._parameters.keys()) + + def time(self): + """ + Returns the DataTime for this sounding cube layer. + + Returns: + The DataTime for this sounding layer. + """ + return self._time diff --git a/awips/dataaccess/ThriftClientRouter.py b/awips/dataaccess/ThriftClientRouter.py index 7637bc8..713011e 100644 --- a/awips/dataaccess/ThriftClientRouter.py +++ b/awips/dataaccess/ThriftClientRouter.py @@ -1,7 +1,28 @@ +# # +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# # + # # Routes requests to the Data Access Framework through Python Thrift. # # +# # SOFTWARE HISTORY # # Date Ticket# Engineer Description @@ -22,8 +43,8 @@ # 10/26/16 5919 njensen Speed up geometry creation in getGeometryData() # + import numpy -import six import shapely.wkb from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.impl import DefaultDataRequest @@ -40,9 +61,9 @@ from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import G from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import GetSupportedDatatypesRequest from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import GetNotificationFilterRequest -from awips import ThriftClient -from awips.dataaccess import PyGeometryData -from awips.dataaccess import PyGridData +from ufpy import ThriftClient +from ufpy.dataaccess import PyGeometryData +from ufpy.dataaccess import PyGridData class LazyGridLatLon(object): @@ -121,13 +142,7 @@ class ThriftClientRouter(object): retVal = [] for gridDataRecord in response.getGridData(): locationName = gridDataRecord.getLocationName() - if locationName is not None: - if six.PY2: - locData = locSpecificData[locationName] - else: - locData = locSpecificData[locationName.encode('utf-8')] - else: - locData = locSpecificData[locationName] + locData = locSpecificData[locationName] if self._lazyLoadGridLatLon: retVal.append(PyGridData.PyGridData(gridDataRecord, locData[ 0], locData[1], latLonDelegate=locData[2])) @@ -165,20 +180,12 @@ class ThriftClientRouter(object): locNamesRequest = GetAvailableLocationNamesRequest() locNamesRequest.setRequestParameters(request) response = self._client.sendRequest(locNamesRequest) - if six.PY2: - return response - if response is not None: - return [x.decode('utf-8') for x in response] return response def getAvailableParameters(self, request): paramReq = GetAvailableParametersRequest() paramReq.setRequestParameters(request) response = self._client.sendRequest(paramReq) - if six.PY2: - return response - if response is not None: - return [x.decode('utf-8') for x in response] return response def getAvailableLevels(self, request): @@ -194,10 +201,6 @@ class ThriftClientRouter(object): idReq = GetRequiredIdentifiersRequest() idReq.setRequest(request) response = self._client.sendRequest(idReq) - if six.PY2: - return response - if response is not None: - return [x.decode('utf-8') for x in response] return response def getOptionalIdentifiers(self, request): @@ -207,10 +210,6 @@ class ThriftClientRouter(object): idReq = GetOptionalIdentifiersRequest() idReq.setRequest(request) response = self._client.sendRequest(idReq) - if six.PY2: - return response - if response is not None: - return [x.decode('utf-8') for x in response] return response def getIdentifierValues(self, request, identifierKey): @@ -218,14 +217,9 @@ class ThriftClientRouter(object): idValReq.setIdentifierKey(identifierKey) idValReq.setRequestParameters(request) response = self._client.sendRequest(idValReq) - if six.PY2: - return response - if response is not None: - return [x.decode('utf-8') for x in response] return response - def newDataRequest(self, datatype, parameters=[], levels=[], locationNames=[], - envelope=None, **kwargs): + def newDataRequest(self, datatype, parameters=[], levels=[], locationNames=[], envelope=None, **kwargs): req = DefaultDataRequest() if datatype: req.setDatatype(datatype) @@ -244,10 +238,6 @@ class ThriftClientRouter(object): def getSupportedDatatypes(self): response = self._client.sendRequest(GetSupportedDatatypesRequest()) - if six.PY2: - return response - if response is not None: - return [x.decode('utf-8') for x in response] return response def getNotificationFilter(self, request): diff --git a/awips/dataaccess/__init__.py b/awips/dataaccess/__init__.py index 14a7fbf..48a2dda 100644 --- a/awips/dataaccess/__init__.py +++ b/awips/dataaccess/__init__.py @@ -1,5 +1,26 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. # -# __init__.py for awips.dataaccess package +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +# +# __init__.py for ufpy.dataaccess package # # # SOFTWARE HISTORY @@ -18,20 +39,12 @@ # __all__ = [ - 'IData', - 'IDataRequest', - 'IGeometryData', - 'IGridData', - 'IGeometryData', - 'INotificationFilter', - 'INotificationSubscriber' -] + + ] import abc -from six import with_metaclass - -class IDataRequest(with_metaclass(abc.ABCMeta, object)): +class IDataRequest(object, metaclass=abc.ABCMeta): """ An IDataRequest to be submitted to the DataAccessLayer to retrieve data. """ @@ -151,7 +164,8 @@ class IDataRequest(with_metaclass(abc.ABCMeta, object)): return -class IData(with_metaclass(abc.ABCMeta, object)): + +class IData(object, metaclass=abc.ABCMeta): """ An IData representing data returned from the DataAccessLayer. """ @@ -211,6 +225,7 @@ class IData(with_metaclass(abc.ABCMeta, object)): return + class IGridData(IData): """ An IData representing grid data that is returned by the DataAccessLayer. @@ -258,6 +273,7 @@ class IGridData(IData): return + class IGeometryData(IData): """ An IData representing geometry data that is returned by the DataAccessLayer. @@ -336,7 +352,7 @@ class IGeometryData(IData): return -class INotificationSubscriber(with_metaclass(abc.ABCMeta, object)): +class INotificationSubscriber(object, metaclass=abc.ABCMeta): """ An INotificationSubscriber representing a notification filter returned from the DataNotificationLayer. @@ -359,8 +375,7 @@ class INotificationSubscriber(with_metaclass(abc.ABCMeta, object)): """Closes the notification subscriber""" pass - -class INotificationFilter(with_metaclass(abc.ABCMeta, object)): +class INotificationFilter(object, metaclass=abc.ABCMeta): """ Represents data required to filter a set of URIs and return a corresponding list of IDataRequest to retrieve data for. diff --git a/awips/gfe/IFPClient.py b/awips/gfe/IFPClient.py index 6fbc1e6..1288094 100644 --- a/awips/gfe/IFPClient.py +++ b/awips/gfe/IFPClient.py @@ -1,16 +1,25 @@ -# -# Provides a Python-based interface for executing GFE requests. -# -# -# SOFTWARE HISTORY -# -# Date Ticket# Engineer Description -# ------------ ---------- ----------- -------------------------- -# 07/26/12 dgilling Initial Creation. -# -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +from ufpy import ThriftClient -from awips import ThriftClient from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import DatabaseID from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import ParmID from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request import CommitGridsRequest @@ -23,6 +32,21 @@ from dynamicserialize.dstypes.com.raytheon.uf.common.site.requests import GetAct from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.server.message import ServerResponse +# +# Provides a Python-based interface for executing GFE requests. +# +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 07/26/12 dgilling Initial Creation. +# +# +# + + class IFPClient(object): def __init__(self, host, port, user, site=None, progName=None): self.__thrift = ThriftClient.ThriftClient(host, port) @@ -33,15 +57,14 @@ class IFPClient(object): if len(sr.getPayload()) > 0: site = sr.getPayload()[0] self.__siteId = site - + def commitGrid(self, request): - if isinstance(request, CommitGridRequest): + if type(request) is CommitGridRequest: return self.__commitGrid([request]) elif self.__isHomogenousIterable(request, CommitGridRequest): return self.__commitGrid([cgr for cgr in request]) - raise TypeError("Invalid type: " + str(type(request)) + - " for commitGrid(). Only accepts CommitGridRequest or lists of CommitGridRequest.") - + raise TypeError("Invalid type: " + str(type(request)) + " specified to commitGrid(). Only accepts CommitGridRequest or lists of CommitGridRequest.") + def __commitGrid(self, requests): ssr = ServerResponse() request = CommitGridsRequest() @@ -49,26 +72,25 @@ class IFPClient(object): sr = self.__makeRequest(request) ssr.setMessages(sr.getMessages()) return ssr - - def getParmList(self, pid): - argType = type(pid) + + def getParmList(self, id): + argType = type(id) if argType is DatabaseID: - return self.__getParmList([pid]) - elif self.__isHomogenousIterable(pid, DatabaseID): - return self.__getParmList([dbid for dbid in pid]) - raise TypeError("Invalid type: " + str(argType) + - " for getParmList(). Only accepts DatabaseID or lists of DatabaseID.") - + return self.__getParmList([id]) + elif self.__isHomogenousIterable(id, DatabaseID): + return self.__getParmList([dbid for dbid in id]) + raise TypeError("Invalid type: " + str(argType) + " specified to getParmList(). Only accepts DatabaseID or lists of DatabaseID.") + def __getParmList(self, ids): ssr = ServerResponse() request = GetParmListRequest() request.setDbIds(ids) sr = self.__makeRequest(request) ssr.setMessages(sr.getMessages()) - parmlist = sr.getPayload() if sr.getPayload() is not None else [] - ssr.setPayload(parmlist) + list = sr.getPayload() if sr.getPayload() is not None else [] + ssr.setPayload(list) return ssr - + def __isHomogenousIterable(self, iterable, classType): try: iterator = iter(iterable) @@ -78,23 +100,22 @@ class IFPClient(object): except TypeError: return False return True - + def getGridInventory(self, parmID): - if isinstance(parmID, ParmID): + if type(parmID) is ParmID: sr = self.__getGridInventory([parmID]) - inventoryList = [] + list = [] try: - inventoryList = sr.getPayload()[parmID] + list = sr.getPayload()[parmID] except KeyError: # no-op, we've already default the TimeRange list to empty pass - sr.setPayload(inventoryList) + sr.setPayload(list) return sr elif self.__isHomogenousIterable(parmID, ParmID): - return self.__getGridInventory([pid for pid in parmID]) - raise TypeError("Invalid type: " + str(type(parmID)) + - " specified to getGridInventory(). Accepts ParmID or lists of ParmID.") - + return self.__getGridInventory([id for id in parmID]) + raise TypeError("Invalid type: " + str(type(parmID)) + " specified to getGridInventory(). Only accepts ParmID or lists of ParmID.") + def __getGridInventory(self, parmIDs): ssr = ServerResponse() request = GetGridInventoryRequest() @@ -104,7 +125,7 @@ class IFPClient(object): trs = sr.getPayload() if sr.getPayload() is not None else {} ssr.setPayload(trs) return ssr - + def getSelectTR(self, name): request = GetSelectTimeRangeRequest() request.setName(name) @@ -113,7 +134,7 @@ class IFPClient(object): ssr.setMessages(sr.getMessages()) ssr.setPayload(sr.getPayload()) return ssr - + def getSiteID(self): ssr = ServerResponse() request = GetActiveSitesRequest() @@ -122,7 +143,7 @@ class IFPClient(object): ids = sr.getPayload() if sr.getPayload() is not None else [] sr.setPayload(ids) return sr - + def __makeRequest(self, request): try: request.setSiteID(self.__siteId) @@ -132,7 +153,7 @@ class IFPClient(object): request.setWorkstationID(self.__wsId) except AttributeError: pass - + sr = ServerResponse() response = None try: @@ -148,5 +169,5 @@ class IFPClient(object): except AttributeError: # not a server response, nothing else to do pass - + return sr diff --git a/awips/gfe/__init__.py b/awips/gfe/__init__.py index b6e95a6..f2a16d5 100644 --- a/awips/gfe/__init__.py +++ b/awips/gfe/__init__.py @@ -1,3 +1,37 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## -__all__ = [ + +# +# __init__.py for ufpy.gfe package +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 07/26/12 dgilling Initial Creation. +# +# +# + + +__all__ = [ ] diff --git a/awips/ignite_password.py b/awips/ignite_password.py new file mode 100644 index 0000000..57a4064 --- /dev/null +++ b/awips/ignite_password.py @@ -0,0 +1,64 @@ +############################################################################## +# Encryption/decryption for ignite passwords +# +# TODO RODO #8677: The ignite password encryption/decryption code in this and +# associated files is based off similar JMS password code that exists in a +# later version, so the similar code should be consolidated later on. +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------- -------- -------------- ------------------------------------------- +# Oct 12, 2021 8667 mapeters Initial version +# Mar 03, 2022 8762 mapeters Handle cache VM jars being moved under +# /awips2/ignite +# +############################################################################## + +import os +import subprocess + +class IgniteConfigurationException(Exception): + """Exception subclass for ignite password errors.""" + pass + +def updateIgnitePasswords(keystore_password, truststore_password, password_props_path): + igniteJar = __findPluginJar("com.raytheon.uf.common.datastore.ignite") + cryptoJar = __findPluginJar("com.raytheon.uf.common.security") + statusJar = __findPluginJar("com.raytheon.uf.common.status") + apacheJar = __findFossJar("org.apache.commons.codec") + classPath = ":".join([igniteJar, cryptoJar, statusJar, apacheJar]) + + passwords_dict = {'a2.ignite.keystore.password': keystore_password, 'a2.ignite.truststore.password': truststore_password} + for password_key, password in passwords_dict.items(): + # need full java path since this is run as root, which doesn't have appropriate path vars set + process = subprocess.run(["/awips2/java/bin/java", "-cp", classPath, "com.raytheon.uf.common.datastore.ignite.IgnitePasswordUtils", "--update", password, password_key, password_props_path], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + try: + process.check_returncode() + except subprocess.CalledProcessError: + raise IgniteConfigurationException(f"Failed to update {password_key}: {process.stderr.decode()}") + +def __findPluginJar(pluginName): + # for cache VMs + ignitePluginJar = f"/awips2/ignite/lib/plugins/{pluginName}.jar" + if os.path.isfile(ignitePluginJar): + return ignitePluginJar + # for edex VMs + edexPluginJar = f"/awips2/edex/lib/plugins/{pluginName}.jar" + if os.path.isfile(edexPluginJar): + return edexPluginJar + raise RuntimeError(f"Could not locate plugin {pluginName}.jar") + + +def __findFossJar(libraryName): + # for cache VMs + igniteFossDir = f"/awips2/ignite/lib/dependencies/{libraryName}" + if os.path.isdir(igniteFossDir): + return f"{igniteFossDir}/*" + # for edex VMs + edexFossDir = f"/awips2/edex/lib/dependencies/{libraryName}" + if os.path.isdir(edexFossDir): + return f"{edexFossDir}/*" + raise RuntimeError(f"Could not locate plugin {libraryName}") diff --git a/awips/localization/LocalizationFileManager.py b/awips/localization/LocalizationFileManager.py new file mode 100644 index 0000000..d22fe51 --- /dev/null +++ b/awips/localization/LocalizationFileManager.py @@ -0,0 +1,477 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# +# Library for accessing localization files from python. +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# --------- -------- --------- -------------------------- +# 08/09/17 5731 bsteffen Initial Creation. +# 04/23/19 7756 mapeters Make user context name determination work with IdM +# 04/22/20 7883 tgurney Python 3 string/bytes fixes +# 01/10/22 8735 mapeters Set Content-Type for PUTs + + +import urllib.request, urllib.error, urllib.parse +from json import load as loadjson +from xml.etree.ElementTree import parse as parseXml +from base64 import b64encode +from io import BytesIO +import dateutil.parser +import contextlib +import os +from urllib.parse import urlunparse, urljoin + +from . import LocalizationUtil + +NON_EXISTENT_CHECKSUM = 'NON_EXISTENT_CHECKSUM' +DIRECTORY_CHECKSUM = 'DIRECTORY_CHECKSUM' + +class LocalizationFileVersionConflictException(Exception): + pass + +class LocalizationFileDoesNotExistException(Exception): + pass + +class LocalizationFileIsNotDirectoryException(Exception): + pass + +class LocalizationContext(object): + """A localization context defines the scope of a localization file. + + For example the base localization context includes all the default files + installed with EDEX, while a particular user context has custom files for + that user. + + A localization context consists of a level and name. The level defines what + kind of entity this context is valid for, such as 'base', 'site', or 'user'. + The name identifies the specific entity, for example the name of a 'user' + level context is usually the username. The 'base' level does not have a name + because there cannot be only one 'base' context. + + Attributes: + level: the localization level + name: the context name + """ + def __init__(self, level="base", name=None, localizationType="common_static"): + if level != "base": + assert name is not None + self.level = level + self.name = name + self.type = localizationType + def isBase(self): + return self.level == "base" + def _getUrlComponent(self): + if self.isBase(): + return self.type + '/' + "base/" + else: + return self.type + '/' + self.level + '/' + self.name + '/' + def __str__(self): + if self.isBase(): + return self.type + ".base" + else: + return self.type + "." + self.level + "." + self.name + def __eq__(self, other): + return self.level == other.level and \ + self.name == other.name and \ + self.type == other.type + def __hash__(self): + return hash((self.level, self.name, self.type)) + +class _LocalizationOutput(BytesIO): + """A file-like object for writing a localization file. + + The contents being written are stored in memory and written to a + localization server only when the writing is finished. + + This object should be used as a context manager, a save operation will be + executed if the context exits with no errors. If errors occur the partial + contents are abandoned and the server is unchanged. + + It is also possible to save the contents to the server with the save() + method. + """ + def __init__(self, manager, lFile): + super().__init__() + self._manager = manager + self._file = lFile + def save(self): + """Send the currently written contents to the server.""" + request = self._manager._buildRequest(self._file.context, self._file.path, method="PUT") + + request.data = self.getvalue() + request.add_header("If-Match", self._file.checksum) + # An empty file is created if Content-Type isn't specified (defaults to + # "application/x-www-form-urlencoded"). We aren't encoding the + # request.data bytes in any special way for either text files (e.g. .py + # or .xml) or binary files (e.g. .png), so this works for both. + request.add_header("Content-Type", "application/octet-stream") + try: + urllib.request.urlopen(request) + except urllib.error.HTTPError as e: + if e.code == 409: + raise LocalizationFileVersionConflictException(e.read()) + else: + raise e + def __enter__(self): + return self + def __exit__(self, exc_type, exc_value, traceback): + if exc_type is None: + self.save() + def __str__(self): + return '<' + self.__class__.__name__ + " for " + str(self._file) + '>' + +class LocalizationFile(object): + """A specific file stored in localization. + + A localization file is uniquely defined by the context and path. There can + only be one valid file for that path and localization at a time. To access + the contents of the file use the open method. + + Attributes: + context: A LocalizationContext + path: A path to this file + checksum: A string representation of a checksum generated from the file contents. + timnestamp: A datetime.datetime object indicating when the file was last modified. + """ + def __init__(self, manager, context, path, checksum, timestamp): + """Initialize a LocalizationFile with the given manager and attributes. + + Args: + manager: A LocalizationFileManager to assist with server communication + context: A LocalizationContext + path: A path to this file + checksum: A string representation of a checksum generated from the file contents. + timnestamp: A datetime.datetime object indicating when the file was last modified. + """ + self._manager = manager + self.context = context + self.path = path + self.checksum = checksum + self.timestamp = timestamp + def open(self, mode='r'): + """Open the file. + + This should always be called as as part of a with statement. When + writing the content is not saved on the server until leaving the with + statement normally, if an error occurs the server is left unchanged. + + Example: + with locFile.open('w') as output: + output.write('some content') + + Args: + mode: 'r' for reading the file, 'w' for writing + + Returns: + A file like object that can be used for reads or writes. + """ + if mode == 'r': + request = self._manager._buildRequest(self.context, self.path) + response = urllib.request.urlopen(request) + # Not the recommended way of reading directories. + if not(self.isDirectory()): + checksum = response.headers["Content-MD5"] + if self.checksum != checksum: + raise RuntimeError("Localization checksum mismatch " + self.checksum + " " + checksum) + return contextlib.closing(response) + elif mode == 'w': + return _LocalizationOutput(self._manager, self) + else: + raise ValueError("mode string must be 'r' or 'w' not " + str(r)) + def delete(self): + """Delete this file from the server""" + request = self._manager._buildRequest(self.context, self.path, method='DELETE') + request.add_header("If-Match", self.checksum) + try: + urllib.request.urlopen(request) + except urllib.error.HTTPError as e: + if e.code == 409: + raise LocalizationFileVersionConflictException(e.read()) + else: + raise e + def exists(self): + """Check if this file actually exists. + + Returns: + boolean indicating existence of this file + """ + return self.checksum != NON_EXISTENT_CHECKSUM + def isDirectory(self): + """Check if this file is a directory. + + A file must exist to be considered a directory. + + Returns: + boolean indicating directorocity of this file + """ + return self.checksum == DIRECTORY_CHECKSUM + def getCheckSum(self): + return self.checksum + def getContext(self): + return self.context + def getPath(self): + return self.path + def getTimeStamp(self): + return self.timestamp + def __str__(self): + return str(self.context) + "/" + self.path + def __eq__(self, other): + return self.context == other.context and \ + self.path == other.path and \ + self.checksum == other.checksum \ + and self.timestamp == other.timestamp + def __hash__(self): + return hash((self.context, self.path, self.checksum, self.timestamp)) + +def _getHost(): + import subprocess + host = subprocess.check_output( + "source /awips2/fxa/bin/setup.env; echo $DEFAULT_HOST", + shell=True).strip().decode() + if host: + return host + return 'localhost' + +def _getSiteFromServer(host): + try: + from ufpy import ThriftClient + from dynamicserialize.dstypes.com.raytheon.uf.common.site.requests import GetPrimarySiteRequest + client = ThriftClient.ThriftClient(host) + return client.sendRequest(GetPrimarySiteRequest()) + except: + # Servers that don't have GFE installed will not return a site + pass + +def _getSiteFromEnv(): + site = os.environ.get('FXA_LOCAL_SITE') + if site is None: + site = os.environ.get('SITE_IDENTIFIER') + return site + +def _getSite(host): + site = _getSiteFromEnv() + if not(site): + site = _getSiteFromServer(host) + return site + +def _parseJsonList(manager, response, context, path): + fileList = [] + jsonResponse = loadjson(response) + for name, jsonData in jsonResponse.items(): + checksum = jsonData["checksum"] + timestampString = jsonData["timestamp"] + timestamp = dateutil.parser.parse(timestampString) + newpath = urljoin(path, name) + fileList.append(LocalizationFile(manager, context, newpath, checksum, timestamp)) + return fileList + +def _parseXmlList(manager, response, context, path): + fileList = [] + for xmlData in parseXml(response).getroot().findall('file'): + name = xmlData.get("name") + checksum = xmlData.get("checksum") + timestampString = xmlData.get("timestamp") + timestamp = dateutil.parser.parse(timestampString) + newpath = urljoin(path, name) + fileList.append(LocalizationFile(manager, context, newpath, checksum, timestamp)) + return fileList + +class LocalizationFileManager(object): + """Connects to a server and retrieves LocalizationFiles.""" + def __init__(self, host=None, port=9581, path="/services/localization/", contexts=None, site=None, localizationType="common_static"): + """Initializes a LocalizationFileManager with connection parameters and context information + + All arguments are optional and will use defaults or attempt to figure out appropriate values form the environment. + + Args: + host: A hostname of the localization server, such as 'ev'. + port: A port to use to connect to the localization server, usually 9581. + path: A path to reach the localization file service on the server. + contexts: A list of contexts to check for files, the order of the contexts will be used + for the order of incremental results and the priority of absolute results. + site: A site identifier to use for site specific contexts. This is only used if the contexts arg is None. + localizationType: A localization type for contexts. This is only used if the contexts arg is None. + + """ + if host is None: + host = _getHost() + if contexts is None: + if site is None: + site = _getSite(host) + contexts = [LocalizationContext("base", None, localizationType)] + if site: + contexts.append(LocalizationContext("configured", site, localizationType)) + contexts.append(LocalizationContext("site", site, localizationType)) + contexts.append(LocalizationContext("user", LocalizationUtil.getUser(), localizationType)) + netloc = host + ':' + str(port) + self._baseUrl = urlunparse(('http', netloc, path, None, None, None)) + self._contexts = contexts + def _buildRequest(self, context, path, method='GET'): + url = urljoin(self._baseUrl, context._getUrlComponent()) + url = urljoin(url, path) + request = urllib.request.Request(url, method=method) + username = LocalizationUtil.getUser() + # Currently password is ignored in the server + # this is the defacto standard for not providing one to this service. + password = username + base64string = b64encode(b'%s:%s' % (username.encode(), password.encode())) + request.add_header("Authorization", "Basic %s" % base64string.decode()) + return request + def _normalizePath(self, path): + if path == '' or path == '/': + path = '.' + if path[0] == '/': + path = path[1:] + return path + def _list(self, path): + path = self._normalizePath(path) + if path[-1] != '/': + path += '/' + fileList = [] + exists = False + for context in self._contexts: + try: + request = self._buildRequest(context, path) + request.add_header("Accept", "application/json, application/xml") + response = urllib.request.urlopen(request) + exists = True + if not(response.geturl().endswith("/")): + # For ordinary files the server sends a redirect to remove the slash. + raise LocalizationFileIsNotDirectoryException("Not a directory: " + path) + elif response.headers["Content-Type"] == "application/xml": + fileList += _parseXmlList(self, response, context, path) + else: + fileList += _parseJsonList(self, response, context, path) + except urllib.error.HTTPError as e: + if e.code != 404: + raise e + if not(exists): + raise LocalizationFileDoesNotExistException("No such file or directory: " + path) + return fileList + def _get(self, context, path): + path = self._normalizePath(path) + try: + request = self._buildRequest(context, path, method='HEAD') + resp = urllib.request.urlopen(request) + if (resp.geturl().endswith("/")): + checksum = DIRECTORY_CHECKSUM + else: + if "Content-MD5" not in resp.headers: + raise RuntimeError("Missing Content-MD5 header in response from " + resp.geturl()) + checksum = resp.headers["Content-MD5"] + if "Last-Modified" not in resp.headers: + raise RuntimeError("Missing Last-Modified header in response from " + resp.geturl()) + timestamp = dateutil.parser.parse(resp.headers["Last-Modified"]) + return LocalizationFile(self, context, path, checksum, timestamp) + except urllib.error.HTTPError as e: + if e.code != 404: + raise e + else: + return LocalizationFile(self, context, path, NON_EXISTENT_CHECKSUM, None) + def listAbsolute(self, path): + """List the files in a localization directory, only a single file is returned for each unique path. + + If a file exists in more than one context then the highest level(furthest from base) is used. + + Args: + path: A path to a directory that should be the root of the listing + + Returns: + A list of LocalizationFiles + """ + merged = dict() + for lFile in self._list(path): + merged[lFile.path] = lFile + return sorted(merged.values(), key=lambda lFile: lFile.path) + def listIncremental(self, path): + """List the files in a localization directory, this includes all files for all contexts. + + Args: + path: A path to a directory that should be the root of the listing + + Returns: + A list of tuples, each tuple will contain one or more files for the + same paths but different contexts. Each tuple will be ordered the + same as the contexts in this manager, generally with 'base' first + and 'user' last. + """ + merged = dict() + for lFile in self._list(path): + if lFile.path in merged: + merged[lFile.path] += (lFile,) + else: + merged[lFile.path] = (lFile,) + return sorted(merged.values(), key=lambda t: t[0].path) + def getAbsolute(self, path): + """Get a single localization file from the highest level context where it exists. + + Args: + path: A path to a localization file + + Returns: + A Localization File with the specified path or None if the file does not exist in any context. + + """ + for context in reversed(self._contexts): + f = self._get(context, path) + if f.exists(): + return f + def getIncremental(self, path): + """Get all the localization files that exist in any context for the provided path. + + Args: + path: A path to a localization file + + Returns: + A tuple containing all the files that exist for this path in any context. The tuple + will be ordered the same as the contexts in this manager, generally with 'base' first + and 'user' last. + """ + result = () + for context in self._contexts: + f = self._get(context, path) + if f.exists(): + result += (f,) + return result + def getSpecific(self, level, path): + """Get a specific localization file at a given level, the file may not exist. + + The file is returned for whichever context is valid for the provided level in this manager. + + For writing new files this is the only way to get access to a file that + does not exist in order to create it. + + Args: + level: the name of a localization level, such as "base", "site", "user" + path: A path to a localization file + + Returns: + A Localization File with the specified path and a context for the specified level. + """ + for context in self._contexts: + if context.level == level: + return self._get(context, path) + raise ValueError("No context defined for level " + level) + def __str__(self): + contextsStr = '[' + ' '.join((str(c) for c in self._contexts)) + ']' + return '<' + self.__class__.__name__ + " for " + self._baseUrl + ' ' + contextsStr + '>' diff --git a/awips/localization/LocalizationUtil.py b/awips/localization/LocalizationUtil.py new file mode 100644 index 0000000..ae8a3b0 --- /dev/null +++ b/awips/localization/LocalizationUtil.py @@ -0,0 +1,45 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# +# Utilities for localization. +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# --------- -------- --------- -------------------------- +# 04/23/19 7756 mapeters Initial creation + +import getpass + +def getUser(): + ''' + Get the user context name. + ''' + try: + # Match Java's way of determining the user if we have Jep access + from java.lang import System + user = System.getProperty('user.name') + except: + # Otherwise use built-in getpass module. With IdM, this can return + # user.name@REALM, so strip the @REALM portion if it exists. + user = getpass.getuser() + user = user.split('@')[0] + return user diff --git a/awips/localization/__init__.py b/awips/localization/__init__.py new file mode 100644 index 0000000..e138466 --- /dev/null +++ b/awips/localization/__init__.py @@ -0,0 +1,32 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# +# __init__.py for ufpy.localization package +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# --------- -------- --------- -------------------------- +# 08/10/17 5731 bsteffen Initial Creation. + +__all__ = [ + ] \ No newline at end of file diff --git a/awips/qpidingest.py b/awips/qpidingest.py index bb5e07a..859c6dc 100644 --- a/awips/qpidingest.py +++ b/awips/qpidingest.py @@ -1,19 +1,10 @@ -# =============================================================================== +#=============================================================================== # qpidingest.py # # @author: Aaron Anderson # @organization: NOAA/WDTB OU/CIMMS # @version: 1.0 02/19/2010 -# @requires: QPID Python Client available from http://qpid.apache.org/download.html -# The Python Client is located under Single Component Package/Client -# -# From the README.txt Installation Instructions -# = INSTALLATION = -# Extract the release archive into a directory of your choice and set -# your PYTHONPATH accordingly: -# -# tar -xzf qpid-python-.tar.gz -C -# export PYTHONPATH=/qpid-/python +# @requires: awips2-python and awips2-qpid-proton-python RPMs # # ***EDEX and QPID must be running for this module to work*** # @@ -38,7 +29,7 @@ # EXAMPLE: # Simple example program: # -# ------------------------------------------------------------------------------ +#------------------------------------------------------------------------------ # import qpidingest # #Tell EDEX to ingest a metar file from data_store. The filepath is # #/data_store/20100218/metar/00/standard/20100218_005920_SAUS46KSEW.metar @@ -50,82 +41,102 @@ # # conn.sendmessage('/data_store/20100218/metar/18/standard/20100218_185755_SAUS46KLOX.metar','SAUS46 KLOX') # conn.close() -# ------------------------------------------------------------------------------- +#------------------------------------------------------------------------------- # -# SOFTWARE HISTORY +# SOFTWARE HISTORY # -# Date Ticket# Engineer Description -# ------------ ---------- ----------- -------------------------- -# .... -# 06/13/2013 DR 16242 D. Friedman Add Qpid authentication info -# 03/06/2014 DR 17907 D. Friedman Workaround for issue QPID-5569 -# 02/16/2017 DR 6084 bsteffen Support ssl connections +# Date Ticket# Engineer Description +# ------------- -------- ------------ ------------------------------------------ +# Jun 13, 2013 16242 D. Friedman Add Qpid authentication info +# Mar 06, 2014 17907 D. Friedman Workaround for issue QPID-5569 +# Feb 16, 2017 6084 bsteffen Support ssl connections +# Jun 14, 2019 7870 mrichardson MHS env workaround +# Jul 23, 2019 7724 mrichardson Upgrade Qpid to Qpid Proton +# Nov 06, 2019 7724 tgurney Remove the unnecessary +# QpidQueueManager +# Dec 12, 2019 7995 dgilling Revert interface changes from #7724. +# Jul 07, 2020 8187 randerso Added qpid connection_id # -# =============================================================================== +#=============================================================================== +import logging import os +import pwd import os.path +import socket -import qpid -from qpid.util import connect -from qpid.connection import Connection -from qpid.datatypes import Message, uuid4 +import proton +import proton.utils +import proton.reactor -QPID_USERNAME = 'guest' -QPID_PASSWORD = 'guest' +log = logging.getLogger("qpidingest") +class QpidIngestException(Exception): + """Exception subclass for broker communication exceptions.""" + pass + class IngestViaQPID: - def __init__(self, host='localhost', port=5672, ssl=None): - """ + def __init__(self, host="localhost", port=5672, program="qpidingest"): + ''' Connect to QPID and make bindings to route message to external.dropbox queue @param host: string hostname of computer running EDEX and QPID (default localhost) @param port: integer port used to connect to QPID (default 5672) - @param ssl: boolean to determine whether ssl is used, default value of None will use - ssl only if a client certificate is found. - """ + ''' + + pwuid = pwd.getpwuid(os.getuid()) + certdb = os.getenv("QPID_SSL_CERT_DB", os.path.join(pwuid.pw_dir, ".qpid")) + certname = os.getenv("QPID_SSL_CERT_NAME", "guest") + cert_password = os.getenv("QPID_SSL_CERT_PASSWORD", "password") + certfile = os.path.join(certdb, f"{certname}.crt") + keyfile = os.path.join(certdb, f"{certname}.key") + + url = f"amqps://{host}:{port}" + ADDRESS = "external.dropbox" + ssl_domain = proton.SSLDomain(mode=proton.SSLDomain.MODE_CLIENT) + ssl_domain.set_credentials(certfile, keyfile, cert_password) + + clientID = ":".join([ + socket.gethostname(), + pwuid.pw_name, + program, + str(os.getpid()), + ]) try: - # - socket = connect(host, port) - if "QPID_SSL_CERT_DB" in os.environ: - certdb = os.environ["QPID_SSL_CERT_DB"] - else: - certdb = os.path.expanduser("~/.qpid/") - if "QPID_SSL_CERT_NAME" in os.environ: - certname = os.environ["QPID_SSL_CERT_NAME"] - else: - certname = QPID_USERNAME - certfile = os.path.join(certdb, certname + ".crt") - if ssl or (ssl is None and os.path.exists(certfile)): - keyfile = os.path.join(certdb, certname + ".key") - trustfile = os.path.join(certdb, "root.crt") - socket = qpid.util.ssl(socket, keyfile=keyfile, certfile=certfile, ca_certs=trustfile) - self.connection = Connection(sock=socket, username=QPID_USERNAME, password=QPID_PASSWORD) - self.connection.start() - self.session = self.connection.session(str(uuid4())) - self.session.exchange_bind(exchange='amq.direct', queue='external.dropbox', binding_key='external.dropbox') - print('Connected to Qpid') - except ValueError: - print('Unable to connect to Qpid') + container = proton.reactor.Container() + container.container_id = clientID + self._conn = proton.utils.BlockingConnection(url, ssl_domain=ssl_domain) + self._sender = self._conn.create_sender(ADDRESS) + log.debug("Connected to broker [%s], endpoint [%s].", url, ADDRESS) + except proton.ProtonException as e: + log.exception("Failed to connect to broker [%s].", url) + raise QpidIngestException("Failed to connect to broker [{}].".format(url)) from e def sendmessage(self, filepath, header): - """ + ''' This function sends a message to the external.dropbox queue providing the path to the file to be ingested and a header to determine the plugin to be used to decode the file. @param filepath: string full path to file to be ingested @param header: string header used to determine plugin decoder to use - """ - props = self.session.delivery_properties(routing_key='external.dropbox') - head = self.session.message_properties(application_headers={'header': header}, - user_id=QPID_USERNAME) - self.session.message_transfer(destination='amq.direct', message=Message(props, head, filepath)) + ''' + try: + self._sender.send(proton.Message(body=filepath, subject=header)) + except proton.ProtonException as e: + log.exception("Failed to send file [%s] to broker.", filepath) + raise QpidIngestException("Failed to send file [{}] to broker.".format(filepath)) from e def close(self): - """ + ''' After all messages are sent call this function to close connection and make sure there are no threads left open - """ - self.session.close(timeout=10) - print('Connection to Qpid closed') + ''' + try: + self._sender.close() + self._conn.close() + log.debug("Disconnected from broker.") + except proton.ProtonException as e: + log.warning("Failed to disconnect from broker.", exc_info=True) + raise QpidIngestException("Failed to disconnect from broker.") from e + diff --git a/awips/test/Record.py b/awips/test/Record.py index c9eac48..ac69d51 100644 --- a/awips/test/Record.py +++ b/awips/test/Record.py @@ -1,12 +1,48 @@ -import sys +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# +# Pure python logging mechanism for logging to AlertViz from +# pure python (ie not JEP). DO NOT USE IN PYTHON CALLED +# FROM JAVA. +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 11/03/10 5849 cjeanbap Initial Creation. +# +# +# + +import os +import sys + class Record(): def __init__(self, level=0, msg='Test Message'): - self.levelno = level - self.message = msg - self.exc_info = sys.exc_info() - self.exc_text = "TEST" - + self.levelno=level + self.message=msg + self.exc_info=sys.exc_info() + self.exc_text="TEST" + def getMessage(self): - return self.message + return self.message \ No newline at end of file diff --git a/awips/test/Test b/awips/test/Test new file mode 100644 index 0000000..35f3fb6 --- /dev/null +++ b/awips/test/Test @@ -0,0 +1,48 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +# +# Pure python logging mechanism for logging to AlertViz from +# pure python (ie not JEP). DO NOT USE IN PYTHON CALLED +# FROM JAVA. +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 11/03/10 5849 cjeanbap Initial Creation. +# +# +# + +## to execute type python Test + + +import os +import logging +from awips import AlertVizHandler +import Record + +avh = AlertVizHandler.AlertVizHandler(host=os.getenv("BROKER_ADDR","localhost"), port=9581, category='LOCAL', source='ANNOUNCER', level=logging.NOTSET) +record = Record.Record(10) +avh.emit(record) + diff --git a/awips/test/__init__.py b/awips/test/__init__.py index b5757f8..ae5228c 100644 --- a/awips/test/__init__.py +++ b/awips/test/__init__.py @@ -1,2 +1,34 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +# +# __init__.py for ufpy package +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 11/03/10 5489 cjeanbap Initial Creation. +# +# +# -__all__ = [] diff --git a/awips/test/dafTests/__init__.py b/awips/test/dafTests/__init__.py index b5757f8..5ce6ada 100644 --- a/awips/test/dafTests/__init__.py +++ b/awips/test/dafTests/__init__.py @@ -1,2 +1,36 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +# +# __init__.py for ufpy.test.dafTests package +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 02/09/2016 4795 mapeters Initial creation. +# 04/12/2016 5548 tgurney Cleanup +# +# +# __all__ = [] diff --git a/awips/test/dafTests/baseBufrMosTestCase.py b/awips/test/dafTests/baseBufrMosTestCase.py index ac18a40..a62fada 100644 --- a/awips/test/dafTests/baseBufrMosTestCase.py +++ b/awips/test/dafTests/baseBufrMosTestCase.py @@ -1,3 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +from ufpy.dataaccess import DataAccessLayer as DAL + +from . import baseDafTestCase +from . import params + # # Base TestCase for BufrMos* tests. # @@ -12,17 +37,12 @@ # # -from awips.dataaccess import DataAccessLayer as DAL - -from awips.test.dafTests import baseDafTestCase -from awips.test.dafTests import params - class BufrMosTestCase(baseDafTestCase.DafTestCase): """Base class for testing DAF support of bufrmos data""" - + data_params = "temperature", "dewpoint" - + def testGetAvailableParameters(self): req = DAL.newDataRequest(self.datatype) self.runParametersTest(req) diff --git a/awips/test/dafTests/baseDafTestCase.py b/awips/test/dafTests/baseDafTestCase.py index ab0fb38..0615f23 100644 --- a/awips/test/dafTests/baseDafTestCase.py +++ b/awips/test/dafTests/baseDafTestCase.py @@ -1,3 +1,32 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + + +from ufpy.dataaccess import DataAccessLayer as DAL +from ufpy.ThriftClient import ThriftRequestException + +import os +import numpy +import unittest + # # Base TestCase for DAF tests. This class provides helper methods and # tests common to all DAF test cases. @@ -24,16 +53,11 @@ # time-agnostic data # 03/13/17 5981 tgurney Do not check valid period on # data time +# 04/14/22 8845 njensen Add checks for NaNs in geometry +# data tests # # -from __future__ import print_function -from awips.dataaccess import DataAccessLayer as DAL -from awips.ThriftClient import ThriftRequestException - -import os -import unittest - class DafTestCase(unittest.TestCase): @@ -56,7 +80,7 @@ class DafTestCase(unittest.TestCase): def setUpClass(cls): host = os.environ.get('DAF_TEST_HOST') if host is None: - host = 'edex-cloud.unidata.ucar.edu' + host = 'localhost' DAL.changeEDEXHost(host) @staticmethod @@ -68,13 +92,13 @@ class DafTestCase(unittest.TestCase): try: times = DAL.getAvailableTimes(req) except ThriftRequestException as e: - if 'TimeAgnosticDataException' not in str(e): + if not 'TimeAgnosticDataException' in str(e): raise return times def testDatatypeIsSupported(self): - allSupported = DAL.getSupportedDatatypes() - self.assertIn(self.datatype, allSupported) + allSupported = (item.lower() for item in DAL.getSupportedDatatypes()) + self.assertIn(self.datatype.lower(), allSupported) def testGetRequiredIdentifiers(self): req = DAL.newDataRequest(self.datatype) @@ -89,21 +113,21 @@ class DafTestCase(unittest.TestCase): print("Optional identifiers:", optional) def runGetIdValuesTest(self, identifiers): - for identifier in identifiers: - if identifier.lower() == 'datauri': + for id in identifiers: + if id.lower() == 'datauri': continue req = DAL.newDataRequest(self.datatype) - idValues = DAL.getIdentifierValues(req, identifier) + idValues = DAL.getIdentifierValues(req, id) self.assertTrue(hasattr(idValues, '__iter__')) def runInvalidIdValuesTest(self): badString = 'id from ' + self.datatype + '; select 1;' - with self.assertRaises(ThriftRequestException): + with self.assertRaises(ThriftRequestException) as cm: req = DAL.newDataRequest(self.datatype) DAL.getIdentifierValues(req, badString) def runNonexistentIdValuesTest(self): - with self.assertRaises(ThriftRequestException): + with self.assertRaises(ThriftRequestException) as cm: req = DAL.newDataRequest(self.datatype) DAL.getIdentifierValues(req, 'idthatdoesnotexist') @@ -145,9 +169,22 @@ class DafTestCase(unittest.TestCase): times = DafTestCase.getTimesIfSupported(req) geomData = DAL.getGeometryData(req, times[:self.numTimesToLimit]) self.assertIsNotNone(geomData) + if times: + self.assertNotEqual(len(geomData), 0) if not geomData: raise unittest.SkipTest("No data available") print("Number of geometry records: " + str(len(geomData))) + print("Sample geometry data:") + for record in geomData[:self.sampleDataLimit]: + if (checkDataTimes and times and + "PERIOD_USED" not in record.getDataTime().getUtilityFlags()): + self.assertIn(record.getDataTime(), times[:self.numTimesToLimit]) + print("geometry=" + str(record.getGeometry()), end="") + for p in req.getParameters(): + print(" " + p + "=" + record.getString(p), end="") + if record.getType(p) in ['FLOAT', 'DOUBLE']: + self.assertFalse(numpy.isnan(record.getNumber(p))) + print() return geomData def runGeometryDataTestWithTimeRange(self, req, timeRange): @@ -160,6 +197,16 @@ class DafTestCase(unittest.TestCase): if not geomData: raise unittest.SkipTest("No data available") print("Number of geometry records: " + str(len(geomData))) + print("Sample geometry data:") + for record in geomData[:self.sampleDataLimit]: + self.assertGreaterEqual(record.getDataTime().getRefTime().getTime(), timeRange.getStartInMillis()) + self.assertLessEqual(record.getDataTime().getRefTime().getTime(), timeRange.getEndInMillis()) + print("geometry=" + str(record.getGeometry()), end="") + for p in req.getParameters(): + print(" " + p + "=" + record.getString(p), end="") + if record.getType(p) in ['FLOAT', 'DOUBLE']: + self.assertFalse(numpy.isnan(record.getNumber(p))) + print() return geomData def runGridDataTest(self, req, testSameShape=True): @@ -168,7 +215,6 @@ class DafTestCase(unittest.TestCase): request. Args: - req: the grid request testSameShape: whether or not to verify that all the retrieved data have the same shape (most data don't change shape) """ diff --git a/awips/test/dafTests/baseRadarTestCase.py b/awips/test/dafTests/baseRadarTestCase.py index afbe040..96d8ed4 100644 --- a/awips/test/dafTests/baseRadarTestCase.py +++ b/awips/test/dafTests/baseRadarTestCase.py @@ -1,3 +1,30 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from ufpy.dataaccess import DataAccessLayer as DAL +from ufpy.ThriftClient import ThriftRequestException + +from . import baseDafTestCase +from . import params + # # Tests common to all radar factories # @@ -23,13 +50,6 @@ # # -from __future__ import print_function -from awips.dataaccess import DataAccessLayer as DAL -from awips.ThriftClient import ThriftRequestException - -from awips.test.dafTests import baseDafTestCase -from awips.test.dafTests import params - class BaseRadarTestCase(baseDafTestCase.DafTestCase): """Tests common to all radar factories""" @@ -50,7 +70,7 @@ class BaseRadarTestCase(baseDafTestCase.DafTestCase): def testGetAvailableLevels(self): req = DAL.newDataRequest(self.datatype) self.runLevelsTest(req) - + def testGetAvailableLevelsWithInvalidLevelIdentifierThrowsException(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier('level.one.field', 'invalidLevelField') @@ -88,11 +108,6 @@ class BaseRadarTestCase(baseDafTestCase.DafTestCase): for record in gridData: self.assertEqual(record.getAttribute('icao'), 1000) - def testGetDataWithEqualsLong(self): - gridData = self.runConstraintTest('icao', '=', 1000) - for record in gridData: - self.assertEqual(record.getAttribute('icao'), 1000) - def testGetDataWithEqualsFloat(self): gridData = self.runConstraintTest('icao', '=', 1.0) for record in gridData: diff --git a/awips/test/dafTests/params.py b/awips/test/dafTests/params.py index 09b91c5..2bf519a 100644 --- a/awips/test/dafTests/params.py +++ b/awips/test/dafTests/params.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Site-specific parameters for DAF tests # @@ -7,17 +28,18 @@ # ------------ ---------- ----------- -------------------------- # 12/07/16 5981 tgurney Initial creation # 12/15/16 5981 tgurney Add ENVELOPE +# 04/14/22 8845 njensen Add POINT # # -from shapely.geometry import box - +from shapely.geometry import box, Point AIRPORT = 'OMA' OBS_STATION = 'KOMA' SITE_ID = 'OAX' STATION_ID = '72558' RADAR = 'KOAX' +POINT = Point(-96.25, 41.16) SAMPLE_AREA = (-97.0, 41.0, -96.0, 42.0) -ENVELOPE = box(*SAMPLE_AREA) +ENVELOPE = box(*SAMPLE_AREA) \ No newline at end of file diff --git a/awips/test/dafTests/testAcars.py b/awips/test/dafTests/testAcars.py index 2a2b54f..3a22f3b 100644 --- a/awips/test/dafTests/testAcars.py +++ b/awips/test/dafTests/testAcars.py @@ -1,3 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from ufpy.dataaccess import DataAccessLayer as DAL + +from . import baseDafTestCase + # # Test DAF support for ACARS data # @@ -11,10 +36,6 @@ # # -from __future__ import print_function -from awips.dataaccess import DataAccessLayer as DAL -from awips.test.dafTests import baseDafTestCase - class AcarsTestCase(baseDafTestCase.DafTestCase): """Test DAF support for ACARS data""" diff --git a/awips/test/dafTests/testAirep.py b/awips/test/dafTests/testAirep.py index 381ed11..16ec729 100644 --- a/awips/test/dafTests/testAirep.py +++ b/awips/test/dafTests/testAirep.py @@ -1,3 +1,29 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from ufpy.dataaccess import DataAccessLayer as DAL + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint +from . import baseDafTestCase + # # Test DAF support for airep data # @@ -14,12 +40,6 @@ # # -from __future__ import print_function -from awips.dataaccess import DataAccessLayer as DAL - -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint -from awips.test.dafTests import baseDafTestCase - class AirepTestCase(baseDafTestCase.DafTestCase): """Test DAF support for airep data""" diff --git a/awips/test/dafTests/testBinLightning.py b/awips/test/dafTests/testBinLightning.py index 02e6382..7ba6b61 100644 --- a/awips/test/dafTests/testBinLightning.py +++ b/awips/test/dafTests/testBinLightning.py @@ -1,3 +1,31 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from ufpy.dataaccess import DataAccessLayer as DAL +from ufpy.ThriftClient import ThriftRequestException +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint + + +from . import baseDafTestCase + # # Test DAF support for binlightning data # @@ -18,20 +46,14 @@ # 06/13/16 5574 tgurney Typo # 06/30/16 5725 tgurney Add test for NOT IN # 11/08/16 5985 tgurney Do not check data times +# # -# -from __future__ import print_function -from awips.dataaccess import DataAccessLayer as DAL -from awips.ThriftClient import ThriftRequestException -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint -from awips.test.dafTests import baseDafTestCase class BinLightningTestCase(baseDafTestCase.DafTestCase): """Test DAF support for binlightning data""" datatype = "binlightning" - source = "GLMfl" def testGetAvailableParameters(self): req = DAL.newDataRequest(self.datatype) @@ -39,18 +61,18 @@ class BinLightningTestCase(baseDafTestCase.DafTestCase): def testGetAvailableTimes(self): req = DAL.newDataRequest(self.datatype) - req.addIdentifier('source', self.source) + req.addIdentifier("source", "NLDN") self.runTimesTest(req) def testGetGeometryDataSingleSourceSingleParameter(self): req = DAL.newDataRequest(self.datatype) - req.addIdentifier('source', self.source) + req.addIdentifier("source", "NLDN") req.setParameters('intensity') self.runGeometryDataTest(req, checkDataTimes=False) def testGetGeometryDataInvalidParamRaisesIncompatibleRequestException(self): req = DAL.newDataRequest(self.datatype) - req.addIdentifier('source', self.source) + req.addIdentifier("source", "NLDN") req.setParameters('blahblahblah') with self.assertRaises(ThriftRequestException) as cm: self.runGeometryDataTest(req) @@ -58,7 +80,7 @@ class BinLightningTestCase(baseDafTestCase.DafTestCase): def testGetGeometryDataSingleSourceAllParameters(self): req = DAL.newDataRequest(self.datatype) - req.addIdentifier('source', self.source) + req.addIdentifier("source", "NLDN") req.setParameters(*DAL.getAvailableParameters(req)) self.runGeometryDataTest(req, checkDataTimes=False) @@ -82,20 +104,15 @@ class BinLightningTestCase(baseDafTestCase.DafTestCase): return self.runGeometryDataTest(req, checkDataTimes=False) def testGetDataWithEqualsString(self): - geomData = self._runConstraintTest('source', '=', self.source) + geomData = self._runConstraintTest('source', '=', 'NLDN') for record in geomData: - self.assertEqual(record.getAttribute('source'), self.source) + self.assertEqual(record.getAttribute('source'), 'NLDN') def testGetDataWithEqualsInt(self): geomData = self._runConstraintTest('source', '=', 1000) for record in geomData: self.assertEqual(record.getAttribute('source'), 1000) - def testGetDataWithEqualsLong(self): - geomData = self._runConstraintTest('source', '=', 1000) - for record in geomData: - self.assertEqual(record.getAttribute('source'), 1000) - def testGetDataWithEqualsFloat(self): geomData = self._runConstraintTest('source', '=', 1.0) for record in geomData: @@ -107,9 +124,9 @@ class BinLightningTestCase(baseDafTestCase.DafTestCase): self.assertIsNone(record.getAttribute('source')) def testGetDataWithNotEquals(self): - geomData = self._runConstraintTest('source', '!=', self.source) + geomData = self._runConstraintTest('source', '!=', 'NLDN') for record in geomData: - self.assertNotEqual(record.getAttribute('source'), self.source) + self.assertNotEqual(record.getAttribute('source'), 'NLDN') def testGetDataWithNotEqualsNone(self): geomData = self._runConstraintTest('source', '!=', None) @@ -117,49 +134,49 @@ class BinLightningTestCase(baseDafTestCase.DafTestCase): self.assertIsNotNone(record.getAttribute('source')) def testGetDataWithGreaterThan(self): - geomData = self._runConstraintTest('source', '>', self.source) + geomData = self._runConstraintTest('source', '>', 'NLDN') for record in geomData: - self.assertGreater(record.getAttribute('source'), self.source) + self.assertGreater(record.getAttribute('source'), 'NLDN') def testGetDataWithLessThan(self): - geomData = self._runConstraintTest('source', '<', self.source) + geomData = self._runConstraintTest('source', '<', 'NLDN') for record in geomData: - self.assertLess(record.getAttribute('source'), self.source) + self.assertLess(record.getAttribute('source'), 'NLDN') def testGetDataWithGreaterThanEquals(self): - geomData = self._runConstraintTest('source', '>=', self.source) + geomData = self._runConstraintTest('source', '>=', 'NLDN') for record in geomData: - self.assertGreaterEqual(record.getAttribute('source'), self.source) + self.assertGreaterEqual(record.getAttribute('source'), 'NLDN') def testGetDataWithLessThanEquals(self): - geomData = self._runConstraintTest('source', '<=', self.source) + geomData = self._runConstraintTest('source', '<=', 'NLDN') for record in geomData: - self.assertLessEqual(record.getAttribute('source'), self.source) + self.assertLessEqual(record.getAttribute('source'), 'NLDN') def testGetDataWithInTuple(self): - geomData = self._runConstraintTest('source', 'in', (self.source, 'GLMev')) + geomData = self._runConstraintTest('source', 'in', ('NLDN', 'ENTLN')) for record in geomData: - self.assertIn(record.getAttribute('source'), (self.source, 'GLMev')) + self.assertIn(record.getAttribute('source'), ('NLDN', 'ENTLN')) def testGetDataWithInList(self): - geomData = self._runConstraintTest('source', 'in', [self.source, 'GLMev']) + geomData = self._runConstraintTest('source', 'in', ['NLDN', 'ENTLN']) for record in geomData: - self.assertIn(record.getAttribute('source'), (self.source, 'GLMev')) + self.assertIn(record.getAttribute('source'), ('NLDN', 'ENTLN')) def testGetDataWithInGenerator(self): - generator = (item for item in (self.source, 'GLMev')) + generator = (item for item in ('NLDN', 'ENTLN')) geomData = self._runConstraintTest('source', 'in', generator) for record in geomData: - self.assertIn(record.getAttribute('source'), (self.source, 'GLMev')) + self.assertIn(record.getAttribute('source'), ('NLDN', 'ENTLN')) def testGetDataWithNotInList(self): - geomData = self._runConstraintTest('source', 'not in', [self.source, 'blah']) + geomData = self._runConstraintTest('source', 'not in', ['NLDN', 'blah']) for record in geomData: - self.assertNotIn(record.getAttribute('source'), (self.source, 'blah')) + self.assertNotIn(record.getAttribute('source'), ('NLDN', 'blah')) def testGetDataWithInvalidConstraintTypeThrowsException(self): with self.assertRaises(ValueError): - self._runConstraintTest('source', 'junk', self.source) + self._runConstraintTest('source', 'junk', 'NLDN') def testGetDataWithInvalidConstraintValueThrowsException(self): with self.assertRaises(TypeError): diff --git a/awips/test/dafTests/testBufrMosAvn.py b/awips/test/dafTests/testBufrMosAvn.py new file mode 100644 index 0000000..d79a056 --- /dev/null +++ b/awips/test/dafTests/testBufrMosAvn.py @@ -0,0 +1,44 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + + +from . import baseBufrMosTestCase + +# +# Test DAF support for bufrmosAVN data +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 01/19/16 4795 mapeters Initial Creation. +# 04/11/16 5548 tgurney Cleanup +# 04/18/16 5548 tgurney More cleanup +# +# + + +class BufrMosAvnTestCase(baseBufrMosTestCase.BufrMosTestCase): + """Test DAF support for bufrmosAVN data""" + + datatype = "bufrmosAVN" + + # All tests inherited from superclass diff --git a/awips/test/dafTests/testBufrMosEta.py b/awips/test/dafTests/testBufrMosEta.py new file mode 100644 index 0000000..1719002 --- /dev/null +++ b/awips/test/dafTests/testBufrMosEta.py @@ -0,0 +1,44 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + + +from . import baseBufrMosTestCase + +# +# Test DAF support for bufrmosETA data +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 01/19/16 4795 mapeters Initial Creation. +# 04/11/16 5548 tgurney Cleanup +# 04/18/16 5548 tgurney More cleanup +# +# + + +class BufrMosEtaTestCase(baseBufrMosTestCase.BufrMosTestCase): + """Test DAF support for bufrmosETA data""" + + datatype = "bufrmosETA" + + # All tests inherited from superclass diff --git a/awips/test/dafTests/testBufrMosGfs.py b/awips/test/dafTests/testBufrMosGfs.py index 886f4d4..062bf6b 100644 --- a/awips/test/dafTests/testBufrMosGfs.py +++ b/awips/test/dafTests/testBufrMosGfs.py @@ -1,3 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + + +from . import baseBufrMosTestCase + # # Test DAF support for bufrmosGFS data # @@ -11,8 +35,6 @@ # # -from awips.test.dafTests import baseBufrMosTestCase - class BufrMosGfsTestCase(baseBufrMosTestCase.BufrMosTestCase): """Test DAF support for bufrmosGFS data""" diff --git a/awips/test/dafTests/testBufrMosHpc.py b/awips/test/dafTests/testBufrMosHpc.py new file mode 100644 index 0000000..ad96e0e --- /dev/null +++ b/awips/test/dafTests/testBufrMosHpc.py @@ -0,0 +1,46 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from . import baseBufrMosTestCase + +# +# Test DAF support for bufrmosHPC data +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 01/19/16 4795 mapeters Initial Creation. +# 04/11/16 5548 tgurney Cleanup +# 04/18/16 5548 tgurney More cleanup +# 12/07/16 5981 tgurney Parameterize +# 12/20/16 5981 tgurney Inherit all tests +# +# + + +class BufrMosHpcTestCase(baseBufrMosTestCase.BufrMosTestCase): + """Test DAF support for bufrmosHPC data""" + + datatype = "bufrmosHPC" + data_params = "forecastHr", "maxTemp24Hour" + + # All tests inherited from superclass \ No newline at end of file diff --git a/awips/test/dafTests/testBufrMosLamp.py b/awips/test/dafTests/testBufrMosLamp.py new file mode 100644 index 0000000..d77f9b3 --- /dev/null +++ b/awips/test/dafTests/testBufrMosLamp.py @@ -0,0 +1,44 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + + +from . import baseBufrMosTestCase + +# +# Test DAF support for bufrmosLAMP data +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 01/19/16 4795 mapeters Initial Creation. +# 04/11/16 5548 tgurney Cleanup +# 04/18/16 5548 tgurney More cleanup +# +# + + +class BufrMosLampTestCase(baseBufrMosTestCase.BufrMosTestCase): + """Test DAF support for bufrmosLAMP data""" + + datatype = "bufrmosLAMP" + + # All tests inherited from superclass diff --git a/awips/test/dafTests/testBufrMosMrf.py b/awips/test/dafTests/testBufrMosMrf.py new file mode 100644 index 0000000..016fd47 --- /dev/null +++ b/awips/test/dafTests/testBufrMosMrf.py @@ -0,0 +1,45 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +from . import baseBufrMosTestCase + +# +# Test DAF support for bufrmosMRF data +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 01/19/16 4795 mapeters Initial Creation. +# 04/11/16 5548 tgurney Cleanup +# 04/18/16 5548 tgurney More cleanup +# 12/07/16 5981 tgurney Parameterize +# 12/20/16 5981 tgurney Inherit all tests +# +# + + +class BufrMosMrfTestCase(baseBufrMosTestCase.BufrMosTestCase): + """Test DAF support for bufrmosMRF data""" + + datatype = "bufrmosMRF" + data_params = "forecastHr", "maxTempDay" + + # All tests inherited from superclass diff --git a/awips/test/dafTests/testBufrUa.py b/awips/test/dafTests/testBufrUa.py index d2b1c6a..2c4cd32 100644 --- a/awips/test/dafTests/testBufrUa.py +++ b/awips/test/dafTests/testBufrUa.py @@ -1,9 +1,30 @@ -from __future__ import print_function -from awips.dataaccess import DataAccessLayer as DAL +# # +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# # + + +from ufpy.dataaccess import DataAccessLayer as DAL from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint -from awips.test.dafTests import baseDafTestCase -from awips.test.dafTests import params +from . import baseDafTestCase +from . import params +import unittest # # Test DAF support for bufrua data @@ -110,11 +131,6 @@ class BufrUaTestCase(baseDafTestCase.DafTestCase): for record in geometryData: self.assertEqual(record.getString('rptType'), '2022') - def testGetDataWithEqualsLong(self): - geometryData = self._runConstraintTest('reportType', '=', 2022) - for record in geometryData: - self.assertEqual(record.getString('rptType'), '2022') - # No float test because no float identifiers are available def testGetDataWithEqualsNone(self): diff --git a/awips/test/dafTests/testClimate.py b/awips/test/dafTests/testClimate.py new file mode 100644 index 0000000..3738212 --- /dev/null +++ b/awips/test/dafTests/testClimate.py @@ -0,0 +1,419 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +import datetime +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint +from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange +from ufpy.dataaccess import DataAccessLayer as DAL +from ufpy.ThriftClient import ThriftRequestException + +from . import baseDafTestCase +from . import params + +# +# Test DAF support for climate data +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 01/19/16 4795 mapeters Initial Creation. +# 04/11/16 5548 tgurney Cleanup +# 04/18/16 5548 tgurney More cleanup +# 04/26/16 5587 tgurney Add identifier values tests +# 06/09/16 5574 mapeters Add advanced query tests, Short parameter test +# 06/13/16 5574 tgurney Fix checks for None +# 06/21/16 5548 tgurney Skip tests that cause errors +# 06/30/16 5725 tgurney Add test for NOT IN +# 10/06/16 5926 dgilling Add additional time and location tests. +# 12/07/16 5981 tgurney Parameterize +# 12/20/16 5981 tgurney Add envelope test +# 08/16/17 6388 tgurney Test for duplicate data +# +# + + +class ClimateTestCase(baseDafTestCase.DafTestCase): + """Test DAF support for climate data""" + + datatype = 'climate' + obsStation = params.OBS_STATION + + def testGetAvailableParameters(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_monthly') + self.runParametersTest(req) + + def testGetAvailableLocations(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_monthly') + self.runLocationsTest(req) + + def testGetAvailableLocationsForRptTable(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.rpt') + self.runLocationsTest(req) + + def testGetAvailableLocationsForStationId(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.day_climate_norm') + self.runLocationsTest(req) + + def testGetAvailableLocationsForInformId(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_mon_season_yr') + self.runLocationsTest(req) + + def testGetAvailableLocationsWithConstraints(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_monthly') + req.addIdentifier('maxtemp_mon', RequestConstraint.new('>', 95)) + self.runLocationsTest(req) + + def testGetAvailableLocationsWithInvalidTable(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.boolean_values') + with self.assertRaises(ThriftRequestException) as cm: + DAL.getAvailableLocationNames(req) + self.assertIn('IncompatibleRequestException', str(cm.exception)) + + def testGetAvailableTimes(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_monthly') + req.setParameters('maxtemp_mon', 'min_sea_press') + self.runTimesTest(req) + + def testGetAvailableTimesWithLocationNamesForYearMonth(self): + """ + Test retrieval of times for a climo table that uses year and + month columns to build DataTimes. + """ + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_monthly') + req.setLocationNames(self.obsStation, 'KABR', 'KDMO') + req.setParameters('maxtemp_mon', 'min_sea_press') + self.runTimesTest(req) + + def testGetAvailableTimesWithLocationNamesForYearDayOfYear(self): + """ + Test retrieval of times for a climo table that uses year and + day_of_year columns to build DataTimes. + """ + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_daily') + req.setLocationNames(self.obsStation, 'KABR', 'KDMO') + req.setParameters('maxtemp_cal', 'min_press') + self.runTimesTest(req) + + def testGetAvailableTimesWithLocationNamesForPeriod(self): + """ + Test retrieval of times for a climo table that uses + period_start and period_end columns to build DataTimes. + """ + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_mon_season_yr') + req.setLocationNames(self.obsStation, 'KABR', 'KDMO') + req.setParameters('max_temp', 'precip_total') + self.runTimesTest(req) + + def testGetAvailableTimesWithLocationNamesForDate(self): + """ + Test retrieval of times for a climo table that uses a date + column to build DataTimes. + """ + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.daily_climate') + req.setLocationNames(self.obsStation, 'KABR', 'KDMO') + req.setParameters('max_temp', 'precip', 'avg_wind_speed') + self.runTimesTest(req) + + def testGetAvailableTimesWithConstraint(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_monthly') + req.addIdentifier('maxtemp_mon', RequestConstraint.new('<', 75)) + req.setParameters('maxtemp_mon', 'min_sea_press') + self.runTimesTest(req) + + def testGetGeometryData(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_monthly') + req.setLocationNames('KFNB') + req.setParameters('maxtemp_mon', 'min_sea_press') + self.runGeometryDataTest(req) + + def testGetGeometryDataWithEnvelopeThrowsException(self): + # Envelope is not used + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_monthly') + req.setParameters('maxtemp_mon', 'min_sea_press') + req.setEnvelope(params.ENVELOPE) + with self.assertRaises(Exception): + self.runGeometryDataTest(req) + + def testGetGeometryDataForYearAndDayOfYearTable(self): + """ + Test retrieval of data for a climo table that uses year and + day_of_year columns to build DataTimes. + """ + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_daily') + req.setLocationNames('KFNB') + req.setParameters('maxtemp_cal', 'min_press') + self.runGeometryDataTest(req) + + def testGetGeometryDataForPeriodTable(self): + """ + Test retrieval of data for a climo table that uses a period_start and + period_end columns to build DataTimes. + """ + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_mon_season_yr') + req.setLocationNames('KFNB') + req.setParameters('max_temp', 'precip_total') + self.runGeometryDataTest(req) + + def testGetGeometryDataForDateTable(self): + """ + Test retrieval of data for a climo table that uses a date column to + build DataTimes. + """ + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.daily_climate') + req.setLocationNames('KFNB') + req.setParameters('max_temp', 'precip', 'avg_wind_speed') + self.runGeometryDataTest(req) + + def testGetGeometryDataWithShortParameter(self): + """ + Test that a parameter that is stored in Java as a Short is correctly + retrieved as a number. + """ + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'cli_asos_monthly') + req.setParameters('month') + geometryData = self.runGeometryDataTest(req) + for record in geometryData: + self.assertIsNotNone(record.getNumber('month')) + + def testGetTableIdentifierValues(self): + self.runGetIdValuesTest(['table']) + + def testGetColumnIdValuesWithTable(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_monthly') + idValues = DAL.getIdentifierValues(req, 'year') + self.assertTrue(hasattr(idValues, '__iter__')) + + def testGetColumnIdValuesWithoutTableThrowsException(self): + req = DAL.newDataRequest(self.datatype) + with self.assertRaises(ThriftRequestException): + DAL.getIdentifierValues(req, 'year') + + def testGetInvalidIdentifierValuesThrowsException(self): + self.runInvalidIdValuesTest() + + def testGetNonexistentIdentifierValuesThrowsException(self): + self.runNonexistentIdValuesTest() + + def _runConstraintTest(self, key, operator, value): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'cli_asos_monthly') + constraint = RequestConstraint.new(operator, value) + req.addIdentifier(key, constraint) + req.setParameters('station_code', 'avg_daily_max') + return self.runGeometryDataTest(req) + + def testGetDataWithEqualsString(self): + geometryData = self._runConstraintTest('station_code', '=', self.obsStation) + for record in geometryData: + self.assertEqual(record.getString('station_code'), self.obsStation) + + def testGetDataWithEqualsInt(self): + geometryData = self._runConstraintTest('avg_daily_max', '=', 70) + for record in geometryData: + self.assertEqual(record.getNumber('avg_daily_max'), 70) + + def testGetDataWithEqualsFloat(self): + geometryData = self._runConstraintTest('avg_daily_max', '=', 69.2) + for record in geometryData: + self.assertEqual(round(record.getNumber('avg_daily_max'), 1), 69.2) + + def testGetDataWithEqualsNone(self): + geometryData = self._runConstraintTest('station_code', '=', None) + self.assertEqual(len(geometryData), 0) + + def testGetDataWithNotEquals(self): + geometryData = self._runConstraintTest('station_code', '!=', self.obsStation) + for record in geometryData: + self.assertNotEqual(record.getString('station_code'), self.obsStation) + + def testGetDataWithNotEqualsNone(self): + geometryData = self._runConstraintTest('station_code', '!=', None) + for record in geometryData: + self.assertNotEqual(record.getType('station_code'), 'NULL') + + def testGetDataWithGreaterThan(self): + geometryData = self._runConstraintTest('avg_daily_max', '>', 70) + for record in geometryData: + self.assertGreater(record.getNumber('avg_daily_max'), 70) + + def testGetDataWithLessThan(self): + geometryData = self._runConstraintTest('avg_daily_max', '<', 70) + for record in geometryData: + self.assertLess(record.getNumber('avg_daily_max'), 70) + + def testGetDataWithGreaterThanEquals(self): + geometryData = self._runConstraintTest('avg_daily_max', '>=', 70) + for record in geometryData: + self.assertGreaterEqual(record.getNumber('avg_daily_max'), 70) + + def testGetDataWithLessThanEquals(self): + geometryData = self._runConstraintTest('avg_daily_max', '<=', 70) + for record in geometryData: + self.assertLessEqual(record.getNumber('avg_daily_max'), 70) + + def testGetDataWithInTuple(self): + collection = (self.obsStation, 'KABR') + geometryData = self._runConstraintTest('station_code', 'in', collection) + for record in geometryData: + self.assertIn(record.getString('station_code'), collection) + + def testGetDataWithInList(self): + collection = [self.obsStation, 'KABR'] + geometryData = self._runConstraintTest('station_code', 'in', collection) + for record in geometryData: + self.assertIn(record.getString('station_code'), collection) + + def testGetDataWithInGenerator(self): + collection = (self.obsStation, 'KABR') + generator = (item for item in collection) + geometryData = self._runConstraintTest('station_code', 'in', generator) + for record in geometryData: + self.assertIn(record.getString('station_code'), collection) + + def testGetDataWithNotInList(self): + collection = ['KORD', 'KABR'] + geometryData = self._runConstraintTest('station_code', 'not in', collection) + for record in geometryData: + self.assertNotIn(record.getString('station_code'), collection) + + def testGetDataWithInvalidConstraintTypeThrowsException(self): + with self.assertRaises(ValueError): + self._runConstraintTest('station_code', 'junk', self.obsStation) + + def testGetDataWithInvalidConstraintValueThrowsException(self): + with self.assertRaises(TypeError): + self._runConstraintTest('station_code', '=', {}) + + def testGetDataWithEmptyInConstraintThrowsException(self): + with self.assertRaises(ValueError): + self._runConstraintTest('station_code', 'in', []) + + def testGetDataWithTimeRangeWithYearAndMonth1(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_monthly') + req.setLocationNames('KFNB') + req.setParameters('maxtemp_mon', 'min_sea_press') + startTime = datetime.datetime(2009, 1, 1) + endTime = datetime.datetime(2009, 12, 31) + tr = TimeRange(startTime, endTime) + self.runGeometryDataTestWithTimeRange(req, tr) + + def testGetDataWithTimeRangeWithYearAndMonth2(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_monthly') + req.setLocationNames('KFNB') + req.setParameters('maxtemp_mon', 'min_sea_press') + startTime = datetime.datetime(2008, 1, 1) + endTime = datetime.datetime(2009, 3, 31) + tr = TimeRange(startTime, endTime) + self.runGeometryDataTestWithTimeRange(req, tr) + + def testGetDataWithTimeRangeWithYearAndMonth3(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_monthly') + req.setLocationNames('KFNB') + req.setParameters('maxtemp_mon', 'min_sea_press') + startTime = datetime.datetime(2007, 7, 1) + endTime = datetime.datetime(2009, 3, 31) + tr = TimeRange(startTime, endTime) + self.runGeometryDataTestWithTimeRange(req, tr) + + def testGetDataWithTimeRangeWithYearAndDayOfYear1(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_daily') + req.setLocationNames('KFNB') + req.setParameters('maxtemp_cal', 'min_press') + startTime = datetime.datetime(2009, 1, 1) + endTime = datetime.datetime(2009, 7, 31) + tr = TimeRange(startTime, endTime) + self.runGeometryDataTestWithTimeRange(req, tr) + + def testGetDataWithTimeRangeWithYearAndDayOfYear2(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_daily') + req.setLocationNames('KFNB') + req.setParameters('maxtemp_cal', 'min_press') + startTime = datetime.datetime(2008, 7, 1) + endTime = datetime.datetime(2009, 3, 31) + tr = TimeRange(startTime, endTime) + self.runGeometryDataTestWithTimeRange(req, tr) + + def testGetDataWithTimeRangeWithYearAndDayOfYear3(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_daily') + req.setLocationNames('KFNB') + req.setParameters('maxtemp_cal', 'min_press') + startTime = datetime.datetime(2007, 7, 1) + endTime = datetime.datetime(2009, 3, 31) + tr = TimeRange(startTime, endTime) + self.runGeometryDataTestWithTimeRange(req, tr) + + def testGetDataWithTimeRangeWithPeriodTable(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_mon_season_yr') + req.setLocationNames('KFNB') + req.setParameters('max_temp', 'precip_total') + startTime = datetime.datetime(2007, 7, 1) + endTime = datetime.datetime(2009, 3, 31) + tr = TimeRange(startTime, endTime) + self.runGeometryDataTestWithTimeRange(req, tr) + + def testGetDataWithTimeRangeWithForDateTable(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.daily_climate') + req.setLocationNames('KFNB') + req.setParameters('max_temp', 'precip', 'avg_wind_speed') + startTime = datetime.datetime(2007, 7, 1) + endTime = datetime.datetime(2009, 3, 31) + tr = TimeRange(startTime, endTime) + self.runGeometryDataTestWithTimeRange(req, tr) + + def testNoDuplicateData(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.cli_asos_monthly') + req.setLocationNames('KOMA') + req.setParameters('maxtemp_day1') + rows = DAL.getGeometryData(req, DAL.getAvailableTimes(req)[0:5]) + for i in range(len(rows)): + for j in range(len(rows)): + if i != j: + self.assertNotEqual(rows[i].__dict__, rows[j].__dict__) diff --git a/awips/test/dafTests/testCombinedTimeQuery.py b/awips/test/dafTests/testCombinedTimeQuery.py index 08222c8..a7e6b80 100644 --- a/awips/test/dafTests/testCombinedTimeQuery.py +++ b/awips/test/dafTests/testCombinedTimeQuery.py @@ -1,3 +1,30 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +from awips.dataaccess import DataAccessLayer as DAL + +from awips.dataaccess import CombinedTimeQuery as CTQ + +import unittest +import os + # # Test the CombinedTimedQuery module # @@ -11,39 +38,30 @@ # # -from awips.dataaccess import DataAccessLayer as DAL -from awips.dataaccess import CombinedTimeQuery as CTQ - -import unittest -import os - - class CombinedTimeQueryTestCase(unittest.TestCase): - modelName = "RAP13" - @classmethod def setUp(cls): host = os.environ.get('DAF_TEST_HOST') if host is None: - host = 'edex-cloud.unidata.ucar.edu' + host = 'localhost' DAL.changeEDEXHost(host) def testSuccessfulQuery(self): req = DAL.newDataRequest('grid') - req.setLocationNames(self.modelName) - req.setParameters('T', 'GH') - req.setLevels('300MB', '500MB', '700MB') - times = CTQ.getAvailableTimes(req) + req.setLocationNames('RUC130') + req.setParameters('T','GH') + req.setLevels('300MB', '500MB','700MB') + times = CTQ.getAvailableTimes(req); self.assertNotEqual(len(times), 0) - + def testNonIntersectingQuery(self): """ Test that when a parameter is only available on one of the levels that no times are returned. """ req = DAL.newDataRequest('grid') - req.setLocationNames(self.modelName) - req.setParameters('T', 'GH', 'LgSP1hr') - req.setLevels('300MB', '500MB', '700MB', '0.0SFC') - times = CTQ.getAvailableTimes(req) + req.setLocationNames('RUC130') + req.setParameters('T','GH', 'LgSP1hr') + req.setLevels('300MB', '500MB','700MB','0.0SFC') + times = CTQ.getAvailableTimes(req); self.assertEqual(len(times), 0) diff --git a/awips/test/dafTests/testCommonObsSpatial.py b/awips/test/dafTests/testCommonObsSpatial.py index acb9310..5eb294b 100644 --- a/awips/test/dafTests/testCommonObsSpatial.py +++ b/awips/test/dafTests/testCommonObsSpatial.py @@ -1,3 +1,30 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from ufpy.dataaccess import DataAccessLayer as DAL + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint +from . import baseDafTestCase +from . import params + # # Test DAF support for common_obs_spatial data # @@ -18,12 +45,6 @@ # 01/06/17 5981 tgurney Do not check data times # -from __future__ import print_function -from awips.dataaccess import DataAccessLayer as DAL -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint -from awips.test.dafTests import baseDafTestCase -from awips.test.dafTests import params - class CommonObsSpatialTestCase(baseDafTestCase.DafTestCase): """Test DAF support for common_obs_spatial data""" @@ -69,11 +90,6 @@ class CommonObsSpatialTestCase(baseDafTestCase.DafTestCase): for record in geometryData: self.assertEqual(record.getNumber('catalogtype'), 32) - def testGetDataWithEqualsLong(self): - geometryData = self._runConstraintTest('elevation', '=', 0) - for record in geometryData: - self.assertEqual(record.getNumber('elevation'), 0) - # No float test since there are no float identifiers available. Attempting # to filter a non-float identifier on a float value raises an exception. diff --git a/awips/test/dafTests/testDataTime.py b/awips/test/dafTests/testDataTime.py index d543703..4503235 100644 --- a/awips/test/dafTests/testDataTime.py +++ b/awips/test/dafTests/testDataTime.py @@ -1,3 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +from dynamicserialize.dstypes.com.raytheon.uf.common.time import DataTime + +import unittest + # # Unit tests for Python implementation of RequestConstraint # @@ -9,10 +33,6 @@ # # -from dynamicserialize.dstypes.com.raytheon.uf.common.time import DataTime - -import unittest - class DataTimeTestCase(unittest.TestCase): @@ -37,14 +57,14 @@ class DataTimeTestCase(unittest.TestCase): self.assertEqual(expected, str(DataTime(s))) s = s.replace(' ', '_') self.assertEqual(expected, str(DataTime(s))) - + def testFromStrWithFcstTimeHr(self): s = '2016-08-02 01:23:45 (17)' expected = s self.assertEqual(expected, str(DataTime(s))) s = s.replace(' ', '_') self.assertEqual(expected, str(DataTime(s))) - + def testFromStrWithFcstTimeHrZeroMillis(self): s = '2016-08-02 01:23:45.0 (17)' expected = '2016-08-02 01:23:45 (17)' @@ -58,7 +78,7 @@ class DataTimeTestCase(unittest.TestCase): self.assertEqual(expected, str(DataTime(s))) s = s.replace(' ', '_') self.assertEqual(expected, str(DataTime(s))) - + def testFromStrWithFcstTimeHrMin(self): s = '2016-08-02 01:23:45 (17:34)' expected = s @@ -72,28 +92,28 @@ class DataTimeTestCase(unittest.TestCase): self.assertEqual(expected, str(DataTime(s))) s = s.replace(' ', '_') self.assertEqual(expected, str(DataTime(s))) - + def testFromStrWithPeriod(self): s = '2016-08-02 01:23:45[2016-08-02 02:34:45--2016-08-02 03:45:56]' expected = s self.assertEqual(expected, str(DataTime(s))) s = s.replace(' ', '_') self.assertEqual(expected, str(DataTime(s))) - + def testFromStrWithPeriodZeroMillis(self): s = '2016-08-02 01:23:45.0[2016-08-02 02:34:45.0--2016-08-02 03:45:56.0]' expected = '2016-08-02 01:23:45[2016-08-02 02:34:45--2016-08-02 03:45:56]' self.assertEqual(expected, str(DataTime(s))) s = s.replace(' ', '_') self.assertEqual(expected, str(DataTime(s))) - + def testFromStrWithEverything(self): s = '2016-08-02 01:23:45.0_(17:34)[2016-08-02 02:34:45.0--2016-08-02 03:45:56.0]' expected = '2016-08-02 01:23:45 (17:34)[2016-08-02 02:34:45--2016-08-02 03:45:56]' self.assertEqual(expected, str(DataTime(s))) s = s.replace(' ', '_') self.assertEqual(expected, str(DataTime(s))) - + def testDataTimeReconstructItselfFromString(self): times = [ '2016-08-02 01:23:45', @@ -111,4 +131,4 @@ class DataTimeTestCase(unittest.TestCase): '2016-08-02 01:23:45.456_(17:34)[2016-08-02_02:34:45.0--2016-08-02_03:45:56.0]' ] for time in times: - self.assertEqual(DataTime(time), DataTime(str(DataTime(time))), time) + self.assertEqual(DataTime(time), DataTime(str(DataTime(time))), time) \ No newline at end of file diff --git a/awips/test/dafTests/testFfmp.py b/awips/test/dafTests/testFfmp.py new file mode 100644 index 0000000..cd0bc7a --- /dev/null +++ b/awips/test/dafTests/testFfmp.py @@ -0,0 +1,222 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint +from ufpy.dataaccess import DataAccessLayer as DAL + +from . import baseDafTestCase +from . import params + +# +# Test DAF support for ffmp data +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 01/19/16 4795 mapeters Initial Creation. +# 04/11/16 5548 tgurney Cleanup +# 04/18/16 5548 tgurney More cleanup +# 04/18/16 5587 tgurney Add test for sane handling of +# zero records returned +# 06/20/16 5587 tgurney Add identifier values tests +# 07/01/16 5728 mapeters Add advanced query tests, +# include huc and accumHrs in +# id values tests, test that +# accumHrs id is never required +# 08/03/16 5728 mapeters Fixed minor bugs, replaced +# PRTM parameter since it isn't +# configured for ev-oma +# 11/08/16 5985 tgurney Do not check data times +# 12/07/16 5981 tgurney Parameterize +# 12/20/16 5981 tgurney Do not check data times +# +# + + +class FfmpTestCase(baseDafTestCase.DafTestCase): + """Test DAF support for ffmp data""" + + datatype = 'ffmp' + location = params.RADAR.lower() + + @staticmethod + def addIdentifiers(req): + req.addIdentifier('wfo', params.SITE_ID) + req.addIdentifier('siteKey', 'hpe') + req.addIdentifier('dataKey', 'hpe') + req.addIdentifier('huc', 'ALL') + + def testGetAvailableParameters(self): + req = DAL.newDataRequest(self.datatype) + self.runParametersTest(req) + + def testGetAvailableLocations(self): + req = DAL.newDataRequest(self.datatype) + self.addIdentifiers(req) + self.runLocationsTest(req) + + def testGetAvailableTimes(self): + req = DAL.newDataRequest(self.datatype) + self.addIdentifiers(req) + req.setParameters('DHRMOSAIC') + self.runTimesTest(req) + + def testGetGeometryData(self): + req = DAL.newDataRequest(self.datatype) + self.addIdentifiers(req) + req.setParameters('DHRMOSAIC') + self.runGeometryDataTest(req, checkDataTimes=False) + + def testGetGeometryDataEmptyResult(self): + req = DAL.newDataRequest(self.datatype) + self.addIdentifiers(req) + req.setParameters('blah blah blah') # force 0 records returned + result = self.runGeometryDataTest(req, checkDataTimes=False) + self.assertEqual(len(result), 0) + + def testGetIdentifierValues(self): + req = DAL.newDataRequest(self.datatype) + optionalIds = set(DAL.getOptionalIdentifiers(req)) + requiredIds = set(DAL.getRequiredIdentifiers(req)) + ids = requiredIds | optionalIds + for id in ids: + req = DAL.newDataRequest(self.datatype) + if id == 'accumHrs': + req.setParameters('ARI6H2YR') + req.addIdentifier('wfo', params.SITE_ID) + req.addIdentifier('siteKey', self.location) + req.addIdentifier('huc', 'ALL') + idValues = DAL.getIdentifierValues(req, id) + self.assertTrue(hasattr(idValues, '__iter__')) + print(id + " values: " + str(idValues)) + + def testGetInvalidIdentifierValuesThrowsException(self): + self.runInvalidIdValuesTest() + + def testGetNonexistentIdentifierValuesThrowsException(self): + self.runNonexistentIdValuesTest() + + def _runConstraintTest(self, key, operator, value): + req = DAL.newDataRequest(self.datatype) + constraint = RequestConstraint.new(operator, value) + req.addIdentifier(key, constraint) + req.addIdentifier('wfo', params.SITE_ID) + req.addIdentifier('huc', 'ALL') + req.setParameters('QPFSCAN') + return self.runGeometryDataTest(req, checkDataTimes=False) + + def testGetDataWithEqualsString(self): + geometryData = self._runConstraintTest('siteKey', '=', self.location) + for record in geometryData: + self.assertEqual(record.getAttribute('siteKey'), self.location) + + # No numeric tests since no numeric identifiers are available that support + # RequestConstraints. + + def testGetDataWithEqualsNone(self): + geometryData = self._runConstraintTest('siteKey', '=', None) + for record in geometryData: + self.assertIsNone(record.getAttribute('siteKey')) + + def testGetDataWithNotEquals(self): + geometryData = self._runConstraintTest('siteKey', '!=', self.location) + for record in geometryData: + self.assertNotEqual(record.getAttribute('siteKey'), self.location) + + def testGetDataWithNotEqualsNone(self): + geometryData = self._runConstraintTest('siteKey', '!=', None) + for record in geometryData: + self.assertIsNotNone(record.getAttribute('siteKey')) + + def testGetDataWithGreaterThan(self): + geometryData = self._runConstraintTest('siteKey', '>', self.location) + for record in geometryData: + self.assertGreater(record.getAttribute('siteKey'), self.location) + + def testGetDataWithLessThan(self): + geometryData = self._runConstraintTest('siteKey', '<', self.location) + for record in geometryData: + self.assertLess(record.getAttribute('siteKey'), self.location) + + def testGetDataWithGreaterThanEquals(self): + geometryData = self._runConstraintTest('siteKey', '>=', self.location) + for record in geometryData: + self.assertGreaterEqual(record.getAttribute('siteKey'), self.location) + + def testGetDataWithLessThanEquals(self): + geometryData = self._runConstraintTest('siteKey', '<=', self.location) + for record in geometryData: + self.assertLessEqual(record.getAttribute('siteKey'), self.location) + + def testGetDataWithInList(self): + collection = [self.location, 'kuex'] + geometryData = self._runConstraintTest('siteKey', 'in', collection) + for record in geometryData: + self.assertIn(record.getAttribute('siteKey'), collection) + + def testGetDataWithNotInList(self): + collection = [self.location, 'kuex'] + geometryData = self._runConstraintTest('siteKey', 'not in', collection) + for record in geometryData: + self.assertNotIn(record.getAttribute('siteKey'), collection) + + def testGetDataWithInvalidConstraintTypeThrowsException(self): + with self.assertRaises(ValueError): + self._runConstraintTest('siteKey', 'junk', self.location) + + def testGetDataWithInvalidConstraintValueThrowsException(self): + with self.assertRaises(TypeError): + self._runConstraintTest('siteKey', '=', {}) + + def testGetDataWithEmptyInConstraintThrowsException(self): + with self.assertRaises(ValueError): + self._runConstraintTest('siteKey', 'in', []) + + def testGetDataWithSiteKeyAndDataKeyConstraints(self): + siteKeys = [self.location, 'hpe'] + dataKeys = ['kuex', 'kdmx'] + + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('wfo', params.SITE_ID) + req.addIdentifier('huc', 'ALL') + + siteKeysConstraint = RequestConstraint.new('in', siteKeys) + req.addIdentifier('siteKey', siteKeysConstraint) + dataKeysConstraint = RequestConstraint.new('in', dataKeys) + req.addIdentifier('dataKey', dataKeysConstraint) + + req.setParameters('QPFSCAN') + geometryData = self.runGeometryDataTest(req, checkDataTimes=False) + for record in geometryData: + self.assertIn(record.getAttribute('siteKey'), siteKeys) + # dataKey attr. is comma-separated list of dataKeys that had data + for dataKey in record.getAttribute('dataKey').split(','): + self.assertIn(dataKey, dataKeys) + + def testGetGuidanceDataWithoutAccumHrsIdentifierSet(self): + # Test that accumHrs identifier is not required for guidance data + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('wfo', params.SITE_ID) + req.addIdentifier('siteKey', self.location) + req.addIdentifier('huc', 'ALL') + req.setParameters('FFG0124hr') + self.runGeometryDataTest(req, checkDataTimes=False) diff --git a/awips/test/dafTests/testGfe.py b/awips/test/dafTests/testGfe.py index 6750db8..ffab2ce 100644 --- a/awips/test/dafTests/testGfe.py +++ b/awips/test/dafTests/testGfe.py @@ -1,3 +1,32 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint +from ufpy.dataaccess import DataAccessLayer as DAL +from shapely.geometry import box, Point + +from . import baseDafTestCase +from . import params +import unittest + # # Test DAF support for GFE data # @@ -23,15 +52,6 @@ # # -from __future__ import print_function -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint -from awips.dataaccess import DataAccessLayer as DAL -from shapely.geometry import box, Point - -from awips.test.dafTests import baseDafTestCase -from awips.test.dafTests import params -import unittest - class GfeTestCase(baseDafTestCase.DafTestCase): """Test DAF support for GFE data""" @@ -78,7 +98,7 @@ class GfeTestCase(baseDafTestCase.DafTestCase): # Ensure all points are within one degree of the original box # to allow slight margin of error for reprojection distortion. testEnv = box(params.ENVELOPE.bounds[0] - 1, params.ENVELOPE.bounds[1] - 1, - params.ENVELOPE.bounds[2] + 1, params.ENVELOPE.bounds[3] + 1) + params.ENVELOPE.bounds[2] + 1, params.ENVELOPE.bounds[3] + 1 ) for i in range(len(lons)): self.assertTrue(testEnv.contains(Point(lons[i], lats[i]))) @@ -89,17 +109,17 @@ class GfeTestCase(baseDafTestCase.DafTestCase): req.addIdentifier('parmId.dbId.siteId', params.SITE_ID) req.setParameters('Wind') times = DAL.getAvailableTimes(req) - if not times: + if not(times): raise unittest.SkipTest('No Wind Data available for testing') gridData = DAL.getGridData(req, [times[0]]) rawWind = None rawDir = None for grid in gridData: if grid.getParameter() == 'Wind': - self.assertEqual(grid.getUnit(), 'kts') + self.assertEqual(grid.getUnit(),'kts') rawWind = grid.getRawData() elif grid.getParameter() == 'WindDirection': - self.assertEqual(grid.getUnit(), 'deg') + self.assertEqual(grid.getUnit(),'deg') rawDir = grid.getRawData() self.assertIsNotNone(rawWind, 'Wind Magnitude grid is not present') self.assertIsNotNone(rawDir, 'Wind Direction grid is not present') @@ -107,7 +127,7 @@ class GfeTestCase(baseDafTestCase.DafTestCase): self.assertTrue((rawWind >= 0).all(), 'Wind Speed should not contain negative values') self.assertTrue((rawDir >= 0).all(), 'Wind Direction should not contain negative values') self.assertTrue((rawDir <= 360).all(), 'Wind Direction should be less than or equal to 360') - self.assertFalse((rawDir == rawWind).all(), 'Wind Direction should be different from Wind Speed') + self.assertFalse((rawDir == rawWind).all(), 'Wind Direction should be different from Wind Speed') def testGetIdentifierValues(self): req = DAL.newDataRequest(self.datatype) @@ -192,3 +212,4 @@ class GfeTestCase(baseDafTestCase.DafTestCase): def testGetDataWithEmptyInConstraintThrowsException(self): with self.assertRaises(ValueError): self._runConstraintTest('parmId.dbId.modelName', 'in', []) + diff --git a/awips/test/dafTests/testGfeEditArea.py b/awips/test/dafTests/testGfeEditArea.py new file mode 100644 index 0000000..8c6c0b8 --- /dev/null +++ b/awips/test/dafTests/testGfeEditArea.py @@ -0,0 +1,215 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint +from ufpy.dataaccess import DataAccessLayer as DAL +from ufpy.ThriftClient import ThriftRequestException + +from . import baseDafTestCase +from . import params + +# +# Test DAF support for GFE edit area data +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 06/08/17 6298 mapeters Initial Creation. +# 09/27/17 6463 tgurney Remove GID site identifier +# +# + + +class GfeEditAreaTestCase(baseDafTestCase.DafTestCase): + """Test DAF support for GFE edit area data""" + + datatype = 'gfeEditArea' + + siteIdKey = 'siteId' + + editAreaNames = ['ISC_NHA', 'SDZ066', 'StormSurgeWW_EditArea'] + + groupKey = 'group' + + groups = ['ISC', 'WFOs', 'FIPS_' + params.SITE_ID] + + def testGetAvailableParameters(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier(self.siteIdKey, params.SITE_ID) + with self.assertRaises(ThriftRequestException): + self.runParametersTest(req) + + def testGetAvailableLocations(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier(self.siteIdKey, params.SITE_ID) + self.runLocationsTest(req) + + def testGetAvailableTimes(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier(self.siteIdKey, params.SITE_ID) + with self.assertRaises(ThriftRequestException): + self.runTimesTest(req) + + def testGetGeometryDataWithoutSiteIdThrowsException(self): + req = DAL.newDataRequest(self.datatype) + with self.assertRaises(ThriftRequestException): + self.runGeometryDataTest(req) + + def testGetGeometryData(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier(self.siteIdKey, params.SITE_ID) + data = self.runGeometryDataTest(req) + for item in data: + self.assertEqual(params.SITE_ID, item.getAttribute(self.siteIdKey)) + + def testGetGeometryDataWithLocNames(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier(self.siteIdKey, params.SITE_ID) + req.setLocationNames(*self.editAreaNames) + data = self.runGeometryDataTest(req) + for item in data: + self.assertEqual(params.SITE_ID, item.getAttribute(self.siteIdKey)) + self.assertIn(item.getLocationName(), self.editAreaNames) + + def testGetGeometryDataWithGroups(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier(self.siteIdKey, params.SITE_ID) + req.addIdentifier(self.groupKey, RequestConstraint.new('in', self.groups)) + data = self.runGeometryDataTest(req) + for item in data: + self.assertEqual(params.SITE_ID, item.getAttribute(self.siteIdKey)) + self.assertIn(item.getAttribute(self.groupKey), self.groups) + + def testGetGeometryDataWithLocNamesAndGroupsThrowException(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier(self.siteIdKey, params.SITE_ID) + req.setLocationNames(*self.editAreaNames) + req.addIdentifier(self.groupKey, RequestConstraint.new('in', self.groups)) + with self.assertRaises(ThriftRequestException): + self.runGeometryDataTest(req) + + def testGetGeometryDataWithEnvelope(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier(self.siteIdKey, params.SITE_ID) + req.setEnvelope(params.ENVELOPE) + data = self.runGeometryDataTest(req) + for item in data: + self.assertEqual(params.SITE_ID, item.getAttribute(self.siteIdKey)) + self.assertTrue(params.ENVELOPE.intersects(item.getGeometry())) + + def testGetIdentifierValues(self): + req = DAL.newDataRequest(self.datatype) + optionalIds = set(DAL.getOptionalIdentifiers(req)) + requiredIds = set(DAL.getRequiredIdentifiers(req)) + self.runGetIdValuesTest(optionalIds | requiredIds) + + def testGetInvalidIdentifierValuesThrowsException(self): + self.runInvalidIdValuesTest() + + def testGetNonexistentIdentifierValuesThrowsException(self): + self.runNonexistentIdValuesTest() + + def _runConstraintTest(self, key, operator, value): + req = DAL.newDataRequest(self.datatype) + constraint = RequestConstraint.new(operator, value) + req.addIdentifier(key, constraint) + req.setLocationNames(*self.editAreaNames) + return self.runGeometryDataTest(req) + + def testGetDataWithEqualsString(self): + geomData = self._runConstraintTest(self.siteIdKey, '=', params.SITE_ID) + for record in geomData: + self.assertEqual(record.getAttribute(self.siteIdKey), params.SITE_ID) + + # No numeric tests since no numeric identifiers are available. + + def testGetDataWithEqualsNone(self): + geomData = self._runConstraintTest(self.siteIdKey, '=', None) + for record in geomData: + self.assertIsNone(record.getAttribute(self.siteIdKey)) + + def testGetDataWithNotEquals(self): + geomData = self._runConstraintTest(self.siteIdKey, '!=', params.SITE_ID) + for record in geomData: + self.assertNotEqual(record.getAttribute(self.siteIdKey), params.SITE_ID) + + def testGetDataWithNotEqualsNone(self): + geomData = self._runConstraintTest(self.siteIdKey, '!=', None) + for record in geomData: + self.assertIsNotNone(record.getAttribute(self.siteIdKey)) + + def testGetDataWithGreaterThan(self): + geomData = self._runConstraintTest(self.siteIdKey, '>', params.SITE_ID) + for record in geomData: + self.assertGreater(record.getAttribute(self.siteIdKey), params.SITE_ID) + + def testGetDataWithLessThan(self): + geomData = self._runConstraintTest(self.siteIdKey, '<', params.SITE_ID) + for record in geomData: + self.assertLess(record.getAttribute(self.siteIdKey), params.SITE_ID) + + def testGetDataWithGreaterThanEquals(self): + geomData = self._runConstraintTest(self.siteIdKey, '>=', params.SITE_ID) + for record in geomData: + self.assertGreaterEqual(record.getAttribute(self.siteIdKey), params.SITE_ID) + + def testGetDataWithLessThanEquals(self): + geomData = self._runConstraintTest(self.siteIdKey, '<=', params.SITE_ID) + for record in geomData: + self.assertLessEqual(record.getAttribute(self.siteIdKey), params.SITE_ID) + + def testGetDataWithInTuple(self): + collection = (params.SITE_ID,) + geomData = self._runConstraintTest(self.siteIdKey, 'in', collection) + for record in geomData: + self.assertIn(record.getAttribute(self.siteIdKey), collection) + + def testGetDataWithInList(self): + collection = [params.SITE_ID,] + geomData = self._runConstraintTest(self.siteIdKey, 'in', collection) + for record in geomData: + self.assertIn(record.getAttribute(self.siteIdKey), collection) + + def testGetDataWithInGenerator(self): + collection = (params.SITE_ID,) + generator = (item for item in collection) + geomData = self._runConstraintTest(self.siteIdKey, 'in', generator) + for record in geomData: + self.assertIn(record.getAttribute(self.siteIdKey), collection) + + def testGetDataWithNotInList(self): + collection = [params.SITE_ID,] + geomData = self._runConstraintTest(self.siteIdKey, 'not in', collection) + for record in geomData: + self.assertNotIn(record.getAttribute(self.siteIdKey), collection) + + def testGetDataWithInvalidConstraintTypeThrowsException(self): + with self.assertRaises(ValueError): + self._runConstraintTest(self.siteIdKey, 'junk', params.SITE_ID) + + def testGetDataWithInvalidConstraintValueThrowsException(self): + with self.assertRaises(TypeError): + self._runConstraintTest(self.siteIdKey, '=', {}) + + def testGetDataWithEmptyInConstraintThrowsException(self): + with self.assertRaises(ValueError): + self._runConstraintTest(self.siteIdKey, 'in', []) diff --git a/awips/test/dafTests/testGrid.py b/awips/test/dafTests/testGrid.py index 6b86a93..abb196b 100644 --- a/awips/test/dafTests/testGrid.py +++ b/awips/test/dafTests/testGrid.py @@ -1,3 +1,33 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint +from shapely.geometry import box, Point +from ufpy.dataaccess import DataAccessLayer as DAL +from ufpy.ThriftClient import ThriftRequestException + +from . import baseDafTestCase +from . import params +import unittest + # # Test DAF support for grid data # @@ -18,18 +48,9 @@ # 12/07/16 5981 tgurney Parameterize # 01/06/17 5981 tgurney Skip envelope test when no # data is available +# 04/14/22 8845 njensen Added testGetDataAtPoint # -from __future__ import print_function -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint -from awips.dataaccess import DataAccessLayer as DAL -from awips.ThriftClient import ThriftRequestException -from shapely.geometry import box, Point - -from awips.test.dafTests import baseDafTestCase -from awips.test.dafTests import params -import unittest - class GridTestCase(baseDafTestCase.DafTestCase): """Test DAF support for grid data""" @@ -86,6 +107,7 @@ class GridTestCase(baseDafTestCase.DafTestCase): def testGetNonexistentIdentifierValuesThrowsException(self): self.runNonexistentIdValuesTest() + def testGetDataWithEnvelope(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier('info.datasetId', self.model) @@ -98,15 +120,16 @@ class GridTestCase(baseDafTestCase.DafTestCase): lons, lats = gridData[0].getLatLonCoords() lons = lons.reshape(-1) lats = lats.reshape(-1) - + # Ensure all points are within one degree of the original box # to allow slight margin of error for reprojection distortion. testEnv = box(params.ENVELOPE.bounds[0] - 1, params.ENVELOPE.bounds[1] - 1, - params.ENVELOPE.bounds[2] + 1, params.ENVELOPE.bounds[3] + 1) - + params.ENVELOPE.bounds[2] + 1, params.ENVELOPE.bounds[3] + 1 ) + for i in range(len(lons)): self.assertTrue(testEnv.contains(Point(lons[i], lats[i]))) + def _runConstraintTest(self, key, operator, value): req = DAL.newDataRequest(self.datatype) constraint = RequestConstraint.new(operator, value) @@ -127,11 +150,6 @@ class GridTestCase(baseDafTestCase.DafTestCase): for record in gridData: self.assertEqual(record.getAttribute('info.level.levelonevalue'), 2000) - def testGetDataWithEqualsLong(self): - gridData = self._runConstraintTest('info.level.levelonevalue', '=', 2000) - for record in gridData: - self.assertEqual(record.getAttribute('info.level.levelonevalue'), 2000) - def testGetDataWithEqualsFloat(self): gridData = self._runConstraintTest('info.level.levelonevalue', '=', 2000.0) for record in gridData: @@ -259,3 +277,11 @@ class GridTestCase(baseDafTestCase.DafTestCase): self.runGridDataTest(req) self.assertIn('IncompatibleRequestException', str(cm.exception)) self.assertIn('info.level.masterLevel.name', str(cm.exception)) + + def testGetDataAtPoint(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('info.datasetId', self.model) + req.setLevels('2FHAG') + req.setParameters('T') + req.setEnvelope(params.POINT) + self.runGeometryDataTest(req) diff --git a/awips/test/dafTests/testHydro.py b/awips/test/dafTests/testHydro.py new file mode 100644 index 0000000..4639844 --- /dev/null +++ b/awips/test/dafTests/testHydro.py @@ -0,0 +1,243 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +import datetime +from ufpy.dataaccess import DataAccessLayer as DAL +from ufpy.ThriftClient import ThriftRequestException + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint +from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange +from . import baseDafTestCase + +# +# Test DAF support for hydro data +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 01/19/16 4795 mapeters Initial Creation. +# 04/11/16 5548 tgurney Cleanup +# 04/18/16 5548 tgurney More cleanup +# 04/21/16 5596 tgurney Add tests to verify #5596 +# 04/26/16 5587 tgurney Add identifier values tests +# 06/09/16 5574 tgurney Add advanced query tests +# 06/13/16 5574 tgurney Fix checks for None +# 06/21/16 5548 tgurney Skip tests that cause errors +# 06/30/16 5725 tgurney Add test for NOT IN +# 10/06/16 5926 dgilling Add additional location tests. +# +# + + +class HydroTestCase(baseDafTestCase.DafTestCase): + """Test DAF support for hydro data""" + + datatype = 'hydro' + + def testGetAvailableParameters(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'height') + self.runParametersTest(req) + + def testGetAvailableParametersFullyQualifiedTable(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'public.height') + self.runParametersTest(req) + + def testGetAvailableParamsNoTableThrowsInvalidIdentifiersException(self): + req = DAL.newDataRequest(self.datatype) + with self.assertRaises(ThriftRequestException) as cm: + self.runParametersTest(req) + self.assertIn('InvalidIdentifiersException', str(cm.exception)) + + def testGetAvailableLocations(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'height') + self.runLocationsTest(req) + + def testGetAvailableLocationsWithConstraint(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'height') + req.addIdentifier('value', RequestConstraint.new('>', 5.0)) + self.runLocationsTest(req) + + def testGetAvailableLocationsWithInvalidTable(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'city') + with self.assertRaises(ThriftRequestException) as cm: + DAL.getAvailableLocationNames(req) + self.assertIn('IncompatibleRequestException', str(cm.exception)) + + def testGetAvailableTimes(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'height') + req.setParameters('lid', 'quality_code') + self.runTimesTest(req) + + def testGetGeometryDataWithoutLocationSpecified(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'height') + req.setParameters('lid', 'quality_code') + self.runGeometryDataTest(req) + + def testGetGeometryDataWithLocationSpecified(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'fcstheight') + locs = DAL.getAvailableLocationNames(req) + if locs: + req.setLocationNames(locs[0]) + req.setParameters('probability', 'value') + data = self.runGeometryDataTest(req) + self.assertNotEqual(len(data), 0) + + def testGetTableIdentifierValues(self): + self.runGetIdValuesTest(['table']) + + def testGetColumnIdValuesWithTable(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'height') + idValues = DAL.getIdentifierValues(req, 'lid') + self.assertTrue(hasattr(idValues, '__iter__')) + + def testGetColumnIdValuesWithoutTableThrowsException(self): + req = DAL.newDataRequest(self.datatype) + with self.assertRaises(ThriftRequestException): + DAL.getIdentifierValues(req, 'lid') + + def testGetInvalidIdentifierValuesThrowsException(self): + self.runInvalidIdValuesTest() + + def testGetNonexistentIdentifierValuesThrowsException(self): + self.runNonexistentIdValuesTest() + + def _runConstraintTest(self, key, operator, value): + req = DAL.newDataRequest(self.datatype) + constraint = RequestConstraint.new(operator, value) + req.addIdentifier(key, constraint) + req.addIdentifier('table', 'height') + req.addIdentifier('ts', 'RG') + req.setParameters('value', 'lid', 'quality_code') + return self.runGeometryDataTest(req) + + def testGetDataWithEqualsString(self): + geometryData = self._runConstraintTest('value', '=', '3') + for record in geometryData: + self.assertEqual(record.getNumber('value'), 3) + + def testGetDataWithEqualsInt(self): + geometryData = self._runConstraintTest('value', '=', 3) + for record in geometryData: + self.assertEqual(record.getNumber('value'), 3) + + def testGetDataWithEqualsFloat(self): + geometryData = self._runConstraintTest('value', '=', 3.0) + for record in geometryData: + self.assertEqual(round(record.getNumber('value'), 1), 3.0) + + def testGetDataWithEqualsNone(self): + geometryData = self._runConstraintTest('value', '=', None) + self.assertEqual(len(geometryData), 0) + + def testGetDataWithNotEquals(self): + geometryData = self._runConstraintTest('value', '!=', 3) + for record in geometryData: + self.assertNotEqual(record.getNumber('value'), '3') + + def testGetDataWithNotEqualsNone(self): + geometryData = self._runConstraintTest('value', '!=', None) + self.assertNotEqual(len(geometryData), 0) + for record in geometryData: + self.assertNotEqual(record.getType('value'), 'NULL') + + def testGetDataWithGreaterThan(self): + geometryData = self._runConstraintTest('value', '>', 3) + for record in geometryData: + self.assertGreater(record.getNumber('value'), 3) + + def testGetDataWithLessThan(self): + geometryData = self._runConstraintTest('value', '<', 3) + for record in geometryData: + self.assertLess(record.getNumber('value'), 3) + + def testGetDataWithGreaterThanEquals(self): + geometryData = self._runConstraintTest('value', '>=', 3) + for record in geometryData: + self.assertGreaterEqual(record.getNumber('value'), 3) + + def testGetDataWithLessThanEquals(self): + geometryData = self._runConstraintTest('value', '<=', 3) + for record in geometryData: + self.assertLessEqual(record.getNumber('value'), 3) + + def testGetDataWithInTuple(self): + collection = (3, 4) + geometryData = self._runConstraintTest('value', 'in', collection) + for record in geometryData: + self.assertIn(record.getNumber('value'), collection) + + def testGetDataWithInList(self): + collection = [3, 4] + geometryData = self._runConstraintTest('value', 'in', collection) + for record in geometryData: + self.assertIn(record.getNumber('value'), collection) + + def testGetDataWithInGenerator(self): + collection = (3, 4) + generator = (item for item in collection) + geometryData = self._runConstraintTest('value', 'in', generator) + for record in geometryData: + self.assertIn(record.getNumber('value'), collection) + + def testGetDataWithNotInList(self): + collection = [3, 4] + geometryData = self._runConstraintTest('value', 'not in', collection) + for record in geometryData: + self.assertNotIn(record.getNumber('value'), collection) + + def testGetDataWithTimeRange(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('table', 'height') + req.addIdentifier('ts', 'RG') + req.setParameters('value', 'lid', 'quality_code') + times = DAL.getAvailableTimes(req) + limitTimes = times[-self.numTimesToLimit:] + startTime = datetime.datetime.utcfromtimestamp(limitTimes[0].getRefTime().getTime()/1000) + endTime = datetime.datetime.utcnow() + tr = TimeRange(startTime, endTime) + self.runGeometryDataTestWithTimeRange(req, tr) + + def testGetDataWithInvalidConstraintTypeThrowsException(self): + with self.assertRaises(ValueError): + self._runConstraintTest('value', 'junk', 3) + + def testGetDataWithInvalidConstraintValueThrowsException(self): + with self.assertRaises(TypeError): + self._runConstraintTest('value', '=', {}) + + def testGetDataWithEmptyInConstraintThrowsException(self): + with self.assertRaises(ValueError): + self._runConstraintTest('value', 'in', []) + + def testGetDataWithNestedInConstraintThrowsException(self): + collection = ('3', '4', ()) + with self.assertRaises(TypeError): + self._runConstraintTest('value', 'in', collection) diff --git a/awips/test/dafTests/testLdadMesonet.py b/awips/test/dafTests/testLdadMesonet.py new file mode 100644 index 0000000..924022d --- /dev/null +++ b/awips/test/dafTests/testLdadMesonet.py @@ -0,0 +1,84 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from shapely.geometry import Polygon +from ufpy.dataaccess import DataAccessLayer as DAL + +from . import baseDafTestCase + +# +# Test DAF support for ldadmesonet data +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 01/19/16 4795 mapeters Initial Creation. +# 04/11/16 5548 tgurney Cleanup +# 04/18/16 5548 tgurney More cleanup +# 01/20/17 6095 tgurney Add null identifiers test +# +# + + +class LdadMesonetTestCase(baseDafTestCase.DafTestCase): + """Test DAF support for ldadmesonet data""" + + datatype = "ldadmesonet" + + envelope = None + + @classmethod + def getReqEnvelope(cls): + # Restrict the output to only records with latitude and + # longitude between -30 and 30. + if not cls.envelope: + vertices = [(-30, -30), (-30, 30), (30, 30), (30, -30)] + polygon = Polygon(vertices) + cls.envelope = polygon.envelope + return cls.envelope + + def testGetAvailableParameters(self): + req = DAL.newDataRequest(self.datatype) + self.runParametersTest(req) + + def testGetAvailableLocations(self): + req = DAL.newDataRequest(self.datatype) + req.setEnvelope(self.getReqEnvelope()) + self.runLocationsTest(req) + + def testGetAvailableTimes(self): + req = DAL.newDataRequest(self.datatype) + req.setEnvelope(self.getReqEnvelope()) + self.runTimesTest(req) + + def testGetGeometryData(self): + req = DAL.newDataRequest(self.datatype) + req.setParameters("highLevelCloud", "pressure") + req.setEnvelope(self.getReqEnvelope()) + self.runGeometryDataTest(req) + + def testGetGeometryDataNullIdentifiers(self): + req = DAL.newDataRequest(self.datatype) + req.setParameters("highLevelCloud", "pressure") + req.setEnvelope(self.getReqEnvelope()) + req.identifiers = None + self.runGeometryDataTest(req) diff --git a/awips/test/dafTests/testMaps.py b/awips/test/dafTests/testMaps.py index 2afcecc..75f5a11 100644 --- a/awips/test/dafTests/testMaps.py +++ b/awips/test/dafTests/testMaps.py @@ -1,3 +1,30 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint +from ufpy.dataaccess import DataAccessLayer as DAL +from ufpy.ThriftClient import ThriftRequestException + +from . import baseDafTestCase + # # Test DAF support for maps data # @@ -16,13 +43,6 @@ # # -from __future__ import print_function -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint -from awips.dataaccess import DataAccessLayer as DAL -from awips.ThriftClient import ThriftRequestException - -from awips.test.dafTests import baseDafTestCase - class MapsTestCase(baseDafTestCase.DafTestCase): """Test DAF support for maps data""" @@ -110,11 +130,6 @@ class MapsTestCase(baseDafTestCase.DafTestCase): for record in geometryData: self.assertEqual(record.getNumber('reservoir'), 1) - def testGetDataWithEqualsLong(self): - geometryData = self._runConstraintTest('reservoir', '=', 1) - for record in geometryData: - self.assertEqual(record.getNumber('reservoir'), 1) - def testGetDataWithEqualsFloat(self): geometryData = self._runConstraintTest('area_sq_mi', '=', 5.00) for record in geometryData: diff --git a/awips/test/dafTests/testModelSounding.py b/awips/test/dafTests/testModelSounding.py index 16acfa1..7d8525b 100644 --- a/awips/test/dafTests/testModelSounding.py +++ b/awips/test/dafTests/testModelSounding.py @@ -1,3 +1,31 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from ufpy.dataaccess import DataAccessLayer as DAL +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint + +from . import baseDafTestCase +from . import params +import unittest + # # Test DAF support for modelsounding data # @@ -19,39 +47,30 @@ # # -from __future__ import print_function -from awips.dataaccess import DataAccessLayer as DAL -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint - -from awips.test.dafTests import baseDafTestCase -from awips.test.dafTests import params - class ModelSoundingTestCase(baseDafTestCase.DafTestCase): """Test DAF support for modelsounding data""" datatype = "modelsounding" - reporttype = "ETA" - def testGetAvailableParameters(self): req = DAL.newDataRequest(self.datatype) self.runParametersTest(req) def testGetAvailableLocations(self): req = DAL.newDataRequest(self.datatype) - req.addIdentifier("reportType", self.reporttype) + req.addIdentifier("reportType", "ETA") self.runLocationsTest(req) def testGetAvailableTimes(self): req = DAL.newDataRequest(self.datatype) - req.addIdentifier("reportType", self.reporttype) + req.addIdentifier("reportType", "ETA") req.setLocationNames(params.OBS_STATION) self.runTimesTest(req) def testGetGeometryData(self): req = DAL.newDataRequest(self.datatype) - req.addIdentifier("reportType", self.reporttype) + req.addIdentifier("reportType", "ETA") req.setLocationNames(params.OBS_STATION) req.setParameters("temperature", "pressure", "specHum", "sfcPress", "temp2", "q2") print("Testing getGeometryData()") @@ -81,7 +100,7 @@ class ModelSoundingTestCase(baseDafTestCase.DafTestCase): def testGetGeometryDataWithEnvelope(self): req = DAL.newDataRequest(self.datatype) - req.addIdentifier("reportType", self.reporttype) + req.addIdentifier("reportType", "ETA") req.setEnvelope(params.ENVELOPE) req.setParameters("temperature", "pressure", "specHum", "sfcPress", "temp2", "q2") print("Testing getGeometryData()") diff --git a/awips/test/dafTests/testObs.py b/awips/test/dafTests/testObs.py index b0d27d2..2ea9354 100644 --- a/awips/test/dafTests/testObs.py +++ b/awips/test/dafTests/testObs.py @@ -1,3 +1,30 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from ufpy.dataaccess import DataAccessLayer as DAL +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint + +from . import baseDafTestCase +from . import params + # # Test DAF support for obs data # @@ -16,13 +43,6 @@ # # -from __future__ import print_function -from awips.dataaccess import DataAccessLayer as DAL -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint - -from awips.test.dafTests import baseDafTestCase -from awips.test.dafTests import params - class ObsTestCase(baseDafTestCase.DafTestCase): """Test DAF support for obs data""" diff --git a/awips/test/dafTests/testPirep.py b/awips/test/dafTests/testPirep.py new file mode 100644 index 0000000..5fa7467 --- /dev/null +++ b/awips/test/dafTests/testPirep.py @@ -0,0 +1,91 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from ufpy.dataaccess import DataAccessLayer as DAL + +from . import baseDafTestCase +from . import params +import unittest + +# +# Test DAF support for pirep data +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 01/19/16 4795 mapeters Initial Creation. +# 04/11/16 5548 tgurney Cleanup +# 04/18/16 5548 tgurney More cleanup +# 12/07/16 5981 tgurney Parameterize +# 12/20/16 5981 tgurney Add envelope test +# +# + + +class PirepTestCase(baseDafTestCase.DafTestCase): + """Test DAF support for pirep data""" + + datatype = "pirep" + + def testGetAvailableParameters(self): + req = DAL.newDataRequest(self.datatype) + self.runParametersTest(req) + + def testGetAvailableLocations(self): + req = DAL.newDataRequest(self.datatype) + self.runLocationsTest(req) + + def testGetAvailableTimes(self): + req = DAL.newDataRequest(self.datatype) + req.setLocationNames(params.AIRPORT) + self.runTimesTest(req) + + def testGetGeometryData(self): + req = DAL.newDataRequest(self.datatype) + req.setLocationNames(params.AIRPORT) + req.setParameters("temperature", "windSpeed", "hazardType", "turbType") + print("Testing getGeometryData()") + geomData = DAL.getGeometryData(req) + self.assertIsNotNone(geomData) + print("Number of geometry records: " + str(len(geomData))) + print("Sample geometry data:") + for record in geomData[:self.sampleDataLimit]: + print("level=", record.getLevel(), end="") + # One dimensional parameters are reported on the 0.0UNKNOWN level. + # 2D parameters are reported on MB levels from pressure. + if record.getLevel() == "0.0UNKNOWN": + print(" temperature=" + record.getString("temperature") + record.getUnit("temperature"), end="") + print(" windSpeed=" + record.getString("windSpeed") + record.getUnit("windSpeed"), end="") + else: + print(" hazardType=" + record.getString("hazardType"), end="") + print(" turbType=" + record.getString("turbType"), end="") + print(" geometry=", record.getGeometry()) + print("getGeometryData() complete\n") + + def testGetGeometryDataWithEnvelope(self): + req = DAL.newDataRequest(self.datatype) + req.setParameters("temperature", "windSpeed", "hazardType", "turbType") + req.setEnvelope(params.ENVELOPE) + print("Testing getGeometryData()") + data = DAL.getGeometryData(req) + for item in data: + self.assertTrue(params.ENVELOPE.contains(item.getGeometry())) diff --git a/awips/test/dafTests/testPracticeWarning.py b/awips/test/dafTests/testPracticeWarning.py new file mode 100644 index 0000000..8ad1cdb --- /dev/null +++ b/awips/test/dafTests/testPracticeWarning.py @@ -0,0 +1,44 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from . import testWarning + +# +# Test DAF support for practicewarning data +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 01/19/16 4795 mapeters Initial Creation. +# 04/11/16 5548 tgurney Cleanup +# 04/18/16 5548 tgurney More cleanup +# 06/10/16 5548 tgurney Inherit all tests from +# warning +# + + +class PracticeWarningTestCase(testWarning.WarningTestCase): + """Test DAF support for practicewarning data""" + + datatype = "practicewarning" + + # All tests taken from testWarning diff --git a/awips/test/dafTests/testRadarGraphics.py b/awips/test/dafTests/testRadarGraphics.py index b230bfe..e3ac56c 100644 --- a/awips/test/dafTests/testRadarGraphics.py +++ b/awips/test/dafTests/testRadarGraphics.py @@ -1,3 +1,30 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint +from ufpy.dataaccess import DataAccessLayer as DAL + +from . import baseRadarTestCase +from . import params + + # # Test DAF support for radar graphics data # @@ -15,14 +42,6 @@ # returned data # # - -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint -from awips.dataaccess import DataAccessLayer as DAL - -from awips.test.dafTests import baseRadarTestCase -from awips.test.dafTests import params - - class RadarGraphicsTestCase(baseRadarTestCase.BaseRadarTestCase): """Test DAF support for radar data""" diff --git a/awips/test/dafTests/testRadarGrid.py b/awips/test/dafTests/testRadarGrid.py index abcbf85..6385d29 100644 --- a/awips/test/dafTests/testRadarGrid.py +++ b/awips/test/dafTests/testRadarGrid.py @@ -1,3 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +from ufpy.dataaccess import DataAccessLayer as DAL +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint + +from . import baseRadarTestCase +from . import params # # Test DAF support for radar grid data # @@ -9,12 +34,6 @@ # # -from awips.dataaccess import DataAccessLayer as DAL -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint - -from awips.test.dafTests import baseRadarTestCase -from awips.test.dafTests import params - class RadarTestCase(baseRadarTestCase.BaseRadarTestCase): """Test DAF support for radar data""" diff --git a/awips/test/dafTests/testRadarSpatial.py b/awips/test/dafTests/testRadarSpatial.py index 64ce7f2..038993a 100644 --- a/awips/test/dafTests/testRadarSpatial.py +++ b/awips/test/dafTests/testRadarSpatial.py @@ -1,3 +1,30 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from ufpy.dataaccess import DataAccessLayer as DAL + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint +from . import baseDafTestCase +from . import params + # # Test DAF support for radar_spatial data # @@ -18,13 +45,6 @@ # # -from __future__ import print_function -from awips.dataaccess import DataAccessLayer as DAL - -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint -from awips.test.dafTests import baseDafTestCase -from awips.test.dafTests import params - class RadarSpatialTestCase(baseDafTestCase.DafTestCase): """Test DAF support for radar_spatial data""" @@ -70,11 +90,6 @@ class RadarSpatialTestCase(baseDafTestCase.DafTestCase): for record in geometryData: self.assertEqual(record.getNumber('immutablex'), 57) - def testGetDataWithEqualsLong(self): - geometryData = self._runConstraintTest('immutablex', '=', 57) - for record in geometryData: - self.assertEqual(record.getNumber('immutablex'), 57) - def testGetDataWithEqualsFloat(self): geometryData = self._runConstraintTest('immutablex', '=', 57.0) for record in geometryData: @@ -88,7 +103,7 @@ class RadarSpatialTestCase(baseDafTestCase.DafTestCase): def testGetDataWithNotEquals(self): geometryData = self._runConstraintTest('wfo_id', '!=', params.SITE_ID) for record in geometryData: - self.assertNotEquals(record.getString('wfo_id'), params.SITE_ID) + self.assertNotEqual(record.getString('wfo_id'), params.SITE_ID) def testGetDataWithNotEqualsNone(self): geometryData = self._runConstraintTest('wfo_id', '!=', None) diff --git a/awips/test/dafTests/testRequestConstraint.py b/awips/test/dafTests/testRequestConstraint.py index 3a28cc2..6b216fc 100644 --- a/awips/test/dafTests/testRequestConstraint.py +++ b/awips/test/dafTests/testRequestConstraint.py @@ -1,3 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint + +import unittest + # # Unit tests for Python implementation of RequestConstraint # @@ -9,10 +33,6 @@ # # -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint - -import unittest - class RequestConstraintTestCase(unittest.TestCase): @@ -27,9 +47,7 @@ class RequestConstraintTestCase(unittest.TestCase): self.assertTrue(new('=', 3).evaluate(3)) self.assertTrue(new('=', 3).evaluate('3')) self.assertTrue(new('=', '3').evaluate(3)) - self.assertTrue(new('=', 12345).evaluate(12345)) self.assertTrue(new('=', 'a').evaluate('a')) - self.assertTrue(new('=', 'a').evaluate(u'a')) self.assertTrue(new('=', 1.0001).evaluate(2.0 - 0.999999)) self.assertTrue(new('=', 1.00001).evaluate(1)) self.assertFalse(new('=', 'a').evaluate(['a'])) @@ -48,9 +66,7 @@ class RequestConstraintTestCase(unittest.TestCase): self.assertFalse(new('!=', 3).evaluate('3')) self.assertFalse(new('!=', '3').evaluate(3)) self.assertFalse(new('!=', 3).evaluate(3)) - self.assertFalse(new('!=', 12345).evaluate(12345)) self.assertFalse(new('!=', 'a').evaluate('a')) - self.assertFalse(new('!=', 'a').evaluate(u'a')) self.assertFalse(new('!=', 1.0001).evaluate(2.0 - 0.9999)) def testEvaluateGreaterThan(self): @@ -59,7 +75,6 @@ class RequestConstraintTestCase(unittest.TestCase): self.assertTrue(new('>', 'a').evaluate('b')) self.assertTrue(new('>', 3).evaluate(4)) self.assertFalse(new('>', 20).evaluate(3)) - self.assertFalse(new('>', 12345).evaluate(12345)) self.assertFalse(new('>', 'a').evaluate('a')) self.assertFalse(new('>', 'z').evaluate('a')) self.assertFalse(new('>', 4).evaluate(3)) @@ -67,7 +82,6 @@ class RequestConstraintTestCase(unittest.TestCase): def testEvaluateGreaterThanEquals(self): new = RequestConstraint.new self.assertTrue(new('>=', 3).evaluate(3)) - self.assertTrue(new('>=', 12345).evaluate(12345)) self.assertTrue(new('>=', 'a').evaluate('a')) self.assertTrue(new('>=', 1.0001).evaluate(1.0002)) self.assertTrue(new('>=', 'a').evaluate('b')) @@ -81,7 +95,6 @@ class RequestConstraintTestCase(unittest.TestCase): self.assertTrue(new('<', 'z').evaluate('a')) self.assertTrue(new('<', 30).evaluate(4)) self.assertFalse(new('<', 3).evaluate(3)) - self.assertFalse(new('<', 12345).evaluate(12345)) self.assertFalse(new('<', 'a').evaluate('a')) self.assertFalse(new('<', 1.0001).evaluate(1.0002)) self.assertFalse(new('<', 'a').evaluate('b')) @@ -92,7 +105,6 @@ class RequestConstraintTestCase(unittest.TestCase): self.assertTrue(new('<=', 'z').evaluate('a')) self.assertTrue(new('<=', 20).evaluate(3)) self.assertTrue(new('<=', 3).evaluate(3)) - self.assertTrue(new('<=', 12345).evaluate(12345)) self.assertTrue(new('<=', 'a').evaluate('a')) self.assertFalse(new('<=', 1.0001).evaluate(1.0002)) self.assertFalse(new('<=', 'a').evaluate('b')) @@ -134,6 +146,73 @@ class RequestConstraintTestCase(unittest.TestCase): self.assertFalse(new('not in', 'a').evaluate('a')) self.assertFalse(new('not in', [1.0001, 2, 3]).evaluate(2.0 - 0.9999)) + def testEvaluateLike(self): + # cannot make "like" with RequestConstraint.new() + new = self._newRequestConstraint + self.assertTrue(new('LIKE', 'a').evaluate('a')) + self.assertTrue(new('LIKE', 'a%').evaluate('a')) + self.assertTrue(new('LIKE', 'a%').evaluate('abcd')) + self.assertTrue(new('LIKE', '%a').evaluate('a')) + self.assertTrue(new('LIKE', '%a').evaluate('bcda')) + self.assertTrue(new('LIKE', '%').evaluate('')) + self.assertTrue(new('LIKE', '%').evaluate('anything')) + self.assertTrue(new('LIKE', 'a%d').evaluate('ad')) + self.assertTrue(new('LIKE', 'a%d').evaluate('abcd')) + self.assertTrue(new('LIKE', 'aa.()!{[]^%$').evaluate('aa.()!{[]^zzz$')) + self.assertTrue(new('LIKE', 'a__d%').evaluate('abcdefg')) + self.assertFalse(new('LIKE', 'a%').evaluate('b')) + self.assertFalse(new('LIKE', 'a%').evaluate('ba')) + self.assertFalse(new('LIKE', '%a').evaluate('b')) + self.assertFalse(new('LIKE', '%a').evaluate('ab')) + self.assertFalse(new('LIKE', 'a%').evaluate('A')) + self.assertFalse(new('LIKE', 'A%').evaluate('a')) + self.assertFalse(new('LIKE', 'a%d').evaluate('da')) + self.assertFalse(new('LIKE', 'a__d%').evaluate('abccdefg')) + self.assertFalse(new('LIKE', '....').evaluate('aaaa')) + self.assertFalse(new('LIKE', '.*').evaluate('anything')) + + def testEvaluateILike(self): + # cannot make "ilike" with RequestConstraint.new() + new = self._newRequestConstraint + self.assertTrue(new('ILIKE', 'a').evaluate('a')) + self.assertTrue(new('ILIKE', 'a%').evaluate('a')) + self.assertTrue(new('ILIKE', 'a%').evaluate('abcd')) + self.assertTrue(new('ILIKE', '%a').evaluate('a')) + self.assertTrue(new('ILIKE', '%a').evaluate('bcda')) + self.assertTrue(new('ILIKE', '%').evaluate('')) + self.assertTrue(new('ILIKE', '%').evaluate('anything')) + self.assertTrue(new('ILIKE', 'a%d').evaluate('ad')) + self.assertTrue(new('ILIKE', 'a%d').evaluate('abcd')) + self.assertTrue(new('ILIKE', 'a').evaluate('A')) + self.assertTrue(new('ILIKE', 'a%').evaluate('A')) + self.assertTrue(new('ILIKE', 'a%').evaluate('ABCD')) + self.assertTrue(new('ILIKE', '%a').evaluate('A')) + self.assertTrue(new('ILIKE', '%a').evaluate('BCDA')) + self.assertTrue(new('ILIKE', '%').evaluate('')) + self.assertTrue(new('ILIKE', '%').evaluate('anything')) + self.assertTrue(new('ILIKE', 'a%d').evaluate('AD')) + self.assertTrue(new('ILIKE', 'a%d').evaluate('ABCD')) + self.assertTrue(new('ILIKE', 'A').evaluate('a')) + self.assertTrue(new('ILIKE', 'A%').evaluate('a')) + self.assertTrue(new('ILIKE', 'A%').evaluate('abcd')) + self.assertTrue(new('ILIKE', '%A').evaluate('a')) + self.assertTrue(new('ILIKE', '%A').evaluate('bcda')) + self.assertTrue(new('ILIKE', '%').evaluate('')) + self.assertTrue(new('ILIKE', '%').evaluate('anything')) + self.assertTrue(new('ILIKE', 'A%D').evaluate('ad')) + self.assertTrue(new('ILIKE', 'A%D').evaluate('abcd')) + self.assertTrue(new('ILIKE', 'aa.()!{[]^%$').evaluate('AA.()!{[]^zzz$')) + self.assertTrue(new('ILIKE', 'a__d%').evaluate('abcdefg')) + self.assertTrue(new('ILIKE', 'a__d%').evaluate('ABCDEFG')) + self.assertFalse(new('ILIKE', 'a%').evaluate('b')) + self.assertFalse(new('ILIKE', 'a%').evaluate('ba')) + self.assertFalse(new('ILIKE', '%a').evaluate('b')) + self.assertFalse(new('ILIKE', '%a').evaluate('ab')) + self.assertFalse(new('ILIKE', 'a%d').evaluate('da')) + self.assertFalse(new('ILIKE', 'a__d%').evaluate('abccdefg')) + self.assertFalse(new('ILIKE', '....').evaluate('aaaa')) + self.assertFalse(new('ILIKE', '.*').evaluate('anything')) + def testEvaluateBetween(self): # cannot make "between" with RequestConstraint.new() new = self._newRequestConstraint diff --git a/awips/test/dafTests/testSatellite.py b/awips/test/dafTests/testSatellite.py index 92c5264..0a412d8 100644 --- a/awips/test/dafTests/testSatellite.py +++ b/awips/test/dafTests/testSatellite.py @@ -1,3 +1,30 @@ +#!/awips2/python/bin/python3 +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from ufpy.dataaccess import DataAccessLayer as DAL +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint + +from . import baseDafTestCase + # # Test DAF support for satellite data # @@ -17,12 +44,6 @@ # # -from __future__ import print_function -from awips.dataaccess import DataAccessLayer as DAL -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint - -from awips.test.dafTests import baseDafTestCase - class SatelliteTestCase(baseDafTestCase.DafTestCase): """Test DAF support for satellite data""" @@ -78,11 +99,6 @@ class SatelliteTestCase(baseDafTestCase.DafTestCase): for record in gridData: self.assertEqual(record.getAttribute('creatingEntity'), 1000) - def testGetDataWithEqualsLong(self): - gridData = self._runConstraintTest('creatingEntity', '=', 1000) - for record in gridData: - self.assertEqual(record.getAttribute('creatingEntity'), 1000) - def testGetDataWithEqualsFloat(self): gridData = self._runConstraintTest('creatingEntity', '=', 1.0) for record in gridData: diff --git a/awips/test/dafTests/testSfcObs.py b/awips/test/dafTests/testSfcObs.py index 7abeda4..d264f9b 100644 --- a/awips/test/dafTests/testSfcObs.py +++ b/awips/test/dafTests/testSfcObs.py @@ -1,3 +1,29 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from ufpy.dataaccess import DataAccessLayer as DAL + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint +from . import baseDafTestCase + # # Test DAF support for sfcobs data # @@ -15,12 +41,6 @@ # # -from __future__ import print_function -from awips.dataaccess import DataAccessLayer as DAL -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint - -from awips.test.dafTests import baseDafTestCase - class SfcObsTestCase(baseDafTestCase.DafTestCase): """Test DAF support for sfcobs data""" @@ -81,11 +101,6 @@ class SfcObsTestCase(baseDafTestCase.DafTestCase): for record in geometryData: self.assertEqual(record.getString('reportType'), '1004') - def testGetDataWithEqualsLong(self): - geometryData = self._runConstraintTest('reportType', '=', 1004) - for record in geometryData: - self.assertEqual(record.getString('reportType'), '1004') - # No float test because no float identifiers are available def testGetDataWithEqualsNone(self): diff --git a/awips/test/dafTests/testTopo.py b/awips/test/dafTests/testTopo.py index 0ee4aa2..b33193b 100644 --- a/awips/test/dafTests/testTopo.py +++ b/awips/test/dafTests/testTopo.py @@ -1,3 +1,30 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from ufpy.dataaccess import DataAccessLayer as DAL +from ufpy.ThriftClient import ThriftRequestException + +from . import baseDafTestCase +import shapely.geometry + # # Test DAF support for topo data # @@ -12,15 +39,10 @@ # getIdentifierValues() # 06/01/16 5587 tgurney Update testGetIdentifierValues # 07/18/17 6253 randerso Removed referenced to GMTED +# 02/20/18 7220 mapeters Added tests for getting filtered +# group/dataset identifier values # -from __future__ import print_function -from awips.dataaccess import DataAccessLayer as DAL -from awips.ThriftClient import ThriftRequestException -import shapely.geometry - -from awips.test.dafTests import baseDafTestCase - class TopoTestCase(baseDafTestCase.DafTestCase): """Test DAF support for topo data""" @@ -49,6 +71,7 @@ class TopoTestCase(baseDafTestCase.DafTestCase): print("Sample grid data shape:\n" + str(gridData[0].getRawData().shape) + "\n") print("Sample grid data:\n" + str(gridData[0].getRawData()) + "\n") + def testRequestingTooMuchDataThrowsResponseTooLargeException(self): req = DAL.newDataRequest(self.datatype) req.addIdentifier("group", "/") @@ -67,6 +90,18 @@ class TopoTestCase(baseDafTestCase.DafTestCase): requiredIds = set(DAL.getRequiredIdentifiers(req)) self.runGetIdValuesTest(optionalIds | requiredIds) + def testGetFilteredDatasetValues(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('group', '/') + datasetVals = DAL.getIdentifierValues(req, 'dataset') + self.assertSequenceEqual(datasetVals, ['full']) + + def testGetFilteredGroupValues(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('dataset', '1') + groupVals = DAL.getIdentifierValues(req, 'group') + self.assertSequenceEqual(groupVals, ['/interpolated']) + def testGetInvalidIdentifierValuesThrowsException(self): self.runInvalidIdValuesTest() diff --git a/awips/test/dafTests/testWarning.py b/awips/test/dafTests/testWarning.py index a125823..fa5d640 100644 --- a/awips/test/dafTests/testWarning.py +++ b/awips/test/dafTests/testWarning.py @@ -1,3 +1,30 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +from awips.dataaccess import DataAccessLayer as DAL + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint +from . import baseDafTestCase +import unittest + # # Test DAF support for warning data # @@ -16,15 +43,9 @@ # 06/21/16 5548 tgurney Skip tests that cause errors # 06/30/16 5725 tgurney Add test for NOT IN # 12/12/16 5981 tgurney Improve test performance +# 02/20/18 7220 mapeters Added test for getting filtered +# column identifier values # -# - -from __future__ import print_function -from awips.dataaccess import DataAccessLayer as DAL -from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint - -from awips.test.dafTests import baseDafTestCase -import unittest class WarningTestCase(baseDafTestCase.DafTestCase): @@ -95,13 +116,12 @@ class WarningTestCase(baseDafTestCase.DafTestCase): def testGetColumnIdentifierValues(self): self.runGetIdValuesTest(['act']) - @unittest.skip('avoid EDEX error') - def testGetInvalidIdentifierValuesThrowsException(self): - self.runInvalidIdValuesTest() - - @unittest.skip('avoid EDEX error') - def testGetNonexistentIdentifierValuesThrowsException(self): - self.runNonexistentIdValuesTest() + def testGetFilteredColumnIdentifierValues(self): + req = DAL.newDataRequest(self.datatype) + req.addIdentifier('sig', 'W') + phensigs = DAL.getIdentifierValues(req, 'phensig') + for phensig in phensigs: + self.assertTrue(phensig.endswith('.W')) def _runConstraintTest(self, key, operator, value): req = DAL.newDataRequest(self.datatype) @@ -120,11 +140,6 @@ class WarningTestCase(baseDafTestCase.DafTestCase): for record in geometryData: self.assertEqual(record.getString('etn'), '1000') - def testGetDataWithEqualsLong(self): - geometryData = self._runConstraintTest('etn', '=', 1000) - for record in geometryData: - self.assertEqual(record.getString('etn'), '1000') - def testGetDataWithEqualsFloat(self): geometryData = self._runConstraintTest('etn', '=', 1.0) for record in geometryData: diff --git a/awips/test/localization/__init__.py b/awips/test/localization/__init__.py new file mode 100644 index 0000000..a178a51 --- /dev/null +++ b/awips/test/localization/__init__.py @@ -0,0 +1,32 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +# +# __init__.py for ufpy.test.localization package +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# --------- -------- --------- -------------------------- +# 08/07/17 5731 bsteffen Initial Creation. + +__all__ = [] diff --git a/awips/test/localization/smallTestImage.png b/awips/test/localization/smallTestImage.png new file mode 100644 index 0000000000000000000000000000000000000000..189dd36e9c951a201bb88c3dfc91349f2ccafdb2 GIT binary patch literal 379 zcmV->0fhdEP)KmXk%{M7csdFi41KNw74?;0fL+Kr{|^bEoXK4<(cTYWp=% zkakf{p`mC?5o!Jl1`ug#8E`rZzl!=L$<;BKW3rM{%M+^XyG#^FIa8S{rs{V)DLcqa zJi*!J&k&t`1{P;jp5yEz(AdAi24_vlP7<8$&)z=;Sj$mfjdpayWj#W)g-9dtodwtd Zd;=7tOkt!$Uu6IQ002ovPDHLkV1hxTjQ{`u literal 0 HcmV?d00001 diff --git a/awips/test/localization/testLF.py b/awips/test/localization/testLF.py new file mode 100644 index 0000000..6cbd704 --- /dev/null +++ b/awips/test/localization/testLF.py @@ -0,0 +1,91 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 2120 South 72nd Street, Suite 900 +# Omaha, NE 68124 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# +# Tests for the lf utility script +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# --------- -------- --------- -------------------------- +# 01/11/22 8735 mapeters Initial creation + +import os +import subprocess +import unittest + +class TxtFileTestCase(unittest.TestCase): + def setUp(self): + """Test file needs to not exist at the start of the test. Delete it, + suppressing any errors (an error would be printed if it doesn't exist). + """ + self.locDir = "lfTestDir" + self.locFile = os.path.join(self.locDir, "TestFile.txt") + subprocess.run(["lf", "rm", "-o", self.locFile], stderr=subprocess.DEVNULL) + + def test_file_operations(self): + """Run through a typical set of interactions with a .txt file and + verify everything works correctly. + """ + subprocess.run(["lf", "write", self.locFile], input=b"Test Data", check=True) + + proc = subprocess.run(["lf", "ls", "-l", self.locDir], stdout=subprocess.PIPE, check=True) + self.assertIn(self.locFile, proc.stdout.decode()) + + proc = subprocess.run(["lf", "read", self.locFile], stdout=subprocess.PIPE, check=True) + self.assertEqual(proc.stdout.decode(), "Test Data") + + subprocess.run(["lf", "rm", "-o", self.locFile], check=True) + + proc = subprocess.run(["lf", "ls", "-l", self.locDir], stdout=subprocess.PIPE, check=True) + self.assertNotIn(self.locFile, proc.stdout.decode()) + +class PngFileTestCase(unittest.TestCase): + def setUp(self): + """Test file needs to not exist at the start of the test. Delete it, + suppressing any errors (an error would be printed if it doesn't exist). + """ + self.locDir = "lfTestDir" + self.locFile = os.path.join(self.locDir, "TestImage.png") + subprocess.run(["lf", "rm", "-o", self.locFile], stderr=subprocess.DEVNULL) + + def test_file_operations(self): + """Run through a typical set of interactions with a .png file and + verify everything works correctly. + """ + cwdPath = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__))) + localPngPath = os.path.join(cwdPath, "smallTestImage.png") + with open(localPngPath, "rb") as f: + subprocess.run(["lf", "write", self.locFile], stdin=f, check=True) + + proc = subprocess.run(["lf", "ls", self.locDir], stdout=subprocess.PIPE, check=True) + self.assertIn(self.locFile, proc.stdout.decode().splitlines()) + + proc = subprocess.run(["lf", "read", self.locFile], stdout=subprocess.PIPE, check=True) + with open(localPngPath, "rb") as f: + localPngBytes = f.read() + self.assertEqual(proc.stdout, localPngBytes) + + subprocess.run(["lf", "rm", "-o", self.locFile], check=True) + + proc = subprocess.run(["lf", "ls", self.locDir], stdout=subprocess.PIPE, check=True) + self.assertNotIn(self.locFile, proc.stdout.decode().splitlines()) + +if __name__ == '__main__': + unittest.main() diff --git a/awips/test/localization/testLocalizationFileManager.py b/awips/test/localization/testLocalizationFileManager.py new file mode 100644 index 0000000..bbb1b38 --- /dev/null +++ b/awips/test/localization/testLocalizationFileManager.py @@ -0,0 +1,173 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# +# Tests for the LocalizationFileManager +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# --------- -------- --------- -------------------------- +# 08/09/17 5731 bsteffen Initial Creation. +# 01/06/22 8735 mapeters Python 3 fix + +import unittest + +from ufpy.localization.LocalizationFileManager import (LocalizationFileManager, + LocalizationFileVersionConflictException, + LocalizationContext, + LocalizationFileIsNotDirectoryException, + LocalizationFileDoesNotExistException) + +testFile = "purge/defaultPurgeRules.xml" +testContent = b"05-05:05:05" +testDir = "purge/" +testNewFile = "purge/testPurgeRules.xml" + +class ContextTestCase(unittest.TestCase): + def test_eq(self): + c1 = LocalizationContext() + c2 = LocalizationContext() + self.assertEqual(c1, c2) + c3 = LocalizationContext("site", "test") + c4 = LocalizationContext("site", "test") + self.assertEqual(c3, c4) + self.assertNotEqual(c1, c3) + + def test_hash(self): + c1 = LocalizationContext() + c2 = LocalizationContext() + self.assertEqual(hash(c1), hash(c2)) + c3 = LocalizationContext("site", "test") + c4 = LocalizationContext("site", "test") + self.assertEqual(hash(c3), hash(c4)) + +class LFMTestCase(unittest.TestCase): + def setUp(self): + self.manager = LocalizationFileManager() + userFile = self.manager.getSpecific("user", testFile) + if userFile.exists(): + userFile.delete() + newFile = self.manager.getSpecific("user", testNewFile) + if newFile.exists(): + newFile.delete() + def test_gets(self): + startingIncremental = self.manager.getIncremental(testFile) + baseFile = self.manager.getSpecific("base", testFile) + self.assertEqual(baseFile, startingIncremental[0]) + self.assertTrue(baseFile.exists()) + self.assertFalse(baseFile.isDirectory()) + userFile = self.manager.getSpecific("user", testFile) + self.assertFalse(userFile.exists()) + with userFile.open("w") as stream: + stream.write(testContent) + userFile = self.manager.getSpecific("user", testFile) + self.assertTrue(userFile.exists()) + with userFile.open('r') as stream: + self.assertEqual(stream.read(), testContent) + absFile = self.manager.getAbsolute(testFile) + self.assertEqual(absFile, userFile) + endingIncremental = self.manager.getIncremental(testFile) + self.assertEqual(len(startingIncremental) + 1, len(endingIncremental)) + self.assertEqual(userFile, endingIncremental[-1]) + self.assertEqual(baseFile, endingIncremental[0]) + + + userFile.delete() + userFile = self.manager.getSpecific("user", testFile) + self.assertFalse(userFile.exists()) + + def test_concurrent_edit(self): + userFile1 = self.manager.getSpecific("user", testFile) + userFile2 = self.manager.getSpecific("user", testFile) + self.assertFalse(userFile1.exists()) + self.assertFalse(userFile2.exists()) + with self.assertRaises(LocalizationFileVersionConflictException): + with userFile1.open("w") as stream1: + stream1.write(testContent) + with userFile2.open("w") as stream2: + stream2.write(testContent) + + userFile = self.manager.getSpecific("user", testFile) + userFile.delete() + + def test_dir(self): + locDir = self.manager.getAbsolute(testDir) + self.assertTrue(locDir.isDirectory()) + with self.assertRaises(Exception): + locDir.delete() + + def test_list(self): + abs1 = self.manager.listAbsolute(testDir) + inc1 = self.manager.listIncremental(testDir) + self.assertEqual(len(abs1), len(inc1)) + for i in range(len(abs1)): + self.assertEqual(abs1[i], inc1[i][-1]) + + userFile = self.manager.getSpecific("user", testNewFile) + self.assertNotIn(userFile, abs1) + + with userFile.open("w") as stream: + stream.write(testContent) + userFile = self.manager.getSpecific("user", testNewFile) + + + abs2 = self.manager.listAbsolute(testDir) + inc2 = self.manager.listIncremental(testDir) + self.assertEqual(len(abs2), len(inc2)) + for i in range(len(abs2)): + self.assertEqual(abs2[i], inc2[i][-1]) + + self.assertEqual(len(abs1) + 1, len(abs2)) + self.assertIn(userFile, abs2) + + userFile.delete() + + def test_list_file(self): + with self.assertRaises(LocalizationFileIsNotDirectoryException): + self.manager.listIncremental(testFile) + + def test_list_nonexistant(self): + with self.assertRaises(LocalizationFileDoesNotExistException): + self.manager.listIncremental('dontNameYourDirectoryThis') + + def test_root_variants(self): + list1 = self.manager.listAbsolute(".") + list2 = self.manager.listAbsolute("") + list3 = self.manager.listAbsolute("/") + self.assertEqual(list1, list2) + self.assertEqual(list2, list3) + + def test_slashiness(self): + raw = testDir + if raw[0] == '/': + raw = raw[1:] + if raw[-1] == '/': + raw = raw[:-1] + list1 = self.manager.listAbsolute(raw) + list2 = self.manager.listAbsolute(raw + "/") + list3 = self.manager.listAbsolute("/" + raw) + self.assertEqual(list1, list2) + self.assertEqual(list2, list3) + + + +if __name__ == '__main__': + unittest.main() diff --git a/awips/test/localization/testLocalizationRest.py b/awips/test/localization/testLocalizationRest.py new file mode 100644 index 0000000..a5a823e --- /dev/null +++ b/awips/test/localization/testLocalizationRest.py @@ -0,0 +1,365 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +import unittest +import urllib.request, urllib.error, urllib.parse + +from html.parser import HTMLParser +from xml.etree.ElementTree import parse as parseXml +from json import load as loadjson +from urllib.parse import urljoin +from base64 import b64encode + +# +# Test the localization REST service. +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# --------- -------- --------- -------------------------- +# 08/07/17 5731 bsteffen Initial Creation. +# 01/06/22 8735 mapeters Python 3 fixes, test configured level instead of +# site since it more reliably has menus/ dir + +baseURL = "http://localhost:9581/services/localization/" +testSite = "OAX" +testDir = "menus" +testFile = "test.xml" +username = "test" +password = username + +base64string = b64encode(b'%s:%s' % (username.encode(), password.encode())) +authString = "Basic %s" % base64string.decode() + +class ValidHTMLParser(HTMLParser): + """Simple HTML parser that performs very minimal validation. + + This ensures that all start and end tags match, and also that there are + some tags. It also accumulates the text of all links in the html file + in the link_texts attribute, which can be used for further validation. + """ + + def __init__(self, testcase): + HTMLParser.__init__(self) + self._testcase = testcase + self._tags = [] + self._any = False + self.link_texts = [] + + def handle_starttag(self, tag, attrs): # NOSONAR + """Suppressing Pylint:W0613 "Unused argument" on above line since this + is a method override. + """ + self._tags.append(tag) + self._any = True + + def handle_endtag(self, tag): + self._testcase.assertNotEqual([], self._tags, "Unstarted end tag " + tag) + self._testcase.assertEqual(tag, self._tags.pop()) + + def handle_data(self, data): + if self._tags[-1] == "a": + self.link_texts.append(data) + + def close(self): + HTMLParser.close(self) + self._testcase.assertTrue(self._any) + self._testcase.assertEqual([], self._tags) + + + +class AbstractListingTestCase(): + """Base test case for testing listings, retrieves data as html, xml, and json. + + Sub classes should implement assertValidHtml, assertValidXml, and + assertValidJson to ensure that the content returned matches what was + expected. + """ + + def assertRequestGetsHtml(self, request): + response = urllib.request.urlopen(request) + self.assertEqual(response.headers["Content-Type"], "text/html") + body = response.read().decode() + parser = ValidHTMLParser(self) + parser.feed(body) + parser.close() + self.assertValidHtml(parser) + + def assertValidHtml(self, parser): + """Intended to be overriden by subclasses to validate HTML content. + + The argument is a populated instance of ValidHTMLParser. + """ + pass + + def test_default(self): + request = urllib.request.Request(self.url) + self.assertRequestGetsHtml(request) + + def test_last_slash(self): + if self.url.endswith("/"): + request = urllib.request.Request(self.url[:-1]) + else: + request = urllib.request.Request(self.url + "/") + self.assertRequestGetsHtml(request) + + def test_wild_mime(self): + request = urllib.request.Request(self.url) + request.add_header("Accept", "*/*") + self.assertRequestGetsHtml(request) + request.add_header("Accept", "text/*") + self.assertRequestGetsHtml(request) + + def test_html(self): + request = urllib.request.Request(self.url) + request.add_header("Accept", "text/html") + self.assertRequestGetsHtml(request) + + def test_json(self): + request = urllib.request.Request(self.url) + request.add_header("Accept", "application/json") + response = urllib.request.urlopen(request) + self.assertEqual(response.headers["Content-Type"], "application/json") + jsonData = loadjson(response) + self.assertValidJson(jsonData) + + + def assertValidJson(self, jsonData): + """Intended to be overriden by subclasses to validate JSON content. + + The argument is a python object as returned from json.load + """ + pass + + def test_xml(self): + request = urllib.request.Request(self.url) + request.add_header("Accept", "application/xml") + response = urllib.request.urlopen(request) + self.assertEqual(response.headers["Content-Type"], "application/xml") + xmlData = parseXml(response) + self.assertValidXml(xmlData) + + def assertValidXml(self, xmlData): + """Intended to be overriden by subclasses to validate XML content. + + The argument is an ElementTree + """ + pass + + def test_delete(self): + request = urllib.request.Request(self.url, method="DELETE") + with self.assertRaises(urllib.error.HTTPError) as cm: + urllib.request.urlopen(request) + self.assertEqual(405, cm.exception.code) + + def test_put(self): + request = urllib.request.Request(self.url, method="PUT") + request.data = b"Test Data" + with self.assertRaises(urllib.error.HTTPError) as cm: + urllib.request.urlopen(request) + self.assertEqual(405, cm.exception.code) + + def test_unacceptable(self): + request = urllib.request.Request(self.url) + request.add_header("Accept", "application/fakemimetype") + with self.assertRaises(urllib.error.HTTPError) as cm: + urllib.request.urlopen(request) + self.assertEqual(406, cm.exception.code) + request.add_header("Accept", "fakemimetype/*") + with self.assertRaises(urllib.error.HTTPError) as cm: + urllib.request.urlopen(request) + self.assertEqual(406, cm.exception.code) + + def test_accept_quality_factor(self): + request = urllib.request.Request(self.url) + request.add_header("Accept", "application/xml; q=0.8, application/json; q=0.2") + response = urllib.request.urlopen(request) + self.assertEqual(response.headers["Content-Type"], "application/xml") + xmlData = parseXml(response) + self.assertValidXml(xmlData) + + request.add_header("Accept", "application/xml; q=0.2, application/json; q=0.8") + response = urllib.request.urlopen(request) + self.assertEqual(response.headers["Content-Type"], "application/json") + jsonData = loadjson(response) + self.assertValidJson(jsonData) + + request.add_header("Accept", "application/xml, application/json; q=0.8") + response = urllib.request.urlopen(request) + self.assertEqual(response.headers["Content-Type"], "application/xml") + xmlData = parseXml(response) + self.assertValidXml(xmlData) + + request.add_header("Accept", "application/fakemimetype, application/json; q=0.8") + response = urllib.request.urlopen(request) + self.assertEqual(response.headers["Content-Type"], "application/json") + jsonData = loadjson(response) + self.assertValidJson(jsonData) + +class RootTestCase(AbstractListingTestCase, unittest.TestCase): + """Test that the root of the localization service returns listing of localization types.""" + def setUp(self): + self.url = baseURL + def assertValidHtml(self, parser): + self.assertIn("common_static/", parser.link_texts) + def assertValidJson(self, jsonData): + self.assertIn("common_static/", jsonData) + def assertValidXml(self, xmlData): + root = xmlData.getroot() + self.assertEqual(root.tag, "entries") + names = [e.text for e in root.findall("entry")] + self.assertIn("common_static/", names) + +class TypeTestCase(AbstractListingTestCase, unittest.TestCase): + """Test that common_static will list context levels.""" + def setUp(self): + self.url = urljoin(baseURL, "common_static/") + def assertValidHtml(self, parser): + self.assertIn("base/", parser.link_texts) + self.assertIn("site/", parser.link_texts) + def assertValidJson(self, jsonData): + self.assertIn("base/", jsonData) + self.assertIn("site/", jsonData) + def assertValidXml(self, xmlData): + root = xmlData.getroot() + self.assertEqual(root.tag, "entries") + names = [e.text for e in root.findall("entry")] + self.assertIn("base/", names) + self.assertIn("site/", names) + +class LevelTestCase(AbstractListingTestCase, unittest.TestCase): + """Test that common_static/site will list sites.""" + def setUp(self): + self.url = urljoin(baseURL, "common_static/site/") + def assertValidHtml(self, parser): + self.assertIn(testSite + "/", parser.link_texts) + def assertValidJson(self, jsonData): + self.assertIn(testSite + "/", jsonData) + def assertValidXml(self, xmlData): + root = xmlData.getroot() + self.assertEqual(root.tag, "entries") + names = [e.text for e in root.findall("entry")] + self.assertIn(testSite + "/", names) + +class AbstractFileListingTestCase(AbstractListingTestCase): + """Base test case for a file listing""" + + def assertValidHtml(self, parser): + self.assertIn(testDir + "/", parser.link_texts) + self.assertEqual(parser.link_texts, sorted(parser.link_texts)) + def assertValidJson(self, jsonData): + self.assertIn(testDir + "/", jsonData) + def assertValidXml(self, xmlData): + root = xmlData.getroot() + self.assertEqual(root.tag, "files") + names = [e.get("name") for e in root.findall("file")] + self.assertIn(testDir + "/", names) + self.assertEqual(names, sorted(names)) + +class BaseFileListingTestCase(AbstractFileListingTestCase, unittest.TestCase): + """Test that common_static/base lists files""" + def setUp(self): + self.url = urljoin(baseURL, "common_static/base/") + +class ConfiguredFileListingTestCase(AbstractFileListingTestCase, unittest.TestCase): + """Test that common_static/site// lists files""" + def setUp(self): + self.url = urljoin(baseURL, "common_static/configured/" + testSite + "/") + +class FileTestCase(unittest.TestCase): + """Test retrieval, modification and deletion of an individual.""" + def setUp(self): + self.url = urljoin(baseURL, "common_static/user/" + username + "/" + testFile) + # The file should not exist before the test, but if it does then delete it + # This is some of the same functionality we are testing so if setup fails + # then the test would probably fail anyway + try: + request = urllib.request.Request(self.url) + response = urllib.request.urlopen(request) + request = urllib.request.Request(self.url, method="DELETE") + request.add_header("Authorization", authString) + request.add_header("If-Match", response.headers["Content-MD5"]) + response = urllib.request.urlopen(request) + except urllib.error.HTTPError as e: + if e.code != 404: + raise e + def test_file_operations(self): + """Run through a typical set of file interactions and verify everything works correctly.""" + request = urllib.request.Request(self.url, method="PUT") + request.data = b"Test Data" + with self.assertRaises(urllib.error.HTTPError) as cm: + response = urllib.request.urlopen(request) + self.assertEqual(401, cm.exception.code) + + request = urllib.request.Request(self.url, method="PUT") + request.data = b"Test Data" + request.add_header("Authorization", authString) + with self.assertRaises(urllib.error.HTTPError) as cm: + response = urllib.request.urlopen(request) + self.assertEqual(409, cm.exception.code) + + request = urllib.request.Request(self.url, method="PUT") + request.data = b"Test Data" + request.add_header("Authorization", authString) + request.add_header("If-Match", "NON_EXISTENT_CHECKSUM") + request.add_header("Content-Type", "text/plain") + response = urllib.request.urlopen(request) + + + request = urllib.request.Request(self.url) + response = urllib.request.urlopen(request) + self.assertEqual(response.read().decode(), "Test Data") + + request = urllib.request.Request(self.url + "/") + response = urllib.request.urlopen(request) + self.assertEqual(response.read().decode(), "Test Data") + + request = urllib.request.Request(self.url, method="PUT") + request.data = b"Test Data2" + request.add_header("If-Match", response.headers["Content-MD5"]) + request.add_header("Authorization", authString) + request.add_header("Content-Type", "text/plain") + response = urllib.request.urlopen(request) + checksum = response.headers["Content-MD5"] + + request = urllib.request.Request(self.url) + response = urllib.request.urlopen(request) + self.assertEqual(response.read().decode(), "Test Data2") + + request = urllib.request.Request(self.url, method="DELETE") + with self.assertRaises(urllib.error.HTTPError) as cm: + response = urllib.request.urlopen(request) + self.assertEqual(401, cm.exception.code) + + request.add_header("Authorization", authString) + with self.assertRaises(urllib.error.HTTPError) as cm: + response = urllib.request.urlopen(request) + self.assertEqual(409, cm.exception.code) + + request.add_header("If-Match", checksum) + response = urllib.request.urlopen(request) + + request = urllib.request.Request(self.url) + with self.assertRaises(urllib.error.HTTPError) as cm: + response = urllib.request.urlopen(request) + self.assertEqual(404, cm.exception.code) + +if __name__ == '__main__': + unittest.main() diff --git a/awips/test/testQpidTimeToLive.py b/awips/test/testQpidTimeToLive.py new file mode 100644 index 0000000..90880ba --- /dev/null +++ b/awips/test/testQpidTimeToLive.py @@ -0,0 +1,98 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------- -------- ------------ -------------------------------------------- +# Mar 09, 2011 njensen Initial Creation. +# Aug 15, 2013 2169 bkowal Decompress data read from the queue +# Jun 24, 2020 8187 randerso Added program for qpid connection_id +# +# + +import time +import threading + + +TIME_TO_SLEEP = 300 + +class ListenThread(threading.Thread): + + def __init__(self, hostname, portNumber, topicName): + self.hostname = hostname + self.portNumber = portNumber + self.topicName = topicName + self.nMessagesReceived = 0 + self.waitSecond = 0 + self.stopped = False + threading.Thread.__init__(self) + + def run(self): + from awips import QpidSubscriber + self.qs = QpidSubscriber.QpidSubscriber(host=self.hostname, port=self.portNumber, decompress=True, program="testQpidTimeToLive") + self.qs.topicSubscribe(self.topicName, self.receivedMessage) + + def receivedMessage(self, msg): + print("Received message") + self.nMessagesReceived += 1 + if self.waitSecond == 0: + fmsg = open('/tmp/rawMessage', 'w') + fmsg.write(msg) + fmsg.close() + + while self.waitSecond < TIME_TO_SLEEP and not self.stopped: + if self.waitSecond % 60 == 0: + print(time.strftime('%H:%M:%S'), "Sleeping and stuck in not so infinite while loop") + self.waitSecond += 1 + time.sleep(1) + + print(time.strftime('%H:%M:%S'), "Received", self.nMessagesReceived, "messages") + + def stop(self): + print("Stopping") + self.stopped = True + self.qs.close() + + + +def main(): + print("Starting up at", time.strftime('%H:%M:%S')) + + topic = 'edex.alerts' + host = 'localhost' + port = 5672 + + thread = ListenThread(host, port, topic) + try: + thread.start() + while True: + time.sleep(3) + except KeyboardInterrupt: + pass + finally: + thread.stop() + + +if __name__ == '__main__': + main() + + + diff --git a/dynamicserialize/DynamicSerializationManager.py b/dynamicserialize/DynamicSerializationManager.py index 171628b..b141f57 100644 --- a/dynamicserialize/DynamicSerializationManager.py +++ b/dynamicserialize/DynamicSerializationManager.py @@ -1,45 +1,69 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # A port of the Java DynamicSerializeManager. Should be used to read/write # DynamicSerialize binary data. # # +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/09/10 njensen Initial Creation. +# +# # from thrift.transport import TTransport from . import SelfDescribingBinaryProtocol, ThriftSerializationContext - class DynamicSerializationManager: - + def __init__(self): - self.transport = None - + self.transport = None + def _deserialize(self, ctx): return ctx.deserializeMessage() - - def deserializeBytes(self, sbytes): - ctx = self._buildSerializationContext(sbytes) + + def deserializeBytes(self, bytes): + ctx = self._buildSerializationContext(bytes) ctx.readMessageStart() obj = self._deserialize(ctx) ctx.readMessageEnd() return obj - - def _buildSerializationContext(self, sbytes=None): - self.transport = TTransport.TMemoryBuffer(sbytes) + + def _buildSerializationContext(self, bytes=None): + self.transport = TTransport.TMemoryBuffer(bytes) protocol = SelfDescribingBinaryProtocol.SelfDescribingBinaryProtocol(self.transport) return ThriftSerializationContext.ThriftSerializationContext(self, protocol) - + def serializeObject(self, obj): ctx = self._buildSerializationContext() ctx.writeMessageStart("dynamicSerialize") self._serialize(ctx, obj) ctx.writeMessageEnd() - return self.transport.getvalue() - + return self.transport.getvalue() + def _serialize(self, ctx, obj): - ctx.serializeMessage(obj) + ctx.serializeMessage(obj) \ No newline at end of file diff --git a/dynamicserialize/SelfDescribingBinaryProtocol.py b/dynamicserialize/SelfDescribingBinaryProtocol.py index 85043ff..ff98cfc 100644 --- a/dynamicserialize/SelfDescribingBinaryProtocol.py +++ b/dynamicserialize/SelfDescribingBinaryProtocol.py @@ -1,114 +1,151 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + # # Partially compatible AWIPS-II Thrift Binary Protocol # -# +# Missing functionality: +#
    +#
  • Custom Serializers +#
  • Inheritance +#
+# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 11/11/09 chammack Initial Creation. -# 06/09/10 njensen Added float, list methods -# Apr 24, 2015 4425 nabowle Add F64List support. -# +# 11/11/09 chammack Initial Creation. +# 06/09/10 njensen Added float, list methods +# Apr 24, 2015 4425 nabowle Add F64List support. +# Jun 25, 2019 7821 tgurney Replace numpy.getbuffer +# with memoryview +# +# # +from thrift.protocol.TProtocol import * +from thrift.protocol.TBinaryProtocol import * + import struct import numpy -from thrift.protocol.TProtocol import * -from thrift.protocol.TBinaryProtocol import * + +###################################### +# TODO Remove after switch to Python 3 +# This is necessary because some APIs in Python 2 expect a buffer and not a +# memoryview. +import sys +if sys.version_info.major < 3: + memoryview = buffer +###################################### FLOAT = 64 intList = numpy.dtype(numpy.int32).newbyteorder('>') floatList = numpy.dtype(numpy.float32).newbyteorder('>') -longList = numpy.dtype(numpy.int64).newbyteorder('>') +longList = numpy.dtype(numpy.int64).newbyteorder('>') shortList = numpy.dtype(numpy.int16).newbyteorder('>') byteList = numpy.dtype(numpy.int8).newbyteorder('>') doubleList = numpy.dtype(numpy.float64).newbyteorder('>') - class SelfDescribingBinaryProtocol(TBinaryProtocol): + + def readFieldBegin(self): + type = self.readByte() + if type == TType.STOP: + return (None, type, 0) + name = self.readString() + id = self.readI16() + return (name, type, id) - def readFieldBegin(self): - ftype = self.readByte() - if ftype == TType.STOP: - return None, ftype, 0 - name = self.readString() - fid = self.readI16() - return name, ftype, fid + def readStructBegin(self): + return self.readString() - def readStructBegin(self): - return self.readString() + def writeStructBegin(self, name): + self.writeString(name) - def writeStructBegin(self, name): - self.writeString(name) + def writeFieldBegin(self, name, type, id): + self.writeByte(type) + self.writeString(name) + self.writeI16(id) - def writeFieldBegin(self, name, ftype, fid): - self.writeByte(ftype) - self.writeString(name) - self.writeI16(fid) + def readFloat(self): + d = self.readI32() + dAsBytes = struct.pack('i', d) + f = struct.unpack('f', dAsBytes) + return f[0] - def readFloat(self): - d = self.readI32() - dAsBytes = struct.pack('i', d) - f = struct.unpack('f', dAsBytes) - return f[0] + def writeFloat(self, f): + dAsBytes = struct.pack('f', f) + i = struct.unpack('i', dAsBytes) + self.writeI32(i[0]) - def writeFloat(self, f): - dAsBytes = struct.pack('f', f) - i = struct.unpack('i', dAsBytes) - self.writeI32(i[0]) + def readI32List(self, sz): + buff = self.trans.readAll(4*sz) + val = numpy.frombuffer(buff, dtype=intList, count=sz) + return val - def readI32List(self, sz): - buff = self.trans.readAll(4*sz) - val = numpy.frombuffer(buff, dtype=intList, count=sz) - return val + def readF32List(self, sz): + buff = self.trans.readAll(4*sz) + val = numpy.frombuffer(buff, dtype=floatList, count=sz) + return val - def readF32List(self, sz): - buff = self.trans.readAll(4*sz) - val = numpy.frombuffer(buff, dtype=floatList, count=sz) - return val + def readF64List(self, sz): + buff = self.trans.readAll(8*sz) + val = numpy.frombuffer(buff, dtype=doubleList, count=sz) + return val - def readF64List(self, sz): - buff = self.trans.readAll(8*sz) - val = numpy.frombuffer(buff, dtype=doubleList, count=sz) - return val + def readI64List(self, sz): + buff = self.trans.readAll(8*sz) + val = numpy.frombuffer(buff, dtype=longList, count=sz) + return val - def readI64List(self, sz): - buff = self.trans.readAll(8*sz) - val = numpy.frombuffer(buff, dtype=longList, count=sz) - return val + def readI16List(self, sz): + buff = self.trans.readAll(2*sz) + val = numpy.frombuffer(buff, dtype=shortList, count=sz) + return val - def readI16List(self, sz): - buff = self.trans.readAll(2*sz) - val = numpy.frombuffer(buff, dtype=shortList, count=sz) - return val + def readI8List(self, sz): + buff = self.trans.readAll(sz) + val = numpy.frombuffer(buff, dtype=byteList, count=sz) + return val - def readI8List(self, sz): - buff = self.trans.readAll(sz) - val = numpy.frombuffer(buff, dtype=byteList, count=sz) - return val + def writeI32List(self, buff): + b = numpy.asarray(buff, intList) + self.trans.write(memoryview(b)) - def writeI32List(self, buff): - b = numpy.asarray(buff, intList) - self.trans.write(numpy.getbuffer(b)) + def writeF32List(self, buff): + b = numpy.asarray(buff, floatList) + self.trans.write(memoryview(b)) - def writeF32List(self, buff): - b = numpy.asarray(buff, floatList) - self.trans.write(numpy.getbuffer(b)) + def writeF64List(self, buff): + b = numpy.asarray(buff, doubleList) + self.trans.write(memoryview(b)) - def writeF64List(self, buff): - b = numpy.asarray(buff, doubleList) - self.trans.write(numpy.getbuffer(b)) + def writeI64List(self, buff): + b = numpy.asarray(buff, longList) + self.trans.write(memoryview(b)) - def writeI64List(self, buff): - b = numpy.asarray(buff, longList) - self.trans.write(numpy.getbuffer(b)) + def writeI16List(self, buff): + b = numpy.asarray(buff, shortList) + self.trans.write(memoryview(b)) - def writeI16List(self, buff): - b = numpy.asarray(buff, shortList) - self.trans.write(numpy.getbuffer(b)) - - def writeI8List(self, buff): - b = numpy.asarray(buff, byteList) - self.trans.write(numpy.getbuffer(b)) + def writeI8List(self, buff): + b = numpy.asarray(buff, byteList) + self.trans.write(memoryview(b)) diff --git a/dynamicserialize/ThriftSerializationContext.py b/dynamicserialize/ThriftSerializationContext.py index 7d8780b..6ffb9cd 100644 --- a/dynamicserialize/ThriftSerializationContext.py +++ b/dynamicserialize/ThriftSerializationContext.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # A port of the Java ThriftSerializationContext, used for reading/writing # DynamicSerialize objects to/from thrift. @@ -17,19 +38,22 @@ # writeObject(). # Apr 24, 2015 4425 nabowle Add Double support # Oct 17, 2016 5919 njensen Optimized for speed -# Sep 06, 2018 mjames@ucar Python3 compliance +# Oct 11, 2018 7306 dgilling Fix handling of ndarrays in +# _serializeArray. +# Apr 30, 2019 7814 dgilling Serialize python unicode strings. +# Jun 26, 2019 7888 tgurney Python 3 fixes +# Jul 23, 2019 7888 tgurney Fix handling of bytes as strings +# Sep 13, 2019 7888 tgurney Fix serialization of bytes # # +from thrift.Thrift import TType import inspect import sys -import types -import six -import numpy -from thrift.Thrift import TType import dynamicserialize from dynamicserialize import dstypes, adapters -from dynamicserialize import SelfDescribingBinaryProtocol +from . import SelfDescribingBinaryProtocol +import numpy DS_LEN = len('dynamicserialize.dstypes.') @@ -49,61 +73,39 @@ def buildObjMap(module): tname = tname[DS_LEN:] dsObjTypes[tname] = clz - buildObjMap(dstypes) -if six.PY2: - pythonToThriftMap = { - types.StringType: TType.STRING, - types.IntType: TType.I32, - types.LongType: TType.I64, - types.ListType: TType.LIST, - unicode: TType.STRING, - types.DictionaryType: TType.MAP, - type(set([])): TType.SET, - types.FloatType: SelfDescribingBinaryProtocol.FLOAT, - # types.FloatType: TType.DOUBLE, - types.BooleanType: TType.BOOL, - types.InstanceType: TType.STRUCT, - types.NoneType: TType.VOID, - numpy.float32: SelfDescribingBinaryProtocol.FLOAT, - numpy.int32: TType.I32, - numpy.ndarray: TType.LIST, - numpy.object_: TType.STRING, # making an assumption here - numpy.string_: TType.STRING, - numpy.float64: TType.DOUBLE, - numpy.int16: TType.I16, - numpy.int8: TType.BYTE, - numpy.int64: TType.I64 - } -else: - pythonToThriftMap = { - bytes: TType.STRING, - int: TType.I32, - int: TType.I64, - list: TType.LIST, - dict: TType.MAP, - type(set([])): TType.SET, - float: SelfDescribingBinaryProtocol.FLOAT, - # types.FloatType: TType.DOUBLE, - bool: TType.BOOL, - object: TType.STRUCT, - str: TType.STRING, - type(None): TType.VOID, - numpy.float32: SelfDescribingBinaryProtocol.FLOAT, - numpy.int32: TType.I32, - numpy.ndarray: TType.LIST, - numpy.object_: TType.STRING, # making an assumption here - numpy.string_: TType.STRING, - numpy.float64: TType.DOUBLE, - numpy.int16: TType.I16, - numpy.int8: TType.BYTE, - numpy.int64: TType.I64 - } +pythonToThriftMap = { + bytes: TType.LIST, + str: TType.STRING, + int: TType.I64, + list: TType.LIST, + dict: TType.MAP, + set: TType.SET, + float: SelfDescribingBinaryProtocol.FLOAT, + # types.FloatType: TType.DOUBLE, + bool: TType.BOOL, + object: TType.STRUCT, + type(None): TType.VOID, + numpy.float32: SelfDescribingBinaryProtocol.FLOAT, + numpy.int32: TType.I32, + numpy.ndarray: TType.LIST, + numpy.object_: TType.STRING, # making an assumption here + numpy.string_: TType.STRING, + # numpy.bytes_ is the same as numpy.string_ + numpy.unicode_: TType.STRING, + # numpy.str_ is the same as numpy.unicode_ + numpy.float64: TType.DOUBLE, + numpy.int16: TType.I16, + numpy.int8: TType.BYTE, + numpy.int64: TType.I64 +} primitiveSupport = (TType.BYTE, TType.I16, TType.I32, TType.I64, SelfDescribingBinaryProtocol.FLOAT, TType.DOUBLE) +BYTE_STRING_TYPES = {numpy.string_, numpy.bytes_, bytes} + class ThriftSerializationContext(object): @@ -126,7 +128,7 @@ class ThriftSerializationContext(object): TType.VOID: lambda: None } self.typeSerializationMethod = { - TType.STRING: self.protocol.writeString, + TType.STRING: self.writeString, TType.I16: self.protocol.writeI16, TType.I32: self.protocol.writeI32, TType.LIST: self._serializeArray, @@ -166,19 +168,18 @@ class ThriftSerializationContext(object): def deserializeMessage(self): name = self.protocol.readStructBegin() - name = name.decode('cp437') - name = name.replace('_', '.') if name.isdigit(): obj = self._deserializeType(int(name)) return obj + name = name.replace('_', '.') if name in adapters.classAdapterRegistry: return adapters.classAdapterRegistry[name].deserialize(self) elif '$' in name: # it's an inner class, we're going to hope it's an enum, treat it # special fieldName, fieldType, fieldId = self.protocol.readFieldBegin() - if fieldName.decode('utf8') != '__enumValue__': - raise dynamicserialize.SerializationException( + if fieldName != '__enumValue__': + raise dynamiceserialize.SerializationException( "Expected to find enum payload. Found: " + fieldName) obj = self.protocol.readString() self.protocol.readFieldEnd() @@ -187,7 +188,7 @@ class ThriftSerializationContext(object): clz = dsObjTypes[name] obj = clz() - while self._deserializeField(obj): + while self._deserializeField(name, obj): pass self.protocol.readStructEnd() @@ -200,19 +201,18 @@ class ThriftSerializationContext(object): raise dynamicserialize.SerializationException( "Unsupported type value " + str(b)) - def _deserializeField(self, obj): + def _deserializeField(self, structname, obj): fieldName, fieldType, fieldId = self.protocol.readFieldBegin() if fieldType == TType.STOP: return False elif fieldType != TType.VOID: result = self._deserializeType(fieldType) - fn_str = bytes.decode(fieldName) - lookingFor = "set" + fn_str[0].upper() + fn_str[1:] + lookingFor = "set" + fieldName[0].upper() + fieldName[1:] try: setMethod = getattr(obj, lookingFor) - setMethod(result) - except ValueError: + setMethod(result) + except: raise dynamicserialize.SerializationException( "Couldn't find setter method " + lookingFor) @@ -225,7 +225,7 @@ class ThriftSerializationContext(object): if size: if listType not in primitiveSupport: m = self.typeDeserializationMethod[listType] - result = [m() for __ in range(size)] + result = [m() for n in range(size)] else: result = self.listDeserializationMethod[listType](size) self.protocol.readListEnd() @@ -234,7 +234,7 @@ class ThriftSerializationContext(object): def _deserializeMap(self): keyType, valueType, size = self.protocol.readMapBegin() result = {} - for __ in range(size): + for n in range(size): # can't go off the type, due to java generics limitations dynamic serialize is # serializing keys and values as void key = self.typeDeserializationMethod[TType.STRUCT]() @@ -246,7 +246,7 @@ class ThriftSerializationContext(object): def _deserializeSet(self): setType, setSize = self.protocol.readSetBegin() result = set([]) - for __ in range(setSize): + for n in range(setSize): result.add(self.typeDeserializationMethod[TType.STRUCT]()) self.protocol.readSetEnd() return result @@ -256,11 +256,10 @@ class ThriftSerializationContext(object): if pyt in pythonToThriftMap: return pythonToThriftMap[pyt] elif pyt.__module__[:DS_LEN - 1] == ('dynamicserialize.dstypes'): - if six.PY2: - return pythonToThriftMap[types.InstanceType] return pythonToThriftMap[object] - raise dynamicserialize.SerializationException( - "Don't know how to serialize object of type: " + str(pyt)) + else: + raise dynamicserialize.SerializationException( + "Don't know how to serialize object of type: " + str(pyt)) def serializeMessage(self, obj): tt = self._lookupType(obj) @@ -314,29 +313,34 @@ class ThriftSerializationContext(object): def _serializeArray(self, obj): size = len(obj) - if size: - if isinstance(obj, numpy.ndarray): - t = pythonToThriftMap[obj.dtype.type] - size = obj.size - else: - t = self._lookupType(obj[0]) + objType = type(obj) + if objType is numpy.ndarray: + t = pythonToThriftMap[obj.dtype.type] + size = obj.size + elif objType is bytes: + t = TType.BYTE + obj = list(obj) + elif size: + t = self._lookupType(obj[0]) else: t = TType.STRUCT self.protocol.writeListBegin(t, size) if t == TType.STRING: - if isinstance(obj, numpy.ndarray): + # For TType.STRING we always assume that if the objType is bytes we + # want to decode it into a str + if objType is numpy.ndarray: if len(obj.shape) == 1: for x in obj: - s = str(x).strip() + s = self._decodeString(x).strip() self.typeSerializationMethod[t](s) else: for x in obj: for y in x: - s = str(y).strip() + s = self._decodeString(y).strip() self.typeSerializationMethod[t](s) else: for x in obj: - s = str(x) + s = self._decodeString(x) self.typeSerializationMethod[t](s) elif t not in primitiveSupport: for x in obj: @@ -348,9 +352,9 @@ class ThriftSerializationContext(object): def _serializeMap(self, obj): size = len(obj) self.protocol.writeMapBegin(TType.VOID, TType.VOID, size) - for k in list(obj.keys()): - self.typeSerializationMethod[TType.STRUCT](k) - self.typeSerializationMethod[TType.STRUCT](obj[k]) + for (key, value) in obj.items(): + self.typeSerializationMethod[TType.STRUCT](key) + self.typeSerializationMethod[TType.STRUCT](value) self.protocol.writeMapEnd() def _serializeSet(self, obj): @@ -360,6 +364,13 @@ class ThriftSerializationContext(object): self.typeSerializationMethod[TType.STRUCT](x) self.protocol.writeSetEnd() + def _decodeString(self, s): + """If s is a byte string, return s.decode(). Otherwise return str(s)""" + if type(s) in BYTE_STRING_TYPES: + return s.decode() + else: + return str(s) + def writeMessageStart(self, name): self.protocol.writeMessageBegin(name, TType.VOID, 0) @@ -412,6 +423,7 @@ class ThriftSerializationContext(object): return self.protocol.readString() def writeString(self, s): + s = self._decodeString(s) self.protocol.writeString(s) def readBinary(self): diff --git a/dynamicserialize/__init__.py b/dynamicserialize/__init__.py index a825711..fc2d7bc 100644 --- a/dynamicserialize/__init__.py +++ b/dynamicserialize/__init__.py @@ -1,35 +1,58 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # +# TODO +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 08/20/10 njensen Initial Creation. -# +# +# # -__all__ = ['SerializationException'] +__all__ = [ + ] from . import dstypes, adapters from . import DynamicSerializationManager - class SerializationException(Exception): - + def __init__(self, message=None): self.message = message - + def __str__(self): if self.message: - return self.message + return self.message else: return "" - - + def serialize(obj): dsm = DynamicSerializationManager.DynamicSerializationManager() return dsm.serializeObject(obj) - -def deserialize(objbytes): +def deserialize(bytes): dsm = DynamicSerializationManager.DynamicSerializationManager() - return dsm.deserializeBytes(objbytes) + return dsm.deserializeBytes(bytes) \ No newline at end of file diff --git a/dynamicserialize/adapters/ActiveTableModeAdapter.py b/dynamicserialize/adapters/ActiveTableModeAdapter.py new file mode 100644 index 0000000..3a64435 --- /dev/null +++ b/dynamicserialize/adapters/ActiveTableModeAdapter.py @@ -0,0 +1,51 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +# +# Adapter for com.raytheon.uf.common.activetable.ActiveTableMode +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 09/29/10 wldougher Initial Creation. +# +# +# + +from thrift.Thrift import TType +from dynamicserialize.dstypes.com.raytheon.uf.common.activetable import ActiveTableMode + +ClassAdapter = 'com.raytheon.uf.common.activetable.ActiveTableMode' + +def serialize(context, mode): + context.protocol.writeFieldBegin('__enumValue__', TType.STRING, 0) + context.writeString(mode.value) + +def deserialize(context): + result = ActiveTableMode() + # Read the TType.STRING, "__enumValue__", and id. + # We're not interested in any of those, so just discard them. + context.protocol.readFieldBegin() + # now get the actual enum value + result.value = context.readString() + return result diff --git a/dynamicserialize/adapters/ByteBufferAdapter.py b/dynamicserialize/adapters/ByteBufferAdapter.py index 80063ef..6d714f7 100644 --- a/dynamicserialize/adapters/ByteBufferAdapter.py +++ b/dynamicserialize/adapters/ByteBufferAdapter.py @@ -1,21 +1,46 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for java.nio.ByteBuffer -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 08/03/11 dgilling Initial Creation. +# +# # -ClassAdapter = ['java.nio.ByteBuffer', 'java.nio.HeapByteBuffer'] +ClassAdapter = ['java.nio.ByteBuffer', 'java.nio.HeapByteBuffer'] -def serialize(context, bufferset): +def serialize(context, set): raise NotImplementedError("Serialization of ByteBuffers is not supported.") - def deserialize(context): byteBuf = context.readBinary() return byteBuf + + + diff --git a/dynamicserialize/adapters/CalendarAdapter.py b/dynamicserialize/adapters/CalendarAdapter.py index 77d37b0..7a21f09 100644 --- a/dynamicserialize/adapters/CalendarAdapter.py +++ b/dynamicserialize/adapters/CalendarAdapter.py @@ -1,24 +1,45 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for java.util.Calendar -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 09/29/10 wldougher Initial Creation. +# +# # from dynamicserialize.dstypes.java.util import Calendar ClassAdapter = 'java.util.Calendar' - def serialize(context, calendar): calTiM = calendar.getTimeInMillis() context.writeI64(calTiM) - - + def deserialize(context): result = Calendar() result.setTimeInMillis(context.readI64()) diff --git a/dynamicserialize/adapters/CommutativeTimestampAdapter.py b/dynamicserialize/adapters/CommutativeTimestampAdapter.py index 7afba78..deff784 100644 --- a/dynamicserialize/adapters/CommutativeTimestampAdapter.py +++ b/dynamicserialize/adapters/CommutativeTimestampAdapter.py @@ -1,25 +1,46 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for CommutativeTimestamp -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 9/21/2015 4486 rjpeter Initial creation. # Jun 23, 2016 5696 rjpeter Handle CommutativeTimestamp. +# # from dynamicserialize.dstypes.com.raytheon.uf.common.time import CommutativeTimestamp -ClassAdapter = 'com.raytheon.uf.common.time.CommutativeTimestamp' +ClassAdapter = 'com.raytheon.uf.common.time.CommutativeTimestamp' def serialize(context, date): context.writeI64(date.getTime()) - - + def deserialize(context): result = CommutativeTimestamp() result.setTime(context.readI64()) - return result + return result \ No newline at end of file diff --git a/dynamicserialize/adapters/CoordAdapter.py b/dynamicserialize/adapters/CoordAdapter.py index 1da1006..2962e41 100644 --- a/dynamicserialize/adapters/CoordAdapter.py +++ b/dynamicserialize/adapters/CoordAdapter.py @@ -1,24 +1,45 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # -# Adapter for com.vividsolutions.jts.geom.Coordinate -# -# +# Adapter for org.locationtech.jts.geom.Coordinate +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 01/20/11 dgilling Initial Creation. +# +# # -from dynamicserialize.dstypes.com.vividsolutions.jts.geom import Coordinate - -ClassAdapter = 'com.vividsolutions.jts.geom.Coordinate' +from dynamicserialize.dstypes.org.locationtech.jts.geom import Coordinate +ClassAdapter = 'org.locationtech.jts.geom.Coordinate' def serialize(context, coordinate): context.writeDouble(coordinate.getX()) context.writeDouble(coordinate.getY()) - def deserialize(context): x = context.readDouble() y = context.readDouble() @@ -26,3 +47,4 @@ def deserialize(context): coord.setX(x) coord.setY(y) return coord + diff --git a/dynamicserialize/adapters/DatabaseIDAdapter.py b/dynamicserialize/adapters/DatabaseIDAdapter.py index 87045aa..7397a47 100644 --- a/dynamicserialize/adapters/DatabaseIDAdapter.py +++ b/dynamicserialize/adapters/DatabaseIDAdapter.py @@ -1,23 +1,44 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 03/29/11 dgilling Initial Creation. +# +# # from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import DatabaseID ClassAdapter = 'com.raytheon.uf.common.dataplugin.gfe.db.objects.DatabaseID' - def serialize(context, dbId): context.writeString(str(dbId)) - - + def deserialize(context): - result = DatabaseID(context.readString()) - return result + result = DatabaseID(context.readString()) + return result \ No newline at end of file diff --git a/dynamicserialize/adapters/DateAdapter.py b/dynamicserialize/adapters/DateAdapter.py index 769c034..82c6911 100644 --- a/dynamicserialize/adapters/DateAdapter.py +++ b/dynamicserialize/adapters/DateAdapter.py @@ -1,24 +1,45 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for java.util.Date -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 12/06/10 dgilling Initial Creation. +# +# # from dynamicserialize.dstypes.java.util import Date ClassAdapter = 'java.util.Date' - def serialize(context, date): context.writeI64(date.getTime()) - - + def deserialize(context): result = Date() result.setTime(context.readI64()) - return result + return result \ No newline at end of file diff --git a/dynamicserialize/adapters/EnumSetAdapter.py b/dynamicserialize/adapters/EnumSetAdapter.py index 7df3192..d5cd00c 100644 --- a/dynamicserialize/adapters/EnumSetAdapter.py +++ b/dynamicserialize/adapters/EnumSetAdapter.py @@ -1,32 +1,57 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for java.util.EnumSet -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 07/28/11 dgilling Initial Creation. # 12/02/13 2537 bsteffen Serialize empty enum sets. +# +# # + + from dynamicserialize.dstypes.java.util import EnumSet -ClassAdapter = ['java.util.EnumSet', 'java.util.RegularEnumSet'] +ClassAdapter = ['java.util.EnumSet', 'java.util.RegularEnumSet'] -def serialize(context, bufferset): - setSize = len(bufferset) +def serialize(context, set): + setSize = len(set) context.writeI32(setSize) - context.writeString(bufferset.getEnumClass()) - for val in bufferset: + context.writeString(set.getEnumClass()) + for val in set: context.writeString(val) - + def deserialize(context): setSize = context.readI32() enumClassName = context.readString() valList = [] - for __ in range(setSize): + for i in range(setSize): valList.append(context.readString()) - return EnumSet(enumClassName, valList) + return EnumSet(enumClassName, valList) diff --git a/dynamicserialize/adapters/FloatBufferAdapter.py b/dynamicserialize/adapters/FloatBufferAdapter.py index ef23211..20c9690 100644 --- a/dynamicserialize/adapters/FloatBufferAdapter.py +++ b/dynamicserialize/adapters/FloatBufferAdapter.py @@ -1,21 +1,46 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for java.nio.FloatBuffer -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 08/01/11 dgilling Initial Creation. +# +# # -ClassAdapter = ['java.nio.FloatBuffer', 'java.nio.HeapFloatBuffer'] +ClassAdapter = ['java.nio.FloatBuffer', 'java.nio.HeapFloatBuffer'] -def serialize(context, bufferset): +def serialize(context, set): raise NotImplementedError("Serialization of FloatBuffers is not supported.") - def deserialize(context): floatBuf = context.readFloatArray() return floatBuf + + + diff --git a/dynamicserialize/adapters/FormattedDateAdapter.py b/dynamicserialize/adapters/FormattedDateAdapter.py index 4637967..f8c6b96 100644 --- a/dynamicserialize/adapters/FormattedDateAdapter.py +++ b/dynamicserialize/adapters/FormattedDateAdapter.py @@ -1,24 +1,46 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for FormattedDate -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 9/21/2015 4486 rjpeter Initial creation. +# +# # from dynamicserialize.dstypes.com.raytheon.uf.common.time import FormattedDate -ClassAdapter = 'com.raytheon.uf.common.time.FormattedDate' +ClassAdapter = 'com.raytheon.uf.common.time.FormattedDate' def serialize(context, date): context.writeI64(date.getTime()) - - + def deserialize(context): result = FormattedDate() result.setTime(context.readI64()) - return result + return result \ No newline at end of file diff --git a/dynamicserialize/adapters/GeomDataRespAdapter.py b/dynamicserialize/adapters/GeomDataRespAdapter.py index d1512f5..9196679 100644 --- a/dynamicserialize/adapters/GeomDataRespAdapter.py +++ b/dynamicserialize/adapters/GeomDataRespAdapter.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Efficient adapter for GetGeometryDataResponse # @@ -11,9 +32,12 @@ # # +from thrift.Thrift import TType +from dynamicserialize import SelfDescribingBinaryProtocol from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.response import GeometryResponseData from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.response import GetGeometryDataResponse + ClassAdapter = 'com.raytheon.uf.common.dataaccess.response.GetGeometryDataResponse' @@ -34,7 +58,7 @@ def serialize(context, resp): context.writeObject(geo.getTime()) context.writeObject(geo.getLevel()) context.writeObject(geo.getLocationName()) - context.writeObject(geo.getAttributes()) + context.writeObject(geo.getAttributes()) # write data map params = geo.getDataMap() @@ -49,17 +73,16 @@ def serialize(context, resp): # unit context.writeObject(value[2]) - def deserialize(context): size = context.readI32() wkbs = [] - for __ in range(size): + for i in range(size): wkb = context.readBinary() wkbs.append(wkb) geoData = [] size = context.readI32() - for _ in range(size): + for i in range(size): data = GeometryResponseData() # wkb index wkbIndex = context.readI32() @@ -77,7 +100,7 @@ def deserialize(context): # parameters paramSize = context.readI32() paramMap = {} - for __ in range(paramSize): + for k in range(paramSize): paramName = context.readString() value = context.readObject() tName = context.readString() diff --git a/dynamicserialize/adapters/GeometryTypeAdapter.py b/dynamicserialize/adapters/GeometryTypeAdapter.py index 3453bac..e809e57 100644 --- a/dynamicserialize/adapters/GeometryTypeAdapter.py +++ b/dynamicserialize/adapters/GeometryTypeAdapter.py @@ -1,36 +1,56 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # -# Adapter for com.vividsolutions.jts.geom.Polygon -# -# +# Adapter for org.locationtech.jts.geom.Polygon +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 01/20/11 dgilling Initial Creation. +# +# # -import dynamicserialize - # TODO: Implement serialization/make deserialization useful. # Deserialization was simply implemented to allow GridLocation objects to be # passed through thrift, but the resulting Geometry object will not be transformed into # useful data; the base byte array is passed to a worthless Geometry class. -from dynamicserialize.dstypes.com.vividsolutions.jts.geom import Geometry +from dynamicserialize.dstypes.org.locationtech.jts.geom import Geometry # NOTE: At the moment, EDEX serializes Polygon, MultiPolygons, Points, and # Geometrys with the tag of the base class Geometry. Java's serialization # adapter is smarter and can determine the exact object by reading the binary # data. This adapter doesn't need this _yet_, so it has not been implemented. -ClassAdapter = 'com.vividsolutions.jts.geom.Geometry' - +ClassAdapter = 'org.locationtech.jts.geom.Geometry' def serialize(context, coordinate): raise dynamicserialize.SerializationException('Not implemented yet') - def deserialize(context): data = context.readBinary() geom = Geometry() geom.setBinaryData(data) return geom + diff --git a/dynamicserialize/adapters/GregorianCalendarAdapter.py b/dynamicserialize/adapters/GregorianCalendarAdapter.py index c94e874..39d5cbc 100644 --- a/dynamicserialize/adapters/GregorianCalendarAdapter.py +++ b/dynamicserialize/adapters/GregorianCalendarAdapter.py @@ -1,24 +1,45 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for java.util.Calendar -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 09/29/10 wldougher Initial Creation. +# +# # from dynamicserialize.dstypes.java.util import GregorianCalendar ClassAdapter = 'java.util.GregorianCalendar' - def serialize(context, calendar): calTiM = calendar.getTimeInMillis() context.writeI64(calTiM) - - + def deserialize(context): result = GregorianCalendar() result.setTimeInMillis(context.readI64()) diff --git a/dynamicserialize/adapters/JTSEnvelopeAdapter.py b/dynamicserialize/adapters/JTSEnvelopeAdapter.py index fcdd683..17636f1 100644 --- a/dynamicserialize/adapters/JTSEnvelopeAdapter.py +++ b/dynamicserialize/adapters/JTSEnvelopeAdapter.py @@ -1,18 +1,39 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # -# Adapter for com.vividsolutions.jts.geom.Envelope -# -# +# Adapter for org.locationtech.jts.geom.Envelope +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 05/29/13 2023 dgilling Initial Creation. # +# -from dynamicserialize.dstypes.com.vividsolutions.jts.geom import Envelope - -ClassAdapter = 'com.vividsolutions.jts.geom.Envelope' +from dynamicserialize.dstypes.org.locationtech.jts.geom import Envelope +ClassAdapter = 'org.locationtech.jts.geom.Envelope' def serialize(context, envelope): context.writeDouble(envelope.getMinX()) @@ -20,7 +41,6 @@ def serialize(context, envelope): context.writeDouble(envelope.getMinY()) context.writeDouble(envelope.getMaxY()) - def deserialize(context): env = Envelope() env.setMinX(context.readDouble()) @@ -28,3 +48,4 @@ def deserialize(context): env.setMinY(context.readDouble()) env.setMaxY(context.readDouble()) return env + diff --git a/dynamicserialize/adapters/JobProgressAdapter.py b/dynamicserialize/adapters/JobProgressAdapter.py new file mode 100644 index 0000000..7d0a40d --- /dev/null +++ b/dynamicserialize/adapters/JobProgressAdapter.py @@ -0,0 +1,51 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +# +# Adapter for com.raytheon.uf.common.dataplugin.gfe.svcbu.JobProgress +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 06/22/2015 4573 randerso Initial creation +# +# +# + +from thrift.Thrift import TType +from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.svcbu import JobProgress + +ClassAdapter = 'com.raytheon.uf.common.dataplugin.gfe.svcbu.JobProgress' + +def serialize(context, mode): + context.protocol.writeFieldBegin('__enumValue__', TType.STRING, 0) + context.writeString(mode.value) + +def deserialize(context): + result = JobProgress() + # Read the TType.STRING, "__enumValue__", and id. + # We're not interested in any of those, so just discard them. + context.protocol.readFieldBegin() + # now get the actual enum value + result.value = context.readString() + return result diff --git a/dynamicserialize/adapters/LocalizationLevelSerializationAdapter.py b/dynamicserialize/adapters/LocalizationLevelSerializationAdapter.py index 7b3a5e4..d391cc1 100644 --- a/dynamicserialize/adapters/LocalizationLevelSerializationAdapter.py +++ b/dynamicserialize/adapters/LocalizationLevelSerializationAdapter.py @@ -1,14 +1,39 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for com.raytheon.uf.common.localization.LocalizationContext$LocalizationLevel -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 01/11/11 dgilling Initial Creation. +# +# # + + from dynamicserialize.dstypes.com.raytheon.uf.common.localization import LocalizationLevel ClassAdapter = [ @@ -16,12 +41,10 @@ ClassAdapter = [ 'com.raytheon.uf.common.localization.LocalizationLevel' ] - def serialize(context, level): context.writeString(level.getText()) context.writeI32(level.getOrder()) - context.writeBool(level.isSystemLevel()) - + context.writeBool(level.isSystemLevel()); def deserialize(context): text = context.readString() @@ -29,3 +52,5 @@ def deserialize(context): systemLevel = context.readBool() level = LocalizationLevel(text, order, systemLevel=systemLevel) return level + + diff --git a/dynamicserialize/adapters/LocalizationTypeSerializationAdapter.py b/dynamicserialize/adapters/LocalizationTypeSerializationAdapter.py index 929d4b0..e7f70e4 100644 --- a/dynamicserialize/adapters/LocalizationTypeSerializationAdapter.py +++ b/dynamicserialize/adapters/LocalizationTypeSerializationAdapter.py @@ -1,14 +1,39 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for com.raytheon.uf.common.localization.LocalizationContext$LocalizationType -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 01/11/11 dgilling Initial Creation. +# +# # + + from dynamicserialize.dstypes.com.raytheon.uf.common.localization import LocalizationType ClassAdapter = [ @@ -16,11 +41,10 @@ ClassAdapter = [ 'com.raytheon.uf.common.localization.LocalizationType' ] - -def serialize(context, ltype): - context.writeString(ltype.getText()) - +def serialize(context, type): + context.writeString(type.getText()) def deserialize(context): typeString = context.readString() return LocalizationType(typeString) + diff --git a/dynamicserialize/adapters/LockTableAdapter.py b/dynamicserialize/adapters/LockTableAdapter.py new file mode 100644 index 0000000..7d7565f --- /dev/null +++ b/dynamicserialize/adapters/LockTableAdapter.py @@ -0,0 +1,89 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# +# Adapter for com.raytheon.uf.common.dataplugin.gfe.server.lock.LockTable +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------- -------- --------- --------------------------------------------- +# Apr 22, 2013 rjpeter Initial Creation. +# Jun 12, 2013 2099 dgilling Use new Lock constructor. +# Feb 06, 2017 5959 randerso Removed Java .toString() calls +# +## + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.server.lock import LockTable +from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.server.lock import Lock + +ClassAdapter = 'com.raytheon.uf.common.dataplugin.gfe.server.lock.LockTable' + +def serialize(context, lockTable): + index=0 + wsIds = {str(lockTable.getWsId()) : index} + index += 1 + locks = lockTable.getLocks() + lockWsIdIndex = [] + for lock in locks: + wsIdString = str(lock.getWsId()) + + if wsIdString in wsIds: + lockWsIdIndex.append(wsIds[wsIdString]) + else: + lockWsIdIndex.append(index) + wsIds[wsIdString] = index + index += 1 + + context.writeObject(lockTable.getParmId()) + + context.writeI32(index) + for wsId in sorted(wsIds, key=wsIds.get): + context.writeObject(wsId) + + context.writeI32(len(locks)) + for lock, wsIndex in zip(locks, lockWsIdIndex): + serializer.writeI64(lock.getStartTime()) + serializer.writeI64(lock.getEndTime()) + serializer.writeI32(wsIndex) + +def deserialize(context): + parmId = context.readObject() + numWsIds = context.readI32() + wsIds = [] + for x in range(numWsIds): + wsIds.append(context.readObject()) + + numLocks = context.readI32() + locks = [] + for x in range(numLocks): + startTime = context.readI64() + endTime = context.readI64() + wsId = wsIds[context.readI32()] + lock = Lock(parmId, wsId, startTime, endTime) + locks.append(lock) + + lockTable = LockTable() + lockTable.setParmId(parmId) + lockTable.setWsId(wsIds[0]) + lockTable.setLocks(locks) + + return lockTable \ No newline at end of file diff --git a/dynamicserialize/adapters/ParmIDAdapter.py b/dynamicserialize/adapters/ParmIDAdapter.py index 54f4baf..12adb2c 100644 --- a/dynamicserialize/adapters/ParmIDAdapter.py +++ b/dynamicserialize/adapters/ParmIDAdapter.py @@ -1,23 +1,44 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 03/29/11 dgilling Initial Creation. +# +# # from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import ParmID ClassAdapter = 'com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID' - def serialize(context, parmId): context.writeString(str(parmId)) - - + def deserialize(context): - result = ParmID(context.readString()) - return result + result = ParmID(context.readString()) + return result \ No newline at end of file diff --git a/dynamicserialize/adapters/PointAdapter.py b/dynamicserialize/adapters/PointAdapter.py index 288aaa5..d571dc1 100644 --- a/dynamicserialize/adapters/PointAdapter.py +++ b/dynamicserialize/adapters/PointAdapter.py @@ -1,24 +1,45 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for java.awt.Point -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 08/31/10 njensen Initial Creation. +# +# # from dynamicserialize.dstypes.java.awt import Point ClassAdapter = 'java.awt.Point' - def serialize(context, point): context.writeI32(point.getX()) context.writeI32(point.getY()) - def deserialize(context): x = context.readI32() y = context.readI32() @@ -26,3 +47,4 @@ def deserialize(context): point.setX(x) point.setY(y) return point + diff --git a/dynamicserialize/adapters/StackTraceElementAdapter.py b/dynamicserialize/adapters/StackTraceElementAdapter.py index 7f4b71b..48de027 100644 --- a/dynamicserialize/adapters/StackTraceElementAdapter.py +++ b/dynamicserialize/adapters/StackTraceElementAdapter.py @@ -1,12 +1,35 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for java.lang.StackTraceElement[] -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 09/21/10 njensen Initial Creation. +# +# # import dynamicserialize @@ -17,8 +40,7 @@ ClassAdapter = 'java.lang.StackTraceElement' def serialize(context, obj): raise dynamicserialize.SerializationException('Not implemented yet') - - + def deserialize(context): result = StackTraceElement() result.setDeclaringClass(context.readString()) @@ -26,3 +48,5 @@ def deserialize(context): result.setFileName(context.readString()) result.setLineNumber(context.readI32()) return result + + diff --git a/dynamicserialize/adapters/TimeConstraintsAdapter.py b/dynamicserialize/adapters/TimeConstraintsAdapter.py index 5f604ad..74b1a5c 100644 --- a/dynamicserialize/adapters/TimeConstraintsAdapter.py +++ b/dynamicserialize/adapters/TimeConstraintsAdapter.py @@ -1,25 +1,46 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for com.raytheon.uf.common.dataplugin.gfe.db.objects.ParmID -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 03/20/13 #1774 randerso Initial Creation. +# +# # from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import TimeConstraints ClassAdapter = 'com.raytheon.uf.common.dataplugin.gfe.db.objects.TimeConstraints' - def serialize(context, timeConstraints): - context.writeI32(timeConstraints.getDuration()) - context.writeI32(timeConstraints.getRepeatInterval()) - context.writeI32(timeConstraints.getStartTime()) - - + context.writeI32(timeConstraints.getDuration()); + context.writeI32(timeConstraints.getRepeatInterval()); + context.writeI32(timeConstraints.getStartTime()); + def deserialize(context): - result = TimeConstraints(context.readI32(), context.readI32(), context.readI32()) - return result + result = TimeConstraints(context.readI32(), context.readI32(), context.readI32()) + return result \ No newline at end of file diff --git a/dynamicserialize/adapters/TimeRangeTypeAdapter.py b/dynamicserialize/adapters/TimeRangeTypeAdapter.py index ab8053e..056dac6 100644 --- a/dynamicserialize/adapters/TimeRangeTypeAdapter.py +++ b/dynamicserialize/adapters/TimeRangeTypeAdapter.py @@ -1,33 +1,56 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # -# Adapter for com.raytheon.uf.common.message.WsId -# -# +# Adapter for com.raytheon.uf.common.message.TimeRange +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 09/16/10 dgilling Initial Creation. -# 01/22/14 2667 bclement use method to get millis from time range -# 02/28/14 2667 bclement deserialize now converts millis to micros +# 01/22/14 2667 bclement use method to get millis from time range +# 02/28/14 2667 bclement deserialize now converts millis to micros +# +# # + from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange + ClassAdapter = 'com.raytheon.uf.common.time.TimeRange' MICROS_IN_MILLISECOND = 1000 MILLIS_IN_SECOND = 1000 - def serialize(context, timeRange): context.writeI64(timeRange.getStartInMillis()) context.writeI64(timeRange.getEndInMillis()) - def deserialize(context): startTime = context.readI64() - endTime = context.readI64() - + endTime = context.readI64() + timeRange = TimeRange() # java uses milliseconds, python uses microseconds startSeconds = startTime // MILLIS_IN_SECOND @@ -36,5 +59,5 @@ def deserialize(context): endExtraMicros = (endTime % MILLIS_IN_SECOND) * MICROS_IN_MILLISECOND timeRange.setStart(startSeconds, startExtraMicros) timeRange.setEnd(endSeconds, endExtraMicros) - + return timeRange diff --git a/dynamicserialize/adapters/TimestampAdapter.py b/dynamicserialize/adapters/TimestampAdapter.py index 986bbbc..e6ce2bf 100644 --- a/dynamicserialize/adapters/TimestampAdapter.py +++ b/dynamicserialize/adapters/TimestampAdapter.py @@ -1,23 +1,44 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for java.sql.Timestamp -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/30/11 dgilling Initial Creation. +# +# # from dynamicserialize.dstypes.java.sql import Timestamp ClassAdapter = 'java.sql.Timestamp' - def serialize(context, timestamp): context.writeI64(timestamp.getTime()) - - + def deserialize(context): result = Timestamp(context.readI64()) - return result + return result \ No newline at end of file diff --git a/dynamicserialize/adapters/WsIdAdapter.py b/dynamicserialize/adapters/WsIdAdapter.py index 40b7121..fc883de 100644 --- a/dynamicserialize/adapters/WsIdAdapter.py +++ b/dynamicserialize/adapters/WsIdAdapter.py @@ -1,6 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Adapter for com.raytheon.uf.common.message.WsId -# +# # # SOFTWARE HISTORY # @@ -8,8 +29,16 @@ # ------------- -------- --------- --------------------------------------------- # Sep 16, 2010 dgilling Initial Creation. # Apr 25, 2012 545 randerso Repurposed the lockKey field as threadId -# Feb 06, 2017 5959 randerso Removed Java .toString() calls -# +# Feb 06, 2017 5959 randerso Removed Java .toString() calls +# Jun 24, 2020 8187 randerso Changed to use hostName instead of integer +# network address. +# Dec 08, 2020 8239 randerso Undo change to use hostName instead of +# integer network address. +# Re-implemented for greater efficiency +# +## + + from dynamicserialize.dstypes.com.raytheon.uf.common.message import WsId @@ -19,14 +48,15 @@ ClassAdapter = 'com.raytheon.uf.common.message.WsId' def serialize(context, wsId): context.writeString(str(wsId)) - def deserialize(context): wsIdString = context.readString() wsIdParts = wsIdString.split(":", 5) - wsId = WsId() - wsId.setNetworkId(wsIdParts[0]) - wsId.setUserName(wsIdParts[1]) - wsId.setProgName(wsIdParts[2]) - wsId.setPid(wsIdParts[3]) - wsId.setThreadId(int(wsIdParts[4])) + + wsId = WsId(networkId=wsIdParts[0], + userName=wsIdParts[1], + progName=wsIdParts[2], + pid=int(wsIdParts[3]), + threadId=int(wsIdParts[4])) + return wsId + diff --git a/dynamicserialize/adapters/__init__.py b/dynamicserialize/adapters/__init__.py index 8da134c..9aa2441 100644 --- a/dynamicserialize/adapters/__init__.py +++ b/dynamicserialize/adapters/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # __init__.py for Dynamic Serialize adapters. # @@ -5,8 +26,8 @@ # classes directly in pythonPackages/dynamicserialize/adapters/ within their # plugin. The plugin's adapter will automatically be added to __all__ at runtime # and registered. -# Plugins should not include a custom __init__.py in -# pythonPackages/dynamicserialize/adapters/ because it will overwrite this file. +# Plugins should not include a custom __init__.py in +# pythonPackages/dynamicserialize/adapters/ because it will overwrite this file. # If custom package initialization is needed, a subpackage should be created # with an __init__.py that includes the following: # @@ -23,6 +44,7 @@ # 03/20/13 #1774 randerso Added TimeConstraintsAdapter # 04/22/13 #1949 rjpeter Added LockTableAdapter # 02/06/14 #2672 bsteffen Added JTSEnvelopeAdapter +# 06/22/2015 #4573 randerso Added JobProgressAdapter # 09/21/2015 #4486 rjpeter Added FormattedDateAdapter # 06/23/2016 #5696 rjpeter Added CommutativeTimestampAdapter # 10/17/2016 #5919 njensen Added GeomDataRespAdapter @@ -32,24 +54,15 @@ __all__ = [ 'PointAdapter', 'StackTraceElementAdapter', - 'WsIdAdapter', 'CalendarAdapter', 'GregorianCalendarAdapter', 'DateAdapter', - 'FormattedDateAdapter', - 'LocalizationLevelSerializationAdapter', - 'LocalizationTypeSerializationAdapter', 'GeometryTypeAdapter', 'CoordAdapter', - 'TimeRangeTypeAdapter', - 'ParmIDAdapter', - 'DatabaseIDAdapter', 'TimestampAdapter', - 'CommutativeTimestampAdapter', 'EnumSetAdapter', 'FloatBufferAdapter', 'ByteBufferAdapter', - 'TimeConstraintsAdapter', 'JTSEnvelopeAdapter' ] @@ -58,7 +71,7 @@ classAdapterRegistry = {} def getAdapterRegistry(): import pkgutil - + discoveredPackages = [] # allow other plugins to contribute to adapters by dropping their adapter or # package into the dynamicserialize.adapters package @@ -68,19 +81,18 @@ def getAdapterRegistry(): else: if modname not in __all__: __all__.append(modname) - + registerAdapters(__name__, __all__) - + for pkg in discoveredPackages: __import__(__name__ + '.' + pkg) - - + + def registerAdapters(package, modules): import sys if not package.endswith('.'): package += '.' for x in modules: - # TODO: use importlib exec('import ' + package + x) m = sys.modules[package + x] d = m.__dict__ diff --git a/dynamicserialize/dstypes/__init__.py b/dynamicserialize/dstypes/__init__.py index c865331..8a203a7 100644 --- a/dynamicserialize/dstypes/__init__.py +++ b/dynamicserialize/dstypes/__init__.py @@ -1,6 +1,29 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'com', 'gov', 'java' ] + + diff --git a/dynamicserialize/dstypes/com/__init__.py b/dynamicserialize/dstypes/com/__init__.py index c85988c..8513e3c 100644 --- a/dynamicserialize/dstypes/com/__init__.py +++ b/dynamicserialize/dstypes/com/__init__.py @@ -1,5 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'raytheon', - 'vividsolutions' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/__init__.py b/dynamicserialize/dstypes/com/raytheon/__init__.py index e984a6a..92f3a4e 100644 --- a/dynamicserialize/dstypes/com/raytheon/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/__init__.py @@ -1,4 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'uf' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/__init__.py index c03e3e7..b2da468 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/__init__.py @@ -1,4 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'common' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/__init__.py index 498a169..3d508dc 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/__init__.py @@ -1,5 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ + 'activetable', 'alertviz', 'auth', 'dataaccess', @@ -9,9 +31,12 @@ __all__ = [ 'localization', 'management', 'message', + 'mpe', 'pointdata', 'pypies', 'serialization', 'site', 'time' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/ActiveTableKey.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/ActiveTableKey.py new file mode 100644 index 0000000..3a9f601 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/ActiveTableKey.py @@ -0,0 +1,86 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 05/22/2015 4522 randerso Initial creation +# 03/17/2016 5426 randerso Add issueYear to primary key +# 08/03/2016 19213 ryu Add pil to primary key +# 02/17/2022 8608 mapeters Extend PersistableDataObject +# +## + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.persist import PersistableDataObject + +class ActiveTableKey(PersistableDataObject): + + def __init__(self): + super().__init__() + self.officeid = None + self.phen = None + self.sig = None + self.etn = None + self.ugcZone = None + self.issueYear = None + self.pil = None + + def getOfficeid(self): + return self.officeid + + def setOfficeid(self, officeid): + self.officeid = officeid + + def getPhen(self): + return self.phen + + def setPhen(self, phen): + self.phen = phen + + def getSig(self): + return self.sig + + def setSig(self, sig): + self.sig = sig + + def getEtn(self): + return self.etn + + def setEtn(self, etn): + self.etn = etn + + def getUgcZone(self): + return self.ugcZone + + def setUgcZone(self, ugcZone): + self.ugcZone = ugcZone + + def getIssueYear(self): + return self.issueYear + + def setIssueYear(self, issueYear): + self.issueYear = issueYear + + def getPil(self): + return self.pil + + def setPil(self, pil): + self.pil = pil diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/ActiveTableMode.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/ActiveTableMode.py new file mode 100644 index 0000000..e35a83f --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/ActiveTableMode.py @@ -0,0 +1,29 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File generated against equivalent DynamicSerialize Java class +# Jul 27, 2016 #5769 randerso Fixed __str__ method + +class ActiveTableMode(object): + def __init__(self): + self.value = None + + def __str__(self): + return str(self.value) \ No newline at end of file diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/ActiveTableRecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/ActiveTableRecord.py new file mode 100644 index 0000000..b0afc3b --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/ActiveTableRecord.py @@ -0,0 +1,291 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 05/22/2015 4522 randerso Initial creation (hand generated) +# 03/17/2016 5426 randerso Add issueYear to primary key +# 06/27/2016 5707 nabowle Remove geometry +# 02/17/2022 8608 mapeters Extend PersistableDataObject +# +## + +from . import ActiveTableKey +import abc + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.persist import PersistableDataObject + +class ActiveTableRecord(PersistableDataObject, metaclass=abc.ABCMeta): + @abc.abstractmethod + def __init__(self): + super().__init__() + self.key = ActiveTableKey.ActiveTableKey() + self.wmoid = None + self.pil = None + self.xxxid = None + self.countyheader = None + self.vtecstr = None + self.productClass = None + self.act = None + self.startTime = None + self.endTime = None + self.issueTime = None + self.purgeTime = None + self.ufn = None + self.forecaster = None + self.motdir = None + self.motspd = None + self.loc = None + self.rawmessage = None + self.seg = None + self.phensig = None + self.region = None + self.overviewText = None + self.segText = None + self.locationID = None + self.floodSeverity = None + self.immediateCause = None + self.floodRecordStatus = None + self.floodBegin = None + self.floodCrest = None + self.floodEnd = None + self.identifier = None + + def getKey(self): + return self.key + + def setKey(self, key): + self.key = key + + def getWmoid(self): + return self.wmoid + + def setWmoid(self, wmoid): + self.wmoid = wmoid + + def getPil(self): + return self.pil + + def setPil(self, pil): + self.pil = pil + + def getXxxid(self): + return self.xxxid + + def setXxxid(self, xxxid): + self.xxxid = xxxid + + def getCountyheader(self): + return self.countyheader + + def setCountyheader(self, countyheader): + self.countyheader = countyheader + + def getUgcZone(self): + return self.key.getUgcZone() + + def setUgcZone(self, ugcZone): + self.key.setUgcZone(ugcZone) + + def getVtecstr(self): + return self.vtecstr + + def setVtecstr(self, vtecstr): + self.vtecstr = vtecstr + + def getProductClass(self): + return self.productClass + + def setProductClass(self, productClass): + self.productClass = productClass + + def getAct(self): + return self.act + + def setAct(self, act): + self.act = act + + def getOfficeid(self): + return self.key.getOfficeid() + + def setOfficeid(self, officeid): + self.key.setOfficeid(officeid) + + def getPhen(self): + return self.key.getPhen() + + def setPhen(self, phen): + self.key.setPhen(phen) + + def getSig(self): + return self.key.getSig() + + def setSig(self, sig): + self.key.setSig(sig) + + def getEtn(self): + return self.key.getEtn() + + def setEtn(self, etn): + self.key.setEtn(etn) + + def getStartTime(self): + return self.startTime + + def setStartTime(self, startTime): + self.startTime = startTime + + def getEndTime(self): + return self.endTime + + def setEndTime(self, endTime): + self.endTime = endTime + + def getIssueTime(self): + return self.issueTime + + def setIssueTime(self, issueTime): + from datetime import datetime + date = datetime.utcfromtimestamp(issueTime.getTime() // 1000) + self.key.setIssueYear(date.year) + self.issueTime = issueTime + + def getPurgeTime(self): + return self.purgeTime + + def setPurgeTime(self, purgeTime): + self.purgeTime = purgeTime + + def isUfn(self): + return self.ufn + + def setUfn(self, ufn): + self.ufn = ufn + + def getForecaster(self): + return self.forecaster + + def setForecaster(self, forecaster): + self.forecaster = forecaster + + def getMotdir(self): + return self.motdir + + def setMotdir(self, motdir): + self.motdir = motdir + + def getMotspd(self): + return self.motspd + + def setMotspd(self, motspd): + self.motspd = motspd + + def getLoc(self): + return self.loc + + def setLoc(self, loc): + self.loc = loc + + def getRawmessage(self): + return self.rawmessage + + def setRawmessage(self, rawmessage): + self.rawmessage = rawmessage + + def getSeg(self): + return self.seg + + def setSeg(self, seg): + self.seg = seg + + def getPhensig(self): + return self.phensig + + def setPhensig(self, phensig): + self.phensig = phensig + + def getRegion(self): + return self.region + + def setRegion(self, region): + self.region = region + + def getOverviewText(self): + return self.overviewText + + def setOverviewText(self, overviewText): + self.overviewText = overviewText + + def getSegText(self): + return self.segText + + def setSegText(self, segText): + self.segText = segText + + def getLocationID(self): + return self.locationID + + def setLocationID(self, locationID): + self.locationID = locationID + + def getFloodSeverity(self): + return self.floodSeverity + + def setFloodSeverity(self, floodSeverity): + self.floodSeverity = floodSeverity + + def getImmediateCause(self): + return self.immediateCause + + def setImmediateCause(self, immediateCause): + self.immediateCause = immediateCause + + def getFloodRecordStatus(self): + return self.floodRecordStatus + + def setFloodRecordStatus(self, floodRecordStatus): + self.floodRecordStatus = floodRecordStatus + + def getFloodBegin(self): + return self.floodBegin + + def setFloodBegin(self, floodBegin): + self.floodBegin = floodBegin + + def getFloodCrest(self): + return self.floodCrest + + def setFloodCrest(self, floodCrest): + self.floodCrest = floodCrest + + def getFloodEnd(self): + return self.floodEnd + + def setFloodEnd(self, floodEnd): + self.floodEnd = floodEnd + + def getIdentifier(self): + return self.identifier + + def setIdentifier(self, identifier): + self.identifier = identifier + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/DumpActiveTableRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/DumpActiveTableRequest.py new file mode 100644 index 0000000..28eea26 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/DumpActiveTableRequest.py @@ -0,0 +1,103 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + +class DumpActiveTableRequest(object): + + def __init__(self): + self.actions = None + self.etns = None + self.fileContent = None + self.fileName = None + self.fromSite = None + self.ids = None + self.mode = None + self.phens = None + self.pils = None + self.sigs = None + self.sites = None + + def getActions(self): + return self.actions + + def setActions(self, actions): + self.actions = actions + + def getEtns(self): + return self.etns + + def setEtns(self, etns): + self.etns = etns + + def getFileContent(self): + return self.fileContent + + def setFileContent(self, fileContent): + self.fileContent = fileContent + + def getFileName(self): + return self.fileName + + def setFileName(self, fileName): + self.fileName = fileName + + def getFromSite(self): + return self.fromSite + + def setFromSite(self, fromSite): + self.fromSite = fromSite + + def getIds(self): + return self.ids + + def setIds(self, ids): + self.ids = ids + + def getMode(self): + return self.mode + + def setMode(self, mode): + self.mode = mode + + def getPhens(self): + return self.phens + + def setPhens(self, phens): + self.phens = phens + + def getPils(self): + return self.pils + + def setPils(self, pils): + self.pils = pils + + def getSigs(self): + return self.sigs + + def setSigs(self, sigs): + self.sigs = sigs + + def getSites(self): + return self.sites + + def setSites(self, sites): + self.sites = sites + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/DumpActiveTableResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/DumpActiveTableResponse.py new file mode 100644 index 0000000..4aed214 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/DumpActiveTableResponse.py @@ -0,0 +1,51 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +class DumpActiveTableResponse(object): + def __init__(self): + self.dump = None + self.unfilteredCount = 0 + self.filteredCount = 0 + self.message = None + + def getUnfilteredCount(self): + return self.unfilteredCount + + def getFilteredCount(self): + return self.filteredCount + + def getDump(self): + return self.dump + + def getMessage(self): + return self.message + + def setUnfilteredCount(self, unfilteredCount): + self.unfilteredCount = unfilteredCount + + def setFilteredCount(self, filteredCount): + self.filteredCount = filteredCount + + def setDump(self, dump): + self.dump = dump + + def setMessage(self, message): + self.message = message + \ No newline at end of file diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetActiveTableDictRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetActiveTableDictRequest.py new file mode 100644 index 0000000..cca8c88 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetActiveTableDictRequest.py @@ -0,0 +1,44 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +class GetActiveTableDictRequest(object): + + def __init__(self): + self.requestedSiteId = None + self.mode = None + self.wfos = None + + def getRequestedSiteId(self): + return self.requestedSiteId + + def setRequestedSiteId(self, requestedSiteId): + self.requestedSiteId = requestedSiteId + + def getMode(self): + return self.mode + + def setMode(self, mode): + self.mode = mode + + def getWfos(self): + return self.wfos + + def setWfos(self, wfos): + self.wfos = wfos; diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetActiveTableDictResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetActiveTableDictResponse.py new file mode 100644 index 0000000..fa33581 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetActiveTableDictResponse.py @@ -0,0 +1,40 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + +class GetActiveTableDictResponse(object): + + def __init__(self): + self.activeTable = None + self.mode = None + + def getActiveTable(self): + return self.activeTable + + def setActiveTable(self, activeTable): + self.activeTable = activeTable + + def getMode(self): + return self.mode + + def setMode(self, mode): + self.mode = mode + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetFourCharSitesRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetFourCharSitesRequest.py new file mode 100644 index 0000000..3f8f84a --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetFourCharSitesRequest.py @@ -0,0 +1,32 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + +class GetFourCharSitesRequest(object): + + def __init__(self): + self.sites = None + + def getSites(self): + return self.sites + + def setSites(self, sites): + self.sites = sites diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetFourCharSitesResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetFourCharSitesResponse.py new file mode 100644 index 0000000..c24d7b0 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetFourCharSitesResponse.py @@ -0,0 +1,32 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + +class GetFourCharSitesResponse(object): + + def __init__(self): + self.sites = None + + def getSites(self): + return self.sites + + def setSites(self, sites): + self.sites = sites diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetVtecAttributeRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetVtecAttributeRequest.py new file mode 100644 index 0000000..73d023c --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetVtecAttributeRequest.py @@ -0,0 +1,44 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +class GetVtecAttributeRequest(object): + + def __init__(self): + self.siteId = None + self.attribute = None + self.defaultValue = None + + def getSiteId(self): + return self.siteId + + def setSiteId(self, site): + self.siteId = site + + def getAttribute(self): + return self.attribute + + def setAttribute(self, attribute): + self.attribute = attribute + + def getDefaultValue(self): + return self.defaultValue + + def setDefaultValue(self, default): + self.defaultValue = default diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetVtecAttributeResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetVtecAttributeResponse.py new file mode 100644 index 0000000..d93398a --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/GetVtecAttributeResponse.py @@ -0,0 +1,30 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +class GetVtecAttributeResponse(object): + + def __init__(self): + self.value = None + + def getValue(self): + return self.value + + def setValue(self, value): + self.value = value diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/OperationalActiveTableRecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/OperationalActiveTableRecord.py new file mode 100644 index 0000000..c6dceb6 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/OperationalActiveTableRecord.py @@ -0,0 +1,35 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 05/22/2015 4522 randerso Changed to inherit from ActiveTableRecord +# +## + +from .ActiveTableRecord import ActiveTableRecord + +class OperationalActiveTableRecord(ActiveTableRecord): + + def __init__(self): + super(OperationalActiveTableRecord, self).__init__() + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/PracticeActiveTableRecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/PracticeActiveTableRecord.py new file mode 100644 index 0000000..aa45a65 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/PracticeActiveTableRecord.py @@ -0,0 +1,34 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 05/22/2015 4522 randerso Changed to inherit from ActiveTableRecord +# +## + +from .ActiveTableRecord import ActiveTableRecord + +class PracticeActiveTableRecord(ActiveTableRecord): + + def __init__(self): + super(PracticeActiveTableRecord, self).__init__() diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/SendPracticeProductRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/SendPracticeProductRequest.py new file mode 100644 index 0000000..82eefc2 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/SendPracticeProductRequest.py @@ -0,0 +1,47 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + +class SendPracticeProductRequest(object): + + def __init__(self): + self.drtString = None + self.notifyGFE = None + self.productText = None + + def getDrtString(self): + return self.drtString + + def setDrtString(self, drtString): + self.drtString = drtString + + def getNotifyGFE(self): + return self.notifyGFE + + def setNotifyGFE(self, notifyGFE): + self.notifyGFE = notifyGFE + + def getProductText(self): + return self.productText + + def setProductText(self, productText): + self.productText = productText + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/VTECChange.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/VTECChange.py new file mode 100644 index 0000000..cc6fadb --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/VTECChange.py @@ -0,0 +1,54 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# 03/25/14 #2884 randerso Added xxxid to VTECChange + +class VTECChange(object): + + def __init__(self): + self.site = None + self.pil = None + self.phensig = None + self.xxxid = None + + def getSite(self): + return self.site + + def setSite(self, site): + self.site = site + + def getPil(self): + return self.pil + + def setPil(self, pil): + self.pil = pil + + def getPhensig(self): + return self.phensig + + def setPhensig(self, phensig): + self.phensig = phensig + + def getXxxid(self): + return self.xxxid + + def setXxxid(self, xxxid): + self.xxxid = xxxid diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/VTECTableChangeNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/VTECTableChangeNotification.py new file mode 100644 index 0000000..d910236 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/VTECTableChangeNotification.py @@ -0,0 +1,59 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + +class VTECTableChangeNotification(object): + + def __init__(self): + self.mode = None + self.modTime = None + self.modSource = None + self.changes = None + + def getMode(self): + return self.mode + + def setMode(self, mode): + self.mode = mode + + def getModTime(self): + return self.modTime + + def setModTime(self, modTime): + self.modTime = modTime + + def getModSource(self): + return self.modSource + + def setModSource(self, modSource): + self.modSource = modSource + + def getChanges(self): + return self.changes + + def setChanges(self, changes): + self.changes = changes + + def __repr__(self): + msg = 'Table Name: ' + str(self.mode) + '\n' + msg += 'ModTime: ' + str(self.modTime) + '\n' + msg += 'ModSource: ' + str(self.modSource) + return msg diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/__init__.py new file mode 100644 index 0000000..814ca22 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/__init__.py @@ -0,0 +1,60 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator + +__all__ = [ + 'ActiveTableKey', + 'ActiveTableRecord', + 'ActiveTableMode', + 'DumpActiveTableRequest', + 'DumpActiveTableResponse', + 'GetActiveTableDictRequest', + 'GetActiveTableDictResponse', + 'GetFourCharSitesRequest', + 'GetFourCharSitesResponse', + 'GetVtecAttributeRequest', + 'GetVtecAttributeResponse', + 'OperationalActiveTableRecord', + 'PracticeActiveTableRecord', + 'SendPracticeProductRequest', + 'VTECChange', + 'VTECTableChangeNotification', + 'request', + 'response' + ] + +from .ActiveTableKey import ActiveTableKey +from .ActiveTableRecord import ActiveTableRecord +from .ActiveTableMode import ActiveTableMode +from .DumpActiveTableRequest import DumpActiveTableRequest +from .DumpActiveTableResponse import DumpActiveTableResponse +from .GetActiveTableDictRequest import GetActiveTableDictRequest +from .GetActiveTableDictResponse import GetActiveTableDictResponse +from .GetFourCharSitesRequest import GetFourCharSitesRequest +from .GetFourCharSitesResponse import GetFourCharSitesResponse +from .GetVtecAttributeRequest import GetVtecAttributeRequest +from .GetVtecAttributeResponse import GetVtecAttributeResponse +from .OperationalActiveTableRecord import OperationalActiveTableRecord +from .PracticeActiveTableRecord import PracticeActiveTableRecord +from .SendPracticeProductRequest import SendPracticeProductRequest +from .VTECChange import VTECChange +from .VTECTableChangeNotification import VTECTableChangeNotification + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/ClearPracticeVTECTableRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/ClearPracticeVTECTableRequest.py new file mode 100644 index 0000000..1b9e709 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/ClearPracticeVTECTableRequest.py @@ -0,0 +1,40 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + + +class ClearPracticeVTECTableRequest(object): + + def __init__(self): + self.siteID = None + self.workstationID = None + + def getSiteID(self): + return self.siteID + + def setSiteID(self, siteID): + self.siteID = siteID + + def getWorkstationID(self): + return self.workstationID + + def setWorkstationID(self, workstationID): + self.workstationID = workstationID diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/MergeActiveTableRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/MergeActiveTableRequest.py new file mode 100644 index 0000000..9ffde54 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/MergeActiveTableRequest.py @@ -0,0 +1,94 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + +class MergeActiveTableRequest(object): + + def __init__(self, incomingRecords=[], tableName='PRACTICE', site=None, + timeOffset=0.0, xmlSource=None, fromIngestAT=False, + makeBackups=True): + self.incomingRecords = incomingRecords + self.site = site + self.tableName = tableName.upper() if tableName.upper() in ['OPERATIONAL', 'PRACTICE'] else 'PRACTICE' + self.timeOffset = float(timeOffset) + self.xmlSource = xmlSource + self.fromIngestAT = bool(fromIngestAT) + self.makeBackups = bool(makeBackups) + + def __repr__(self): + retVal = "MergeActiveTableRequest(" + retVal += repr(self.incomingRecords) + ", " + retVal += repr(self.tableName) + ", " + retVal += repr(self.site) + ", " + retVal += repr(self.timeOffset) + ", " + retVal += repr(self.xmlSource) + ", " + retVal += repr(self.fromIngestAT) + ", " + retVal += repr(self.makeBackups) + ")" + return retVal + + def __str__(self): + return self.__repr__() + + def getIncomingRecords(self): + return self.incomingRecords + + def setIncomingRecords(self, incomingRecords): + self.incomingRecords = incomingRecords + + def getTableName(self): + return self.tableName + + def setTableName(self, tableName): + value = tableName.upper() + if value not in ['OPERATIONAL', 'PRACTICE']: + raise ValueError("Invalid value " + tableName + " specified for ActiveTableMode.") + self.tableName = value + + def getSite(self): + return self.site + + def setSite(self, site): + self.site = site + + def getTimeOffset(self): + return self.timeOffset + + def setTimeOffset(self, timeOffset): + self.timeOffset = float(timeOffset) + + def getXmlSource(self): + return self.xmlSource + + def setXmlSource(self, xmlSource): + self.xmlSource = xmlSource + + def getFromIngestAT(self): + return self.fromIngestAT + + def setFromIngestAT(self, fromIngestAT): + self.fromIngestAT = bool(fromIngestAT) + + def getMakeBackups(self): + return self.makeBackups + + def setMakeBackups(self, makeBackups): + self.makeBackups = bool(makeBackups) + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/RetrieveRemoteActiveTableRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/RetrieveRemoteActiveTableRequest.py new file mode 100644 index 0000000..5cc1875 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/RetrieveRemoteActiveTableRequest.py @@ -0,0 +1,99 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + +class RetrieveRemoteActiveTableRequest(object): + + def __init__(self, serverHost=None, serverPort=0, serverProtocol=None, + mhsId=None, siteId=None, ancfAddress=None, bncfAddress=None, + transmitScript=None): + self.serverHost = serverHost + self.serverPort = int(serverPort) + self.serverProtocol = serverProtocol + self.mhsId = mhsId + self.siteId = siteId + self.ancfAddress = ancfAddress + self.bncfAddress = bncfAddress + self.transmitScript = transmitScript + + def __repr__(self): + retVal = "RetrieveRemoteActiveTableRequest(" + retVal += repr(self.serverHost) + ", " + retVal += repr(self.serverPort) + ", " + retVal += repr(self.serverProtocol) + ", " + retVal += repr(self.mhsId) + ", " + retVal += repr(self.siteId) + ", " + retVal += repr(self.ancfAddress) + ", " + retVal += repr(self.bncfAddress) + ", " + retVal += repr(self.transmitScript) + ")" + return retVal + + def __str__(self): + return self.__repr__() + + def getServerHost(self): + return self.serverHost + + def setServerHost(self, serverHost): + self.serverHost = serverHost + + def getServerPort(self): + return self.serverPort + + def setServerPort(self, serverPort): + self.serverPort = int(serverPort) + + def getServerProtocol(self): + return self.serverProtocol + + def setServerProtocol(self, serverProtocol): + self.serverProtocol = serverProtocol + + def getMhsId(self): + return self.mhsId + + def setMhsId(self, mhsId): + self.mhsId = mhsId + + def getSiteId(self): + return self.siteId + + def setSiteId(self, siteId): + self.siteId = siteId + + def getAncfAddress(self): + return self.ancfAddress + + def setAncfAddress(self, ancfAddress): + self.ancfAddress = ancfAddress + + def getBncfAddress(self): + return self.bncfAddress + + def setBncfAddress(self, bncfAddress): + self.bncfAddress = bncfAddress + + def getTransmitScript(self): + return self.transmitScript + + def setTransmitScript(self, transmitScript): + self.transmitScript = transmitScript + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/SendActiveTableRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/SendActiveTableRequest.py new file mode 100644 index 0000000..cb4d4f4 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/SendActiveTableRequest.py @@ -0,0 +1,140 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + +class SendActiveTableRequest(object): + + def __init__(self, serverHost=None, serverPort=None, serverProtocol=None, + serverSite=None, mhsId=None, sites=None, filterSites=None, + mhsSites=None, issueTime=None, countDict=None, fileName=None, + xmlIncoming=None, transmitScript=None): + self.serverHost = serverHost + self.serverPort = None if serverPort is None else int(serverPort) + self.serverProtocol = serverProtocol + self.serverSite = serverSite + self.mhsId = mhsId + self.sites = sites if sites is not None else [] + self.filterSites = filterSites if filterSites is not None else [] + self.mhsSites = mhsSites if mhsSites is not None else [] + self.issueTime = None if issueTime is None else float(issueTime) + self.countDict = countDict if countDict is not None else {} + self.fileName = fileName + self.xmlIncoming = xmlIncoming + self.transmitScript = transmitScript + + def __repr__(self): + retVal = "SendActiveTableRequest(" + retVal += repr(self.serverHost) + ", " + retVal += repr(self.serverPort) + ", " + retVal += repr(self.serverProtocol) + ", " + retVal += repr(self.serverSite) + ", " + retVal += repr(self.mhsId) + ", " + retVal += repr(self.sites) + ", " + retVal += repr(self.filterSites) + ", " + retVal += repr(self.mhsSites) + ", " + retVal += repr(self.issueTime) + ", " + retVal += repr(self.countDict) + ", " + retVal += repr(self.fileName) + ", " + retVal += repr(self.xmlIncoming) + ", " + retVal += repr(self.transmitScript) + ")" + return retVal + + def __str__(self): + return self.__repr__() + + def getServerHost(self): + return self.serverHost + + def setServerHost(self, serverHost): + self.serverHost = serverHost + + def getServerPort(self): + return self.serverPort + + def setServerPort(self, serverPort): + self.serverPort = serverPort + + def getServerProtocol(self): + return self.serverProtocol + + def setServerProtocol(self, serverProtocol): + self.serverProtocol = serverProtocol + + def getServerSite(self): + return self.serverSite + + def setServerSite(self, serverSite): + self.serverSite = serverSite + + def getMhsId(self): + return self.mhsId + + def setMhsId(self, mhsId): + self.mhsId = mhsId + + def getSites(self): + return self.sites + + def setSites(self, sites): + self.sites = sites + + def getFilterSites(self): + return self.filterSites + + def setFilterSites(self, filterSites): + self.filterSites = filterSites + + def getMhsSites(self): + return self.mhsSites + + def setMhsSites(self, mhsSites): + self.mhsSites = mhsSites + + def getIssueTime(self): + return self.issueTime + + def setIssueTime(self, issueTime): + self.issueTime = issueTime + + def getCountDict(self): + return self.countDict + + def setCountDict(self, countDict): + self.countDict = countDict + + def getFileName(self): + return self.fileName + + def setFileName(self, fileName): + self.fileName = fileName + + def getXmlIncoming(self): + return self.xmlIncoming + + def setXmlIncoming(self, xmlIncoming): + self.xmlIncoming = xmlIncoming + + def getTransmitScript(self): + return self.transmitScript + + def setTransmitScript(self, transmitScript): + self.transmitScript = transmitScript + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/__init__.py new file mode 100644 index 0000000..5fd20d7 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/request/__init__.py @@ -0,0 +1,34 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator + +__all__ = [ + 'ClearPracticeVTECTableRequest', + 'MergeActiveTableRequest', + 'RetrieveRemoteActiveTableRequest', + 'SendActiveTableRequest' + ] + +from .ClearPracticeVTECTableRequest import ClearPracticeVTECTableRequest +from .MergeActiveTableRequest import MergeActiveTableRequest +from .RetrieveRemoteActiveTableRequest import RetrieveRemoteActiveTableRequest +from .SendActiveTableRequest import SendActiveTableRequest + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/response/ActiveTableSharingResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/response/ActiveTableSharingResponse.py new file mode 100644 index 0000000..db10d0e --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/response/ActiveTableSharingResponse.py @@ -0,0 +1,40 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + +class ActiveTableSharingResponse(object): + + def __init__(self): + self.taskSuccess = None + self.errorMessage = None + + def getTaskSuccess(self): + return self.taskSuccess + + def setTaskSuccess(self, taskSuccess): + self.taskSuccess = bool(taskSuccess) + + def getErrorMessage(self): + return self.errorMessage + + def setErrorMessage(self, errorMessage): + self.errorMessage = errorMessage + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/response/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/response/__init__.py new file mode 100644 index 0000000..8a2b807 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/activetable/response/__init__.py @@ -0,0 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator + +__all__ = [ + 'ActiveTableSharingResponse' + ] + +from .ActiveTableSharingResponse import ActiveTableSharingResponse + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/alertviz/AlertVizRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/alertviz/AlertVizRequest.py index b03a9f9..459015b 100755 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/alertviz/AlertVizRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/alertviz/AlertVizRequest.py @@ -1,5 +1,25 @@ -# Jul 27, 2015 4654 skorolev Added filters +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class +# Jul 27, 2015 4654 skorolev Added filters class AlertVizRequest(object): @@ -11,7 +31,7 @@ class AlertVizRequest(object): self.category = None self.audioFile = None self.filters = None - + def getMessage(self): return self.message @@ -47,17 +67,18 @@ class AlertVizRequest(object): def setAudioFile(self, audioFile): self.audioFile = audioFile - + def getFilters(self): return self.filters - + def setFilters(self, filters): if filters is None: - self.filters = {} - elif not(None in filters - or filters.values().count(None) > 0 - or '' in filters - or filters.values().count('') > 0): - self.filters = filters + self.filters = {} + elif (None in filters + or None in filters.values() + or '' in filters + or '' in filters.values()): + msg = 'Filters must not contain None or empty keys or values: %s' + raise ValueError(msg % filters) else: - raise ValueError('Filters must not contain None or empty keys or values: %s' % filters) + self.filters = filters diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/alertviz/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/alertviz/__init__.py index 68a7109..43cc2cc 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/alertviz/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/alertviz/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'AlertVizRequest' diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/__init__.py index a53d346..abb3c19 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/__init__.py @@ -1,5 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'resp', 'user' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AbstractFailedResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AbstractFailedResponse.py index 9bd4f11..e38299e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AbstractFailedResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AbstractFailedResponse.py @@ -1,8 +1,29 @@ -from six import with_metaclass +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + import abc -class AbstractFailedResponse(with_metaclass(abc.ABCMeta, object)): +class AbstractFailedResponse(object, metaclass=abc.ABCMeta): @abc.abstractmethod def __init__(self): self.request = None @@ -12,3 +33,4 @@ class AbstractFailedResponse(with_metaclass(abc.ABCMeta, object)): def setRequest(self, request): self.request = request + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AuthServerErrorResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AuthServerErrorResponse.py index f8dd0d4..4677bb8 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AuthServerErrorResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/AuthServerErrorResponse.py @@ -1,10 +1,33 @@ -# nothing to implement here that isn't already covered by ServerErrorResponse -# Just need the separate class for de-serialization. +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + from dynamicserialize.dstypes.com.raytheon.uf.common.serialization.comm.response import ServerErrorResponse - class AuthServerErrorResponse(ServerErrorResponse): - + def __init__(self): super(AuthServerErrorResponse, self).__init__() + + ## nothing to implement here that isn't already covered by ServerErrorResponse ## + ## Just need the separate class for de-serialization. ## + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/SuccessfulExecution.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/SuccessfulExecution.py index a529036..4e9d210 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/SuccessfulExecution.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/SuccessfulExecution.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class SuccessfulExecution(object): @@ -17,3 +37,4 @@ class SuccessfulExecution(object): def setUpdatedData(self, updatedData): self.updatedData = updatedData + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/UserNotAuthorized.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/UserNotAuthorized.py index 43f60a6..6b32c43 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/UserNotAuthorized.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/UserNotAuthorized.py @@ -1,3 +1,25 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + from dynamicserialize.dstypes.com.raytheon.uf.common.auth.resp import AbstractFailedResponse diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/__init__.py index 67fb814..8fdf525 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/resp/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'AbstractFailedResponse', @@ -10,3 +31,4 @@ from .AbstractFailedResponse import AbstractFailedResponse from .AuthServerErrorResponse import AuthServerErrorResponse from .SuccessfulExecution import SuccessfulExecution from .UserNotAuthorized import UserNotAuthorized + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/User.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/User.py index 30515f6..2501579 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/User.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/User.py @@ -1,5 +1,26 @@ -from dynamicserialize.dstypes.com.raytheon.uf.common.auth.user import UserId +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class + +from dynamicserialize.dstypes.com.raytheon.uf.common.auth.user import UserId class User(object): @@ -21,3 +42,4 @@ class User(object): def setAuthenticationData(self, authenticationData): self.authenticationData = authenticationData + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py index 60668b0..c5f697e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/UserId.py @@ -1,24 +1,38 @@ -import os -try: - import pwd - pwd_error = False -except ImportError: - pwd_error = True +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class + +import os, pwd class UserId(object): - def __init__(self, userid=None): - if userid is None: - if not pwd_error: - self.id = pwd.getpwuid(os.getuid()).pw_name - else: - self.id = "GenericUsername" + def __init__(self, id = None): + if id is None: + self.id = pwd.getpwuid(os.getuid()).pw_name else: - self.id = userid + self.id = id def getId(self): return self.id - def setId(self, userid): - self.id = userid + def setId(self, id): + self.id = id + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/__init__.py index b05112e..95995ff 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/auth/user/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'User', diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/__init__.py index 9f04796..01f7e51 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/__init__.py @@ -1,6 +1,29 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'impl', 'request', 'response' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/DefaultDataRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/DefaultDataRequest.py index b7c7cbc..1808170 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/DefaultDataRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/DefaultDataRequest.py @@ -1,15 +1,39 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to sub-class IDataRequest. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 05/28/13 2023 dgilling Initial Creation. # 12/15/16 6040 tgurney Override __str__ -# +# # -from awips.dataaccess import IDataRequest -from dynamicserialize.dstypes.com.vividsolutions.jts.geom import Envelope + +from ufpy.dataaccess import IDataRequest + +from dynamicserialize.dstypes.org.locationtech.jts.geom import Envelope from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.level import Level @@ -22,30 +46,30 @@ class DefaultDataRequest(IDataRequest): self.levels = [] self.locationNames = [] self.envelope = None - + def setDatatype(self, datatype): self.datatype = str(datatype) - + def addIdentifier(self, key, value): self.identifiers[key] = value - + def removeIdentifier(self, key): del self.identifiers[key] - + def setParameters(self, *params): self.parameters = list(map(str, params)) - + def setLevels(self, *levels): self.levels = list(map(self.__makeLevel, levels)) - + def __makeLevel(self, level): - if isinstance(level, Level): + if type(level) is Level: return level - elif isinstance(level, str): + elif type(level) is str: return Level(level) else: raise TypeError("Invalid object type specified for level.") - + def setEnvelope(self, env): self.envelope = Envelope(env.envelope) @@ -72,6 +96,6 @@ class DefaultDataRequest(IDataRequest): def __str__(self): fmt = ('DefaultDataRequest(datatype={}, identifiers={}, parameters={}, ' + - 'levels={}, locationNames={}, envelope={})') + 'levels={}, locationNames={}, envelope={})') return fmt.format(self.datatype, self.identifiers, self.parameters, self.levels, self.locationNames, self.envelope) diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/DefaultNotificationFilter.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/DefaultNotificationFilter.py index 4fe2d97..6d931c4 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/DefaultNotificationFilter.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/DefaultNotificationFilter.py @@ -1,22 +1,39 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to sub-class IDataRequest. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/03/16 2416 rjpeter Initial Creation. # 08/01/16 2416 tgurney Implement accept() -# +# # -from awips.dataaccess import INotificationFilter + +from ufpy.dataaccess import INotificationFilter import sys -if sys.version_info.major == 2: - from itertools import izip - # shadowing built-in zip - zip = izip - - class DefaultNotificationFilter(INotificationFilter): def __init__(self): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/__init__.py index facaec9..301b582 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/impl/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'DefaultDataRequest', @@ -5,4 +26,4 @@ __all__ = [ ] from .DefaultDataRequest import DefaultDataRequest -from .DefaultNotificationFilter import DefaultNotificationFilter +from .DefaultNotificationFilter import DefaultNotificationFilter \ No newline at end of file diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/AbstractDataAccessRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/AbstractDataAccessRequest.py index 172646a..f6ba2b0 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/AbstractDataAccessRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/AbstractDataAccessRequest.py @@ -1,17 +1,38 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to make it a abstract base class. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 05/28/13 #2023 dgilling Initial Creation. +# 05/28/13 #2023 dgilling Initial Creation. # # -from six import with_metaclass import abc -class AbstractDataAccessRequest(with_metaclass(abc.ABCMeta, object)): +class AbstractDataAccessRequest(object, metaclass=abc.ABCMeta): def __init__(self): self.requestParameters = None diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/AbstractIdentifierRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/AbstractIdentifierRequest.py index 37660b9..b379b1b 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/AbstractIdentifierRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/AbstractIdentifierRequest.py @@ -1,6 +1,28 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to make it a abstract base class. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 07/23/14 #3185 njensen Initial Creation. @@ -9,11 +31,9 @@ # # -from six import with_metaclass import abc - -class AbstractIdentifierRequest(with_metaclass(abc.ABCMeta, object)): +class AbstractIdentifierRequest(object, metaclass=abc.ABCMeta): def __init__(self): self.request = None diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableLevelsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableLevelsRequest.py index 2e12410..3cbb7af 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableLevelsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableLevelsRequest.py @@ -1,16 +1,38 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to make it sub class +# AbstractDataAccessRequest. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 07/23/14 #3185 njensen Initial Creation. +# 07/23/14 #3185 njensen Initial Creation. # # from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import AbstractDataAccessRequest - class GetAvailableLevelsRequest(AbstractDataAccessRequest): def __init__(self): - super(GetAvailableLevelsRequest, self).__init__() + super(GetAvailableLevelsRequest, self).__init__() diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableLocationNamesRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableLocationNamesRequest.py index 5e48b55..23d5962 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableLocationNamesRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableLocationNamesRequest.py @@ -1,16 +1,40 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to make it sub class +# AbstractDataAccessRequest. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 05/28/13 #2023 dgilling Initial Creation. +# 05/28/13 #2023 dgilling Initial Creation. # # + from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import AbstractDataAccessRequest - class GetAvailableLocationNamesRequest(AbstractDataAccessRequest): def __init__(self): super(GetAvailableLocationNamesRequest, self).__init__() + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableParametersRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableParametersRequest.py index 432998b..94dd439 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableParametersRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableParametersRequest.py @@ -1,15 +1,37 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to make it sub class +# AbstractDataAccessRequest. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 07/23/14 #3185 njensen Initial Creation. +# 07/23/14 #3185 njensen Initial Creation. # # from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import AbstractDataAccessRequest - class GetAvailableParametersRequest(AbstractDataAccessRequest): def __init__(self): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableTimesRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableTimesRequest.py index 707ebae..1bcf7b4 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableTimesRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetAvailableTimesRequest.py @@ -1,13 +1,37 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to make it sub class +# AbstractDataAccessRequest. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 05/28/13 #2023 dgilling Initial Creation. +# 05/28/13 #2023 dgilling Initial Creation. # 03/03/14 #2673 bsteffen Add ability to query only ref times. # # + from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import AbstractDataAccessRequest @@ -16,7 +40,7 @@ class GetAvailableTimesRequest(AbstractDataAccessRequest): def __init__(self): super(GetAvailableTimesRequest, self).__init__() self.refTimeOnly = False - + def getRefTimeOnly(self): return self.refTimeOnly diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGeometryDataRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGeometryDataRequest.py index 68a2ca7..e5566bc 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGeometryDataRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGeometryDataRequest.py @@ -1,15 +1,38 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to make it sub class +# AbstractDataAccessRequest. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 05/28/13 #2023 dgilling Initial Creation. +# 05/28/13 #2023 dgilling Initial Creation. # # + from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import AbstractDataAccessRequest - class GetGeometryDataRequest(AbstractDataAccessRequest): def __init__(self): @@ -28,3 +51,4 @@ class GetGeometryDataRequest(AbstractDataAccessRequest): def setRequestedPeriod(self, requestedPeriod): self.requestedPeriod = requestedPeriod + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGridDataRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGridDataRequest.py index aae54f9..1859526 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGridDataRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGridDataRequest.py @@ -1,15 +1,38 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to make it sub class +# AbstractDataAccessRequest. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 05/28/13 #2023 dgilling Initial Creation. +# 05/28/13 #2023 dgilling Initial Creation. # 05/28/13 #5916 bsteffen Add includeLatLonData # # -from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import AbstractDataAccessRequest +from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import AbstractDataAccessRequest class GetGridDataRequest(AbstractDataAccessRequest): @@ -35,4 +58,4 @@ class GetGridDataRequest(AbstractDataAccessRequest): return self.includeLatLonData def setIncludeLatLonData(self, includeLatLonData): - self.includeLatLonData = includeLatLonData + self.includeLatLonData = includeLatLonData; \ No newline at end of file diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGridLatLonRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGridLatLonRequest.py index 00e3ab1..ea50e96 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGridLatLonRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetGridLatLonRequest.py @@ -1,11 +1,31 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Oct 10, 2016 5916 bsteffen Generated - class GetGridLatLonRequest(object): def __init__(self): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetIdentifierValuesRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetIdentifierValuesRequest.py index a4c2e3c..0669307 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetIdentifierValuesRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetIdentifierValuesRequest.py @@ -1,3 +1,26 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to make it subclass +# AbstractDataAccessRequest. # # SOFTWARE HISTORY # @@ -9,7 +32,6 @@ from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import AbstractDataAccessRequest - class GetIdentifierValuesRequest(AbstractDataAccessRequest): def __init__(self): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetNotificationFilterRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetNotificationFilterRequest.py index e97460f..7c462b7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetNotificationFilterRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetNotificationFilterRequest.py @@ -1,16 +1,38 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to make it sub class +# AbstractDataAccessRequest. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 05/26/16 2416 rjpeter Initial Creation. +# 05/26/16 2416 rjpeter Initial Creation. # # from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import AbstractDataAccessRequest - class GetNotificationFilterRequest(AbstractDataAccessRequest): def __init__(self): - super(GetNotificationFilterRequest, self).__init__() + super(GetNotificationFilterRequest, self).__init__() diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetOptionalIdentifiersRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetOptionalIdentifiersRequest.py index b76a5fe..e303d7c 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetOptionalIdentifiersRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetOptionalIdentifiersRequest.py @@ -1,17 +1,40 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to make it sub class +# AbstractIdentifierRequest. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 07/23/14 #3185 njensen Initial Creation. +# 07/23/14 #3185 njensen Initial Creation. # 07/30/14 #3185 njensen Renamed valid to optional # # from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import AbstractIdentifierRequest - class GetOptionalIdentifiersRequest(AbstractIdentifierRequest): def __init__(self): - super(GetOptionalIdentifiersRequest, self).__init__() + super(GetOptionalIdentifiersRequest, self).__init__() + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetRequiredIdentifiersRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetRequiredIdentifiersRequest.py index 2203134..0f4264f 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetRequiredIdentifiersRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetRequiredIdentifiersRequest.py @@ -1,16 +1,38 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to make it sub class +# AbstractIdentifierRequest. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 07/23/14 #3185 njensen Initial Creation. +# 07/23/14 #3185 njensen Initial Creation. # # from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.request import AbstractIdentifierRequest - class GetRequiredIdentifiersRequest(AbstractIdentifierRequest): def __init__(self): - super(GetRequiredIdentifiersRequest, self).__init__() + super(GetRequiredIdentifiersRequest, self).__init__() diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetSupportedDatatypesRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetSupportedDatatypesRequest.py index 7a65257..0309e61 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetSupportedDatatypesRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/GetSupportedDatatypesRequest.py @@ -1,14 +1,36 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified to do nothing on __init__. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- -# 07/23/14 #3185 njensen Initial Creation. +# 07/23/14 #3185 njensen Initial Creation. # # - class GetSupportedDatatypesRequest(object): def __init__(self): pass + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/__init__.py index a864cd5..e2494f2 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/request/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'AbstractDataAccessRequest', diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/AbstractResponseData.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/AbstractResponseData.py index 7fe05a7..d68ab9f 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/AbstractResponseData.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/AbstractResponseData.py @@ -1,8 +1,29 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + import abc -import six -class AbstractResponseData(six.with_metaclass(abc.ABCMeta, object)): +class AbstractResponseData(object, metaclass=abc.ABCMeta): @abc.abstractmethod def __init__(self): self.time = None @@ -23,30 +44,14 @@ class AbstractResponseData(six.with_metaclass(abc.ABCMeta, object)): self.level = level def getLocationName(self): - if six.PY2: - return self.locationName - if self.locationName is not None: - return self.locationName.decode('utf-8') return self.locationName def setLocationName(self, locationName): self.locationName = locationName def getAttributes(self): - if six.PY2: - return self.attributes - return self.convert(self.attributes) + return self.attributes def setAttributes(self, attributes): self.attributes = attributes - def convert(self, data): - if isinstance(data, dict): - return dict(map(self.convert, data.items())) - if isinstance(data, bytes): - return data.decode('utf-8') - if isinstance(data, tuple): - return tuple(map(self.convert, data)) - if isinstance(data, list): - return list(map(self.convert, data)) - return data diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GeometryResponseData.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GeometryResponseData.py index 7f93dfe..9cadff0 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GeometryResponseData.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GeometryResponseData.py @@ -1,6 +1,28 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to use AbstractResponseData. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/04/13 #2023 dgilling Initial Creation. @@ -9,8 +31,8 @@ # # -from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.response import AbstractResponseData +from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.response import AbstractResponseData class GeometryResponseData(AbstractResponseData): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGeometryDataResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGeometryDataResponse.py index e76c656..0927426 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGeometryDataResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGeometryDataResponse.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GetGeometryDataResponse(object): @@ -17,3 +37,4 @@ class GetGeometryDataResponse(object): def setGeoData(self, geoData): self.geoData = geoData + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridDataResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridDataResponse.py index c52ce5e..665f57c 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridDataResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridDataResponse.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GetGridDataResponse(object): @@ -16,25 +36,25 @@ class GetGridDataResponse(object): def setGridData(self, gridData): self.gridData = gridData - + def getSiteNxValues(self): return self.siteNxValues def setSiteNxValues(self, siteNxValues): self.siteNxValues = siteNxValues - + def getSiteNyValues(self): return self.siteNyValues def setSiteNyValues(self, siteNyValues): self.siteNyValues = siteNyValues - + def getSiteLatGrids(self): return self.siteLatGrids def setSiteLatGrids(self, siteLatGrids): self.siteLatGrids = siteLatGrids - + def getSiteLonGrids(self): return self.siteLonGrids @@ -52,3 +72,4 @@ class GetGridDataResponse(object): def setSiteCrsWkt(self, siteCrsWkt): self.siteCrsWkt = siteCrsWkt + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridLatLonResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridLatLonResponse.py index 9721f6a..f86f4c3 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridLatLonResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetGridLatLonResponse.py @@ -1,11 +1,31 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Oct 10, 2016 5916 bsteffen Generated - class GetGridLatLonResponse(object): def __init__(self): @@ -37,3 +57,4 @@ class GetGridLatLonResponse(object): def setNy(self, ny): self.ny = ny + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetNotificationFilterResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetNotificationFilterResponse.py index fb0c571..f4bfa94 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetNotificationFilterResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GetNotificationFilterResponse.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GetNotificationFilterResponse(object): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GridResponseData.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GridResponseData.py index 2c77bf1..7a00d47 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GridResponseData.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/GridResponseData.py @@ -1,15 +1,36 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to use AbstractResponseData. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/04/13 #2023 dgilling Initial Creation. # # -from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.response import AbstractResponseData -import six +from dynamicserialize.dstypes.com.raytheon.uf.common.dataaccess.response import AbstractResponseData class GridResponseData(AbstractResponseData): @@ -20,20 +41,12 @@ class GridResponseData(AbstractResponseData): self.gridData = None def getParameter(self): - if six.PY2: - return self.parameter - if self.parameter is not None: - return self.parameter.decode('utf-8') return self.parameter def setParameter(self, parameter): self.parameter = parameter def getUnit(self): - if six.PY2: - return self.unit - if self.unit is not None: - return self.unit.decode('utf-8') return self.unit def setUnit(self, unit): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/__init__.py index c9fc728..f7f04b8 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataaccess/response/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'AbstractResponseData', diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/__init__.py index d14b058..c18ecc8 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/__init__.py @@ -1,10 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ - 'events', - 'gfe', - 'grid', - 'level', - 'message', - 'radar', - 'text' + 'events' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/__init__.py index da304bb..e1ccbfb 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/__init__.py @@ -1,4 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'hazards' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/__init__.py index ccf9030..d9702fd 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/__init__.py @@ -1,4 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'requests' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/RegionLookupRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/RegionLookupRequest.py index ff0479b..a227fa1 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/RegionLookupRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/RegionLookupRequest.py @@ -1,11 +1,31 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Oct 08, 2014 reblum Generated - class RegionLookupRequest(object): def __init__(self): @@ -23,3 +43,4 @@ class RegionLookupRequest(object): def setSite(self, site): self.site = site + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/__init__.py index 701b487..48dd672 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/events/hazards/requests/__init__.py @@ -1,6 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'RegionLookupRequest' ] from .RegionLookupRequest import RegionLookupRequest + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/GridDataHistory.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/GridDataHistory.py index a7f7e17..83fa35a 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/GridDataHistory.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/GridDataHistory.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class class GridDataHistory(object): @@ -11,10 +32,10 @@ class GridDataHistory(object): self.updateTime = None self.publishTime = None self.lastSentTime = None - + def __str__(self): return self.__repr__() - + def __repr__(self): retVal = "Origin: " + self.origin + '\n' retVal += "Origin Parm: " + str(self.originParm) + '\n' @@ -73,3 +94,4 @@ class GridDataHistory(object): def setLastSentTime(self, lastSentTime): self.lastSentTime = lastSentTime + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/__init__.py index f3684be..e64fb58 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/__init__.py @@ -1,13 +1,33 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/22/2015 4573 randerso Added svcbu package -# 10/06/2015 mjames@ucar Removed svcbu package # +## __all__ = [ + 'GridDataHistory', 'config', 'db', 'discrete', @@ -15,8 +35,9 @@ __all__ = [ 'request', 'server', 'slice', - 'weather', - 'GridDataHistory' + 'svcbu', + 'weather' ] from .GridDataHistory import GridDataHistory + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/ProjectionData.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/ProjectionData.py index ddd87e9..fcc7e21 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/ProjectionData.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/ProjectionData.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class ProjectionData(object): @@ -87,9 +107,10 @@ class ProjectionData(object): def setLonOrigin(self, lonOrigin): self.lonOrigin = lonOrigin - + def keys(self): - return ['projectionID', 'projectionType', 'latLonLL', 'latLonUR', - 'latLonOrigin', 'stdParallelOne', 'stdParallelTwo', - 'gridPointLL', 'gridPointUR', 'latIntersect', 'lonCenter', + return ['projectionID', 'projectionType', 'latLonLL', 'latLonUR', + 'latLonOrigin', 'stdParallelOne', 'stdParallelTwo', + 'gridPointLL', 'gridPointUR', 'latIntersect', 'lonCenter', 'lonOrigin'] + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/__init__.py index 0a311c4..ba6f69d 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/config/__init__.py @@ -1,6 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'ProjectionData' ] from .ProjectionData import ProjectionData + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/__init__.py index d6332d8..c24cb82 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/__init__.py @@ -1,4 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'objects' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/DatabaseID.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/DatabaseID.py index 6ea638e..0ff3856 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/DatabaseID.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/DatabaseID.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class # Modified by njensen to add __repr__ import time @@ -14,7 +35,7 @@ class DatabaseID(object): self.modelId = None self.shortModelId = None if dbIdentifier is not None: - if self.__decodeIdentifier(dbIdentifier): + if (self.__decodeIdentifier(dbIdentifier)): self.__encodeIdentifier() else: self.format = "NONE" @@ -37,8 +58,8 @@ class DatabaseID(object): def getFormat(self): return self.format - def setFormat(self, dbformat): - self.format = dbformat + def setFormat(self, format): + self.format = format def getDbType(self): return self.dbType @@ -72,11 +93,10 @@ class DatabaseID(object): def __encodeIdentifier(self): if self.dbType is not None: - self.modelId = self.siteId + "_" + self.format + "_" \ - + self.dbType + "_" + self.modelName + self.modelId = self.siteId + "_" + self.format + \ + "_" + self.dbType + "_" + self.modelName else: - self.modelId = self.siteId + "_" + self.format + "__" \ - + self.modelName + self.modelId = self.siteId + "_" + self.format + "__" + self.modelName self.shortModelId = self.modelName if self.dbType is not None and self.dbType != "": @@ -84,7 +104,8 @@ class DatabaseID(object): if self.modelTime != "00000000_0000": self.modelId += "_" + self.modelTime - self.shortModelId += "_" + self.modelTime[6:8] + self.modelTime[9:11] + self.shortModelId += "_" + \ + self.modelTime[6:8] + self.modelTime[9:11] else: self.modelId += "_" + "00000000_0000" @@ -113,7 +134,7 @@ class DatabaseID(object): self.modelName = strings[3] # date-time group - if len(strings[4]) != 8 or len(strings[5]) != 4: + if (len(strings[4]) != 8 or len(strings[5]) != 4): return False # make sure the digits are there @@ -129,15 +150,15 @@ class DatabaseID(object): dateStruct = time.gmtime(0) try: dateStruct = time.strptime(dtgString, "%Y%m%d_%H%M") - except ValueError: - return False, dateStruct - return True, dateStruct + except Exception: + return (False, dateStruct) + return (True, dateStruct) def __decodeDtg(self, dtgString): try: time.strptime(dtgString, "%Y%m%d_%H%M") self.modelTime = dtgString - except ValueError: + except Exception: return False return True @@ -154,14 +175,8 @@ class DatabaseID(object): return self.modelId def __hash__(self): - prime = 31 - result = 1 - result = prime * result + (0 if self.dbType is None else hash(self.dbType)) - result = prime * result + (0 if self.format is None else hash(self.format)) - result = prime * result + (0 if self.modelId is None else hash(self.modelId)) - result = prime * result + (0 if self.modelTime is None else hash(self.modelTime)) - result = prime * result + (0 if self.siteId is None else hash(self.siteId)) - return result + return hash((self.dbType, self.format, self.modelId, + self.modelTime, self.siteId)) def __cmp__(self, other): if not isinstance(other, DatabaseID): @@ -188,7 +203,7 @@ class DatabaseID(object): def __eq__(self, other): if not isinstance(other, DatabaseID): return False - return str(self) == str(other) + return (str(self) == str(other)) def __ne__(self, other): - return not self.__eq__(other) + return (not self.__eq__(other)) diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.py index 46105ca..16453be 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.py @@ -1,11 +1,35 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import ParmID +from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.persist import PersistableDataObject from dynamicserialize.dstypes.com.raytheon.uf.common.time import DataTime from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange -class GFERecord(object): +class GFERecord(PersistableDataObject): def __init__(self, parmId=None, timeRange=None): + super().__init__() self.gridHistory = [] self.dataURI = None self.pluginName = "gfe" @@ -15,12 +39,12 @@ class GFERecord(object): self.dataTime = None self.parmId = None if timeRange is not None: - if isinstance(timeRange, TimeRange): + if type(timeRange) is TimeRange: self.dataTime = DataTime(refTime=timeRange.getStart(), validPeriod=timeRange) else: raise TypeError("Invalid TimeRange object specified.") if parmId is not None: - if isinstance(parmId, ParmID.ParmID): + if type(parmId) is ParmID.ParmID: self.parmId = parmId self.parmName = parmId.getParmName() self.parmLevel = parmId.getParmLevel() @@ -90,3 +114,4 @@ class GFERecord(object): def setIdentifier(self, identifier): self.identifier = identifier + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridLocation.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridLocation.py index ca4fecf..69b4e28 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridLocation.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridLocation.py @@ -1,8 +1,31 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class -class GridLocation(object): +from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.persist import PersistableDataObject + +class GridLocation(PersistableDataObject): def __init__(self): + super().__init__() self.siteId = None self.nx = None self.ny = None @@ -13,17 +36,18 @@ class GridLocation(object): self.geometry = None self.crsWKT = None self.identifier = None - + def __str__(self): return self.__repr__() - + def __repr__(self): - # TODO: Handle geometry in dynamicserialize - # ,loc=" + this.geometry.getGeometryType() s = "[SiteID =" + self.siteId + ",ProjID=" + self.projection.getProjectionID() +\ - ",gridSize=(" + str(self.nx) + ',' + str(self.ny) + ")]" + ",gridSize=(" + str(self.nx) + ',' + str(self.ny) + ")" + # TODO: Handle geometry in dynamicserialize + # ,loc=" + this.geometry.getGeometryType(); + s += ']' return s - + def __eq__(self, other): if not isinstance(other, GridLocation): return False @@ -40,9 +64,9 @@ class GridLocation(object): if self.ny != other.ny: return False return True - + def __ne__(self, other): - return not self.__eq__(other) + return (not self.__eq__(other)) def getSiteId(self): return self.siteId @@ -103,12 +127,13 @@ class GridLocation(object): def setIdentifier(self, identifier): self.identifier = identifier - + def isValid(self): if self.projection is None: return False if self.nx < 2 or self.ny < 2: return False if self.origin is None or self.extent is None: - return False + return False return True + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridParmInfo.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridParmInfo.py index d78e9b2..90b6ddb 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridParmInfo.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GridParmInfo.py @@ -1,3 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + +import warnings + from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import GridLocation from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import ParmID from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import TimeConstraints @@ -5,10 +29,10 @@ from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects i class GridParmInfo(object): - def __init__(self, parmid=None, gridLoc=None, gridType="NONE", unit=None, + def __init__(self, id=None, gridLoc=None, gridType="NONE", unit=None, descriptiveName="", minValue=0.0, maxValue=0.0, precision=0, timeIndependentParm=False, timeConstraints=None, rateParm=False): - self.parmID = parmid + self.parmID = id self.gridLoc = gridLoc self.gridType = gridType self.descriptiveName = descriptiveName @@ -19,17 +43,18 @@ class GridParmInfo(object): self.rateParm = rateParm self.timeConstraints = timeConstraints self.timeIndependentParm = timeIndependentParm - + # (valid, errors) = self.__validCheck() # if not valid: # errorMessage = "GridParmInfo is invalid: " + str(errors) # warnings.warn(errorMessage) # self.__setDefaultValues() - + def __str__(self): return self.__repr__() - + def __repr__(self): + out = "" if self.isValid(): out = "ParmID: " + str(self.parmID) + \ " TimeConstraints: " + str(self.timeConstraints) + \ @@ -41,9 +66,10 @@ class GridParmInfo(object): " TimeIndependent: " + str(self.timeIndependentParm) + \ " RateParm: " + str(self.rateParm) + \ " GridType: " + self.gridType - return out - return "" - + else: + out = "" + return out + def __eq__(self, other): if not isinstance(other, GridParmInfo): return False @@ -70,13 +96,13 @@ class GridParmInfo(object): if self.unitString != other.unitString: return False return True - + def __ne__(self, other): - return not self.__eq__(other) - + return (not self.__eq__(other)) + def __validCheck(self): status = [] - + if not self.parmID.isValid(): status.append("GridParmInfo.ParmID is not valid [" + str(self.parmID) + "]") if not self.timeConstraints.isValid(): @@ -86,23 +112,23 @@ class GridParmInfo(object): status.append("GridParmInfo.GridLocation is not valid") if self.timeIndependentParm and self.timeConstraints.anyConstraints(): status.append("GridParmInfo is invalid. There are time constraints" + - " for a time independent parm. Constraints: " + - str(self.timeConstraints)) - if not self.unitString: + " for a time independent parm. Constraints: " + + str(self.timeConstraints)) + if len(self.unitString) == 0: status.append("GridParmInfo.Units are not defined.") if self.precision < -2 or self.precision > 5: status.append("GridParmInfo is invalid. Precision out of limits." + - " Precision is: " + str(self.precision) + ". Must be between -2 and 5.") - + " Precision is: " + str(precision) + ". Must be between -2 and 5.") + retVal = True - if status: + if len(status) > 0: retVal = False - return retVal, status - + return (retVal, status) + def isValid(self): (valid, errors) = self.__validCheck() return valid - + def __setDefaultValues(self): self.parmID = ParmID() self.gridLoc = GridLocation() @@ -181,3 +207,4 @@ class GridParmInfo(object): def setTimeIndependentParm(self, timeIndependentParm): self.timeIndependentParm = timeIndependentParm + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmID.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmID.py index bfb25a5..e479aad 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmID.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmID.py @@ -1,8 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class # Modified by njensen to add __repr__ from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import DatabaseID - class ParmID(object): def __init__(self, parmIdentifier=None, dbId=None, level=None): @@ -12,24 +32,24 @@ class ParmID(object): self.compositeName = None self.shortParmId = None self.parmId = None - + if (parmIdentifier is not None) and (dbId is not None): self.parmName = parmIdentifier - - if isinstance(dbId, DatabaseID): + + if type(dbId) is DatabaseID: self.dbId = dbId - elif isinstance(dbId, str): + elif type(dbId) is str: self.dbId = DatabaseID(dbId) else: raise TypeError("Invalid database ID specified.") - + if level is None: self.parmLevel = self.defaultLevel() else: self.parmLevel = level - + self.__encodeIdentifier() - + elif parmIdentifier is not None: self.__decodeIdentifier(parmIdentifier) self.__encodeIdentifier() @@ -56,66 +76,66 @@ class ParmID(object): parts = parmIdentifier.split(":") nameLevel = parts[0].split("_") self.dbId = DatabaseID(parts[1]) - if len(nameLevel) == 2: + if (len(nameLevel) == 2): self.parmName = nameLevel[0] self.parmLevel = nameLevel[1] else: self.parmName = nameLevel[0] self.parmLevel = self.defaultLevel() - + def __encodeIdentifier(self): self.compositeName = self.parmName + "_" + self.parmLevel self.shortParmId = self.compositeName + ":" + self.dbId.getShortModelId() self.parmId = self.compositeName + ":" + self.dbId.getModelId() - + def isValid(self): if len(self.parmName) is None or len(self.parmLevel) is None or self.dbId is None: return False if len(self.parmName) < 1 or len(self.parmLevel) < 1 or not self.dbId.isValid(): return False - + if not self.parmName.isalnum(): return False if not self.parmLevel.isalnum(): return False - - return True - + + return True + @staticmethod def defaultLevel(): return "SFC" - + @staticmethod def parmNameAndLevel(composite): pos = composite.find('_') if pos != -1: - return composite[:pos], composite[pos+1:] + return (composite[:pos], composite[pos+1:]) else: - return composite, "SFC" - + return (composite, "SFC") + def __str__(self): return self.__repr__() - + def __repr__(self): return self.parmName + '_' + self.parmLevel + ":" + str(self.dbId) - + def __hash__(self): return hash(self.parmId) - + def __cmp__(self, other): if isinstance(other, ParmID): nameComp = cmp(self.parmName, other.parmName) if nameComp != 0: return nameComp - + levelComp = cmp(self.parmLevel, other.parmLevel) if levelComp != 0: return levelComp - + return cmp(self.dbId, other.dbId) else: return NotImplemented - + def __eq__(self, other): if not isinstance(other, ParmID): return False @@ -126,6 +146,6 @@ class ParmID(object): if self.parmName != other.parmName: return False return True - + def __ne__(self, other): - return not self.__eq__(other) + return (not self.__eq__(other)) diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/TimeConstraints.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/TimeConstraints.py index 1a242cb..24901f3 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/TimeConstraints.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/TimeConstraints.py @@ -1,5 +1,26 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class # -# 03/20/2013 #1774 randerso Removed setters, added isValid. +# 03/20/2013 #1774 randerso Removed setters, added isValid. import logging @@ -19,35 +40,40 @@ class TimeConstraints(object): if duration == 0 and repeatInterval == 0 and startTime == 0: self.valid = True else: - if self.isInvalidInterval(repeatInterval, duration, startTime): - logging.warning("Bad init values for TimeConstraints: " - + str(duration) + ", " - + str(repeatInterval) + ", " - + str(startTime)) + if repeatInterval <= 0 or repeatInterval > DAY \ + or DAY % repeatInterval != 0 \ + or repeatInterval < duration \ + or startTime < 0 or startTime > DAY \ + or duration < 0 or duration > DAY: + + logging.warning("Bad init values for TimeConstraints: " + + "duration: %d repeatInterval: %d " + + "startTime: %d", + duration, repeatInterval, startTime) self.valid = False duration = 0 repeatInterval = 0 startTime = 0 else: self.valid = True - + self.duration = duration self.repeatInterval = repeatInterval self.startTime = startTime - + def __str__(self): return self.__repr__() - + def __repr__(self): if not self.isValid(): return "" elif not self.anyConstraints(): return "" else: - return "[s=" + str(self.startTime / HOUR) + "h, i=" + \ - str(self.repeatInterval / HOUR) + "h, d=" + \ - str(self.duration / HOUR) + "h]" - + return "[s=" + str(self.startTime // HOUR) + "h, i=" + \ + str(self.repeatInterval // HOUR) + "h, d=" + \ + str(self.duration // HOUR) + "h]" + def __eq__(self, other): if not isinstance(other, TimeConstraints): return False @@ -57,14 +83,14 @@ class TimeConstraints(object): return False if self.repeatInterval != other.repeatInterval: return False - return self.startTime == other.startTime - + return (self.startTime == other.startTime) + def __ne__(self, other): - return not self.__eq__(other) - + return (not self.__eq__(other)) + def anyConstraints(self): - return self.duration != 0 - + return (self.duration != 0) + def isValid(self): return self.valid @@ -76,14 +102,3 @@ class TimeConstraints(object): def getStartTime(self): return self.startTime - - def isInvalidInterval(self, interval, duration, startTime): - if interval <= 0 or interval > DAY or interval < duration: - return False - if startTime < 0 or startTime > DAY: - return False - if duration < 0 or duration > DAY: - return False - if DAY % interval != 0: - return False - return True diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/__init__.py index 63376e7..6e9d0c8 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'DatabaseID', @@ -14,3 +35,4 @@ from .GridLocation import GridLocation from .GridParmInfo import GridParmInfo from .ParmID import ParmID from .TimeConstraints import TimeConstraints + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/DiscreteKey.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/DiscreteKey.py index c9ef91d..bdf8578 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/DiscreteKey.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/DiscreteKey.py @@ -1,43 +1,58 @@ -# NOTE: Because the pure python dynamicserialize code does not +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +## NOTE: Because the pure python dynamicserialize code does not # have a means of accessing the DiscreteDefinition, this class # is only really useful as a container for deserialized data # from EDEX. I would not recommend trying to use it for anything # else. + SUBKEY_SEPARATOR = '^' AUXDATA_SEPARATOR = ':' - class DiscreteKey(object): def __init__(self): self.siteId = None self.subKeys = None self.parmID = None - + def __str__(self): return self.__repr__() - + def __repr__(self): return SUBKEY_SEPARATOR.join(self.subKeys) - + def __getitem__(self, key): try: index = int(key) - except TypeError: + except: raise TypeError("list indices must be integers, not " + str(type(key))) if index < 0 or index > len(self.subKeys): raise IndexError("index out of range") return self.subKeys[index] - + def __hash__(self): - prime = 31 - result = 1 - result = prime * result + (0 if self.parmID is None else hash(self.parmID)) - result = prime * result + (0 if self.siteId is None else hash(self.siteId)) - result = prime * result + (0 if self.subKeys is None else hash(self.subKeys)) - return result - + return hash((self.parmID, self.siteId, self.subKeys)) + def __eq__(self, other): if not isinstance(other, DiscreteKey): return False @@ -46,10 +61,10 @@ class DiscreteKey(object): if self.siteId != other.siteId: return False return self.subKeys == other.subKeys - + def __ne__(self, other): - return not self.__eq__(other) - + return (not self.__eq__(other)) + @staticmethod def auxData(subkey): pos = subkey.find(AUXDATA_SEPARATOR) @@ -57,7 +72,7 @@ class DiscreteKey(object): return subkey[pos + 1:] else: return "" - + @staticmethod def baseData(subkey): pos = subkey.find(AUXDATA_SEPARATOR) @@ -83,3 +98,4 @@ class DiscreteKey(object): def setParmID(self, parmID): self.parmID = parmID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/__init__.py index 8de379b..271f838 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/__init__.py @@ -1,6 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'DiscreteKey' ] from .DiscreteKey import DiscreteKey + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DByte.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DByte.py index 3a15994..8798a4f 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DByte.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DByte.py @@ -1,3 +1,25 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + import numpy @@ -11,8 +33,8 @@ class Grid2DByte(object): def getBuffer(self): return self.buffer - def setBuffer(self, bytebuffer): - self.buffer = bytebuffer + def setBuffer(self, buffer): + self.buffer = buffer def getXdim(self): return self.xdim @@ -25,6 +47,7 @@ class Grid2DByte(object): def setYdim(self, ydim): self.ydim = ydim - + def getNumPyGrid(self): return numpy.resize(self.buffer, (self.xdim, self.ydim)) + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DFloat.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DFloat.py index 60ab294..8af3dcc 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DFloat.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/Grid2DFloat.py @@ -1,3 +1,25 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + import numpy @@ -11,8 +33,8 @@ class Grid2DFloat(object): def getBuffer(self): return self.buffer - def setBuffer(self, bytebuffer): - self.buffer = bytebuffer + def setBuffer(self, buffer): + self.buffer = buffer def getXdim(self): return self.xdim @@ -25,6 +47,6 @@ class Grid2DFloat(object): def setYdim(self, ydim): self.ydim = ydim - + def getNumPyGrid(self): return numpy.resize(self.buffer, (self.xdim, self.ydim)) diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/__init__.py index 972b3d7..f41355e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/grid/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'Grid2DByte', @@ -6,3 +27,4 @@ __all__ = [ from .Grid2DByte import Grid2DByte from .Grid2DFloat import Grid2DFloat + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/AbstractGfeRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/AbstractGfeRequest.py index 9a9522c..fd8dcea 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/AbstractGfeRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/AbstractGfeRequest.py @@ -1,8 +1,29 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + import abc -from six import with_metaclass -class AbstractGfeRequest(with_metaclass(abc.ABCMeta, object)): +class AbstractGfeRequest(object, metaclass=abc.ABCMeta): @abc.abstractmethod def __init__(self): self.siteID = None diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/CommitGridsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/CommitGridsRequest.py index 52d3095..28d3d2b 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/CommitGridsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/CommitGridsRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class CommitGridsRequest(object): @@ -24,3 +44,4 @@ class CommitGridsRequest(object): def setSiteID(self, siteID): self.siteID = siteID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ConfigureTextProductsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ConfigureTextProductsRequest.py index 989c63d..f3e5f14 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ConfigureTextProductsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ConfigureTextProductsRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class ConfigureTextProductsRequest(object): @@ -31,3 +51,4 @@ class ConfigureTextProductsRequest(object): def setDestinationDir(self, destinationDir): self.destinationDir = destinationDir + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExecuteIfpNetCDFGridRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExecuteIfpNetCDFGridRequest.py index 1227dfa..a31c12f 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExecuteIfpNetCDFGridRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExecuteIfpNetCDFGridRequest.py @@ -1,23 +1,45 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to use AbstractGfeRequest and +# implement str(), repr() +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # xx/xx/?? dgilling Initial Creation. # 03/13/13 1759 dgilling Add software history header. -# 05/13/15 4427 dgilling Add siteIdOverride field. -# +# 05/13/15 4427 dgilling Add siteIdOverride field. +# # from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request import AbstractGfeRequest from dynamicserialize.dstypes.com.raytheon.uf.common.message import WsId - class ExecuteIfpNetCDFGridRequest(AbstractGfeRequest): def __init__(self, outputFilename=None, parmList=[], databaseID=None, - startTime=None, endTime=None, mask=None, geoInfo=False, - compressFile=False, configFileName=None, compressFileFactor=0, + startTime=None, endTime=None, mask=None, geoInfo=False, + compressFile=False, configFileName=None, compressFileFactor=0, trim=False, krunch=False, userID=None, logFileName=None, siteIdOverride=None): super(ExecuteIfpNetCDFGridRequest, self).__init__() self.outputFilename = outputFilename @@ -39,9 +61,10 @@ class ExecuteIfpNetCDFGridRequest(AbstractGfeRequest): self.workstationID = WsId(progName='ifpnetCDF', userName=self.userID) if self.databaseID is not None: self.siteID = self.databaseID.getSiteId() - - def __cstr__(self): - retVal = "workstationID: " + str(self.workstationID) + ", " + + def __str__(self): + retVal = "ExecuteIfpNetCDFGridRequest[" + retVal += "wokstationID: " + str(self.workstationID) + ", " retVal += "siteID: " + str(self.siteID) + ", " retVal += "outputFilename: " + str(self.outputFilename) + ", " retVal += "parmList: " + str(self.parmList) + ", " @@ -58,13 +81,30 @@ class ExecuteIfpNetCDFGridRequest(AbstractGfeRequest): retVal += "userID: " + str(self.userID) + ", " retVal += "logFileName: " + str(self.logFileName) + ", " retVal += "siteIdOverride: " + str(self.siteIdOverride) + retVal += "]" return retVal - - def __str__(self): - return "ExecuteIfpNetCDFGridRequest[" + self.__cstr__() + "]" - + def __repr__(self): - return "ExecuteIfpNetCDFGridRequest(" + self.__cstr__() + ")" + retVal = "ExecuteIfpNetCDFGridRequest(" + retVal += "wokstationID=" + repr(self.workstationID) + ", " + retVal += "siteID=" + repr(self.siteID) + ", " + retVal += "outputFilename=" + repr(self.outputFilename) + ", " + retVal += "parmList=" + repr(self.parmList) + ", " + retVal += "databaseID=" + repr(self.databaseID) + ", " + retVal += "startTime=" + repr(self.startTime) + ", " + retVal += "endTime=" + repr(self.endTime) + ", " + retVal += "mask=" + repr(self.mask) + ", " + retVal += "geoInfo=" + repr(self.geoInfo) + ", " + retVal += "compressFile=" + repr(self.compressFile) + ", " + retVal += "configFileName=" + repr(self.configFileName) + ", " + retVal += "compressFileFactor=" + repr(self.compressFileFactor) + ", " + retVal += "trim=" + repr(self.trim) + ", " + retVal += "krunch=" + repr(self.krunch) + ", " + retVal += "userID=" + repr(self.userID) + ", " + retVal += "logFileName=" + repr(self.logFileName) + ", " + retVal += "siteIdOverride: " + str(self.siteIdOverride) + retVal += ")" + return retVal def getOutputFilename(self): return self.outputFilename diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExecuteIscMosaicRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExecuteIscMosaicRequest.py new file mode 100644 index 0000000..d77137d --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExecuteIscMosaicRequest.py @@ -0,0 +1,255 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to use AbstractGfeRequest and +# implement str(), repr() +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# xx/xx/?? dgilling Initial Creation. +# 03/13/13 1759 dgilling Add software history header. +# 08/08/2018 DCS 19452 dfriedman Add additionalRoutingSiteID +# and asynchronous fields. +# +# +# + + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request import AbstractGfeRequest +from dynamicserialize.dstypes.com.raytheon.uf.common.message import WsId + +class ExecuteIscMosaicRequest(AbstractGfeRequest): + + def __init__(self, userID=None, databaseID=None, parmsToProcess=[], + blankOtherPeriods=False, startTime=None, endTime=None, + altMask=None, replaceOnly=False, eraseFirst=False, announce="", + renameWE=False, iscSends=False, inFiles=[], ignoreMask=False, + adjustTranslate=False, deleteInput=False, parmsToIgnore=[], + gridDelay=0.0, logFileName=None, additionalRoutingSiteID=None, + asynchronous=False): + super(ExecuteIscMosaicRequest, self).__init__() + self.userID = userID + self.databaseID = databaseID + self.parmsToProcess = parmsToProcess + self.blankOtherPeriods = blankOtherPeriods + self.startTime = startTime + self.endTime = endTime + self.altMask = altMask + self.replaceOnly = replaceOnly + self.eraseFirst = eraseFirst + self.announce = announce + self.renameWE = renameWE + self.iscSends = iscSends + self.inFiles = inFiles + self.ignoreMask = ignoreMask + self.adjustTranslate = adjustTranslate + self.deleteInput = deleteInput + self.parmsToIgnore = parmsToIgnore + self.gridDelay = gridDelay + self.logFileName = logFileName + self.additionalRoutingSiteID = additionalRoutingSiteID + self.asynchronous = asynchronous + if self.userID is not None: + self.workstationID = WsId(progName='iscMosaic', userName=self.userID) + if self.databaseID is not None: + self.siteID = self.databaseID.getSiteId() + + def __str__(self): + retVal = "ExecuteIscMosaicRequest[" + retVal += "wokstationID: " + str(self.workstationID) + ", " + retVal += "siteID: " + str(self.siteID) + ", " + retVal += "userID: " + str(self.userID) + ", " + retVal += "databaseID: " + str(self.databaseID) + ", " + retVal += "parmsToProcess: " + str(self.parmsToProcess) + ", " + retVal += "blankOtherPeriods: " + str(self.blankOtherPeriods) + ", " + retVal += "startTime: " + str(self.startTime) + ", " + retVal += "endTime: " + str(self.endTime) + ", " + retVal += "altMask: " + str(self.altMask) + ", " + retVal += "replaceOnly: " + str(self.replaceOnly) + ", " + retVal += "eraseFirst: " + str(self.eraseFirst) + ", " + retVal += "announce: " + str(self.announce) + ", " + retVal += "renameWE: " + str(self.renameWE) + ", " + retVal += "iscSends: " + str(self.iscSends) + ", " + retVal += "inFiles: " + str(self.inFiles) + ", " + retVal += "ignoreMask: " + str(self.ignoreMask) + ", " + retVal += "adjustTranslate: " + str(self.adjustTranslate) + ", " + retVal += "deleteInput: " + str(self.deleteInput) + ", " + retVal += "parmsToIgnore: " + str(self.parmsToIgnore) + ", " + retVal += "gridDelay: " + str(self.gridDelay) + ", " + retVal += "logFileName: " + str(self.logFileName) + ", " + retVal += "additionalRoutingSiteID: " + str(self.additionalRoutingSiteID) + ", " + retVal += "asynchronous: " + str(self.asynchronous) + "]" + return retVal + + def __repr__(self): + retVal = "ExecuteIscMosaicRequest(" + retVal += "wokstationID= " + str(self.workstationID) + ", " + retVal += "siteID= " + str(self.siteID) + ", " + retVal += "userID= " + str(self.userID) + ", " + retVal += "databaseID= " + str(self.databaseID) + ", " + retVal += "parmsToProcess= " + str(self.parmsToProcess) + ", " + retVal += "blankOtherPeriods= " + str(self.blankOtherPeriods) + ", " + retVal += "startTime= " + str(self.startTime) + ", " + retVal += "endTime= " + str(self.endTime) + ", " + retVal += "altMask= " + str(self.altMask) + ", " + retVal += "replaceOnly= " + str(self.replaceOnly) + ", " + retVal += "eraseFirst= " + str(self.eraseFirst) + ", " + retVal += "announce= " + str(self.announce) + ", " + retVal += "renameWE= " + str(self.renameWE) + ", " + retVal += "iscSends= " + str(self.iscSends) + ", " + retVal += "inFiles= " + str(self.inFiles) + ", " + retVal += "ignoreMask= " + str(self.ignoreMask) + ", " + retVal += "adjustTranslate= " + str(self.adjustTranslate) + ", " + retVal += "deleteInput= " + str(self.deleteInput) + ", " + retVal += "parmsToIgnore= " + str(self.parmsToIgnore) + ", " + retVal += "gridDelay= " + str(self.gridDelay) + ", " + retVal += "logFileName= " + str(self.logFileName) + ", " + retVal += "additionalRoutingSiteID= " + str(self.additionalRoutingSiteID) + ", " + retVal += "asynchronous= " + str(self.asynchronous) + ")" + return retVal + + def getUserID(self): + return self.userID + + def setUserID(self, userID): + self.userID = userID + + def getDatabaseID(self): + return self.databaseID + + def setDatabaseID(self, databaseID): + self.databaseID = databaseID + + def getParmsToProcess(self): + return self.parmsToProcess + + def setParmsToProcess(self, parmsToProcess): + self.parmsToProcess = parmsToProcess + + def getBlankOtherPeriods(self): + return self.blankOtherPeriods + + def setBlankOtherPeriods(self, blankOtherPeriods): + self.blankOtherPeriods = blankOtherPeriods + + def getStartTime(self): + return self.startTime + + def setStartTime(self, startTime): + self.startTime = startTime + + def getEndTime(self): + return self.endTime + + def setEndTime(self, endTime): + self.endTime = endTime + + def getAltMask(self): + return self.altMask + + def setAltMask(self, altMask): + self.altMask = altMask + + def getReplaceOnly(self): + return self.replaceOnly + + def setReplaceOnly(self, replaceOnly): + self.replaceOnly = replaceOnly + + def getEraseFirst(self): + return self.eraseFirst + + def setEraseFirst(self, eraseFirst): + self.eraseFirst = eraseFirst + + def getAnnounce(self): + return self.announce + + def setAnnounce(self, announce): + self.announce = announce + + def getRenameWE(self): + return self.renameWE + + def setRenameWE(self, renameWE): + self.renameWE = renameWE + + def getIscSends(self): + return self.iscSends + + def setIscSends(self, iscSends): + self.iscSends = iscSends + + def getInFiles(self): + return self.inFiles + + def setInFiles(self, inFiles): + self.inFiles = inFiles + + def getIgnoreMask(self): + return self.ignoreMask + + def setIgnoreMask(self, ignoreMask): + self.ignoreMask = ignoreMask + + def getAdjustTranslate(self): + return self.adjustTranslate + + def setAdjustTranslate(self, adjustTranslate): + self.adjustTranslate = adjustTranslate + + def getDeleteInput(self): + return self.deleteInput + + def setDeleteInput(self, deleteInput): + self.deleteInput = deleteInput + + def getParmsToIgnore(self): + return self.parmsToIgnore + + def setParmsToIgnore(self, parmsToIgnore): + self.parmsToIgnore = parmsToIgnore + + def getGridDelay(self): + return self.gridDelay + + def setGridDelay(self, gridDelay): + self.gridDelay = gridDelay + + def getLogFileName(self): + return self.logFileName + + def setLogFileName(self, logFileName): + self.logFileName = logFileName + + def getAdditionalRoutingSiteID(self): + return self.additionalRoutingSiteID + + def setAdditionalRoutingSiteID(self, additionalRoutingSiteID): + self.additionalRoutingSiteID = additionalRoutingSiteID + + def getAsynchronous(self): + return self.asynchronous + + def setAsynchronous(self, asynchronous): + self.asynchronous = asynchronous diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExportGridsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExportGridsRequest.py index 794c235..defa9e5 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExportGridsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ExportGridsRequest.py @@ -1,15 +1,38 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + # # A pure python implementation of com.raytheon.uf.common.dataplugin.gfe.request.ExportGridsRequest # for use by the python implementation of DynamicSerialize. # +# File auto-generated against equivalent DynamicSerialize Java class, but additional +# useful methods have been added. # +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 04/05/13 dgilling Initial Creation. -# -# +# +# # from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request import AbstractGfeRequest @@ -37,18 +60,18 @@ class ExportGridsRequest(AbstractGfeRequest): if inputVal in validValues: self.mode = mode else: - raise ValueError(inputVal + " invalid ExportGridsMode. Must be " + str(validValues)) + raise ValueError(inputVal + " not a valid ExportGridsMode value. Must be one of " + str(validValues)) def __str__(self): - retVal = "ExportGridsRequest[" + retVal = "ExportGridsRequest[" retVal += "wokstationID: " + str(self.workstationID) + ", " retVal += "siteID: " + str(self.siteID) + ", " retVal += "site: " + str(self.site) + ", " retVal += "mode: " + str(self.mode) + "]" return retVal - + def __repr__(self): - retVal = "ExportGridsRequest(" + retVal = "ExportGridsRequest(" retVal += "wokstationID=" + repr(self.workstationID) + ", " retVal += "siteID=" + repr(self.siteID) + ", " retVal += "site=" + repr(self.site) + ", " diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetASCIIGridsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetASCIIGridsRequest.py index f8d2610..fd8ab81 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetASCIIGridsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetASCIIGridsRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GetASCIIGridsRequest(object): @@ -45,3 +65,4 @@ class GetASCIIGridsRequest(object): def setSiteID(self, siteID): self.siteID = siteID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridDataRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridDataRequest.py index c9de340..ccd6bf2 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridDataRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridDataRequest.py @@ -1,18 +1,40 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + import abc -from six import with_metaclass + from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.server.request import GetGridRequest -class GetGridDataRequest(with_metaclass(abc.ABCMeta, object)): +class GetGridDataRequest(object, metaclass=abc.ABCMeta): @abc.abstractmethod def __init__(self): self.requests = [] self.workstationID = None self.siteID = None - + def addRequest(self, gridDataReq): if not isinstance(gridDataReq, GetGridRequest): - raise TypeError("Invalid request specified: " + str(type(gridDataReq)) + + raise TypeError("Invalid request specified: " + str(type(gridDataReq)) + \ ". Only GetGridRequests are supported.") else: self.requests.append(gridDataReq) @@ -36,3 +58,4 @@ class GetGridDataRequest(with_metaclass(abc.ABCMeta, object)): def setSiteID(self, siteID): self.siteID = siteID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridInventoryRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridInventoryRequest.py index 53a8c90..d811702 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridInventoryRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetGridInventoryRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GetGridInventoryRequest(object): @@ -24,3 +44,4 @@ class GetGridInventoryRequest(object): def setSiteID(self, siteID): self.siteID = siteID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLatestDbTimeRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLatestDbTimeRequest.py index 3bf2e5d..85e495e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLatestDbTimeRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLatestDbTimeRequest.py @@ -1,10 +1,33 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to use AbstractGfeRequest and +# implement str(), repr() +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 05/22/13 2025 dgilling Initial Creation. -# +# # from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request import AbstractGfeRequest @@ -21,16 +44,16 @@ class GetLatestDbTimeRequest(AbstractGfeRequest): elif dbId is not None and not isinstance(dbId, DatabaseID): raise TypeError( "Attempt to construct GetLatestDbTimeRequest without providing a valid DatabaseID.") - + def __str__(self): - retVal = "GetLatestDbTimeRequest[" + retVal = "GetLatestDbTimeRequest[" retVal += "wokstationID: " + str(self.workstationID) + ", " retVal += "siteID: " + str(self.siteID) + ", " retVal += "dbId: " + str(self.dbId) + "]" return retVal - + def __repr__(self): - retVal = "ExecuteIfpNetCDFGridRequest(" + retVal = "ExecuteIfpNetCDFGridRequest(" retVal += "wokstationID=" + repr(self.workstationID) + ", " retVal += "siteID=" + repr(self.siteID) + ", " retVal += "dbId=" + repr(self.dbId) + ")" diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLatestModelDbIdRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLatestModelDbIdRequest.py index b15b91a..e9f0fa2 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLatestModelDbIdRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLatestModelDbIdRequest.py @@ -1,10 +1,33 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to use AbstractGfeRequest and +# implement str(), repr() +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 05/22/13 2025 dgilling Initial Creation. -# +# # from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request import AbstractGfeRequest @@ -18,16 +41,16 @@ class GetLatestModelDbIdRequest(AbstractGfeRequest): self.siteID = str(siteId) if modelName is not None: self.modelName = str(modelName) - + def __str__(self): - retVal = "GetLatestModelDbIdRequest[" + retVal = "GetLatestModelDbIdRequest[" retVal += "wokstationID: " + str(self.workstationID) + ", " retVal += "siteID: " + str(self.siteID) + ", " retVal += "modelName: " + str(self.modelName) + "]" return retVal - + def __repr__(self): - retVal = "ExecuteIfpNetCDFGridRequest(" + retVal = "ExecuteIfpNetCDFGridRequest(" retVal += "wokstationID=" + repr(self.workstationID) + ", " retVal += "siteID=" + repr(self.siteID) + ", " retVal += "modelName=" + repr(self.modelName) + ")" diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLockTablesRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLockTablesRequest.py index c65c562..d8224bc 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLockTablesRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetLockTablesRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GetLockTablesRequest(object): @@ -24,3 +44,4 @@ class GetLockTablesRequest(object): def setSiteID(self, siteID): self.siteID = siteID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetOfficialDbNameRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetOfficialDbNameRequest.py index b4b77b7..9632a3a 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetOfficialDbNameRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetOfficialDbNameRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GetOfficialDbNameRequest(object): @@ -17,3 +37,4 @@ class GetOfficialDbNameRequest(object): def setSiteID(self, siteID): self.siteID = siteID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetParmListRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetParmListRequest.py index dc6c256..ebb9396 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetParmListRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetParmListRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GetParmListRequest(object): @@ -24,3 +44,4 @@ class GetParmListRequest(object): def setSiteID(self, siteID): self.siteID = siteID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSelectTimeRangeRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSelectTimeRangeRequest.py index 06fa3fd..24910d1 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSelectTimeRangeRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSelectTimeRangeRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GetSelectTimeRangeRequest(object): @@ -24,3 +44,4 @@ class GetSelectTimeRangeRequest(object): def setSiteID(self, siteID): self.siteID = siteID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSingletonDbIdsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSingletonDbIdsRequest.py index 02676f9..81b84ff 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSingletonDbIdsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSingletonDbIdsRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GetSingletonDbIdsRequest(object): @@ -17,3 +37,4 @@ class GetSingletonDbIdsRequest(object): def setSiteID(self, siteID): self.siteID = siteID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSiteTimeZoneInfoRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSiteTimeZoneInfoRequest.py index da8fa63..eb39c44 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSiteTimeZoneInfoRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GetSiteTimeZoneInfoRequest.py @@ -1,15 +1,35 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +## # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # xx/xx/?? dgilling Initial Creation. # 12/02/15 5129 dgilling Refactor based on AbstractGfeRequest. -# +# +## from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request import AbstractGfeRequest - class GetSiteTimeZoneInfoRequest(AbstractGfeRequest): def __init__(self): @@ -21,3 +41,4 @@ class GetSiteTimeZoneInfoRequest(AbstractGfeRequest): def setRequestedSiteIDs(self, requestedSiteIDs): self.requestedSiteIDs = requestedSiteIDs + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GfeClientRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GfeClientRequest.py index afbf643..8c5bbe1 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GfeClientRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GfeClientRequest.py @@ -1,3 +1,22 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request.AbstractGfeRequest import AbstractGfeRequest # Manually updated @@ -8,7 +27,6 @@ from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request.Abst # ------------- -------- --------- --------------------------------------------- # Dec 06, 2016 6092 randerso Initial Creation - class GfeClientRequest(AbstractGfeRequest): def __init__(self, script, siteID, configFile, user, args=[]): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GridLocRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GridLocRequest.py index d8f7b27..2197bd2 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GridLocRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/GridLocRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GridLocRequest(object): @@ -17,3 +37,4 @@ class GridLocRequest(object): def setSiteID(self, siteID): self.siteID = siteID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/IscDataRecRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/IscDataRecRequest.py new file mode 100644 index 0000000..b2d4d44 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/IscDataRecRequest.py @@ -0,0 +1,47 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + +class IscDataRecRequest(object): + + def __init__(self): + self.argString = None + self.workstationID = None + self.siteID = None + + def getArgString(self): + return self.argString + + def setArgString(self, argString): + self.argString = argString + + def getWorkstationID(self): + return self.workstationID + + def setWorkstationID(self, workstationID): + self.workstationID = workstationID + + def getSiteID(self): + return self.siteID + + def setSiteID(self, siteID): + self.siteID = siteID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/LockChangeRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/LockChangeRequest.py index b319021..e041cba 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/LockChangeRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/LockChangeRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class LockChangeRequest(object): @@ -24,3 +44,4 @@ class LockChangeRequest(object): def setSiteID(self, siteID): self.siteID = siteID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ProcessReceivedConfRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ProcessReceivedConfRequest.py index d23aae7..9099107 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ProcessReceivedConfRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ProcessReceivedConfRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class ProcessReceivedConfRequest(object): @@ -23,4 +43,4 @@ class ProcessReceivedConfRequest(object): return self.siteID def setSiteID(self, siteID): - self.siteID = siteID + self.siteID = siteID \ No newline at end of file diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ProcessReceivedDigitalDataRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ProcessReceivedDigitalDataRequest.py index d35aaeb..ca0e5a2 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ProcessReceivedDigitalDataRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/ProcessReceivedDigitalDataRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class ProcessReceivedDigitalDataRequest(object): @@ -23,4 +43,4 @@ class ProcessReceivedDigitalDataRequest(object): return self.siteID def setSiteID(self, siteID): - self.siteID = siteID + self.siteID = siteID \ No newline at end of file diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/PurgeGfeGridsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/PurgeGfeGridsRequest.py index 5444b9d..9fcf3b4 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/PurgeGfeGridsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/PurgeGfeGridsRequest.py @@ -1,14 +1,35 @@ -from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request import AbstractGfeRequest +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request import AbstractGfeRequest class PurgeGfeGridsRequest(AbstractGfeRequest): def __init__(self): super(PurgeGfeGridsRequest, self).__init__() self.databaseID = None - + def __str__(self): - retVal = "PurgeGfeGridsRequest[" + retVal = "PurgeGfeGridsRequest[" retVal += "wokstationID: " + str(self.workstationID) + ", " retVal += "siteID: " + str(self.siteID) + ", " retVal += "databaseID: " + str(self.databaseID) + "]" diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/RsyncGridsToCWFRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/RsyncGridsToCWFRequest.py index 883f4a5..eb61432 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/RsyncGridsToCWFRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/RsyncGridsToCWFRequest.py @@ -1,10 +1,29 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Jul 15, 2015 #4013 randerso Initial creation (hand generated) -# +# # from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.request import AbstractGfeRequest diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SaveASCIIGridsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SaveASCIIGridsRequest.py index 014dfcb..1ff74b8 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SaveASCIIGridsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SaveASCIIGridsRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class SaveASCIIGridsRequest(object): @@ -24,3 +44,4 @@ class SaveASCIIGridsRequest(object): def setSiteID(self, siteID): self.siteID = siteID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SmartInitRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SmartInitRequest.py index e98bf41..15c2c50 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SmartInitRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/SmartInitRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class SmartInitRequest(object): @@ -38,3 +58,4 @@ class SmartInitRequest(object): def setSiteID(self, siteID): self.siteID = siteID + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/__init__.py index dbba035..08fee71 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/request/__init__.py @@ -1,16 +1,36 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Jul 15, 2015 #4013 randerso Added RsyncGridsToCWFRequest -# +# __all__ = [ 'AbstractGfeRequest', 'CommitGridsRequest', 'ConfigureTextProductsRequest', 'ExecuteIfpNetCDFGridRequest', + 'ExecuteIscMosaicRequest', 'ExportGridsRequest', 'GetASCIIGridsRequest', 'GetGridDataRequest', @@ -25,19 +45,21 @@ __all__ = [ 'GetSiteTimeZoneInfoRequest', 'GfeClientRequest', 'GridLocRequest', + 'IscDataRecRequest', 'LockChangeRequest', 'ProcessReceivedConfRequest', 'ProcessReceivedDigitalDataRequest', 'PurgeGfeGridsRequest', - 'RsyncGridsToCWFRequest', 'SaveASCIIGridsRequest', - 'SmartInitRequest' + 'SmartInitRequest', + 'RsyncGridsToCWFRequest', ] from .AbstractGfeRequest import AbstractGfeRequest from .CommitGridsRequest import CommitGridsRequest from .ConfigureTextProductsRequest import ConfigureTextProductsRequest from .ExecuteIfpNetCDFGridRequest import ExecuteIfpNetCDFGridRequest +from .ExecuteIscMosaicRequest import ExecuteIscMosaicRequest from .ExportGridsRequest import ExportGridsRequest from .GetASCIIGridsRequest import GetASCIIGridsRequest from .GetGridDataRequest import GetGridDataRequest @@ -52,6 +74,7 @@ from .GetSingletonDbIdsRequest import GetSingletonDbIdsRequest from .GetSiteTimeZoneInfoRequest import GetSiteTimeZoneInfoRequest from .GfeClientRequest import GfeClientRequest from .GridLocRequest import GridLocRequest +from .IscDataRecRequest import IscDataRecRequest from .LockChangeRequest import LockChangeRequest from .ProcessReceivedConfRequest import ProcessReceivedConfRequest from .ProcessReceivedDigitalDataRequest import ProcessReceivedDigitalDataRequest @@ -59,3 +82,4 @@ from .PurgeGfeGridsRequest import PurgeGfeGridsRequest from .SaveASCIIGridsRequest import SaveASCIIGridsRequest from .SmartInitRequest import SmartInitRequest from .RsyncGridsToCWFRequest import RsyncGridsToCWFRequest + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/__init__.py index 40db808..19d5e52 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'lock', @@ -5,3 +26,5 @@ __all__ = [ 'notify', 'request' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/Lock.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/Lock.py index 0a8b7e0..cd3995e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/Lock.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/Lock.py @@ -1,16 +1,40 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + # -# +# File auto-generated against equivalent DynamicSerialize Java class +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # xx/xx/xxxx xxxxxxx Initial Creation. # xx/xx/xxxx xxxx njensen Implemented __repr__. -# 06/12/2013 2099 dgilling Make class immutable, +# 06/12/2013 2099 dgilling Make class immutable, # add getTimeRange(). +# # import time + from dynamicserialize.dstypes.com.raytheon.uf.common.time import TimeRange @@ -34,19 +58,19 @@ class Lock(object): def getEndTime(self): return self.endTime - + def getTimeRange(self): if not self.timeRange: start = self.startTime / 1000.0 end = self.endTime / 1000.0 self.timeRange = TimeRange(start, end) return self.timeRange - + def __repr__(self): t0 = time.gmtime(self.getStartTime() / 1000.0) t1 = time.gmtime(self.getEndTime() / 1000.0) - timeformat = '%b %d %y %H:%M:%S %Z' - msg = 'TR: (' + time.strftime(timeformat, t0) \ - + ', ' + time.strftime(timeformat, t1) + format = '%b %d %y %H:%M:%S %Z' + msg = 'TR: (' + time.strftime(format, t0) + ', ' + time.strftime(format, t1) msg += " WsId: " + str(self.wsId) return msg + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/LockTable.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/LockTable.py index 6570bbc..279ed8e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/LockTable.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/LockTable.py @@ -1,14 +1,34 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## # # SOFTWARE HISTORY # # Date Ticket# Engineer Description # ------------- -------- --------- --------------------------------------------- -# Feb 06, 2017 5959 randerso Removed Java .toString() calls +# Feb 06, 2017 5959 randerso Removed Java .toString() calls # +## +# File auto-generated against equivalent DynamicSerialize Java class # Modified by njensen to add __repr__ - class LockTable(object): def __init__(self): @@ -33,10 +53,11 @@ class LockTable(object): def setParmId(self, parmId): self.parmId = parmId - + def __repr__(self): - msg = "ParmID: " + str(self.parmId) + msg = "ParmID: " + str(self.parmId) msg += " LockTable WsId: " + str(self.wsId) - for i in self.locks: - msg += "\n Lock: " + str(i) + for i in self.locks: + msg += "\n Lock: " + str(i) return msg + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/__init__.py index c03beee..5340385 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/lock/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'Lock', @@ -6,3 +27,4 @@ __all__ = [ from .Lock import Lock from .LockTable import LockTable + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerMsg.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerMsg.py index 900b724..2551aae 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerMsg.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerMsg.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class ServerMsg(object): @@ -10,3 +30,4 @@ class ServerMsg(object): def setMessage(self, message): self.message = message + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerResponse.py index 9be2b7e..8711bec 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/ServerResponse.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class ServerResponse(object): @@ -26,20 +46,20 @@ class ServerResponse(object): self.notifications = notifications def isOkay(self): - return self.messages is None or len(self.messages) == 0 - + return (self.messages is None or len(self.messages) == 0) + def message(self): - if self.isOkay(): + if (self.isOkay()): return "" else: compMessage = "" for serverMsg in self.messages: compMessage += serverMsg.getMessage() + "\n" - + return compMessage - + def __str__(self): return self.message() - + def __bool__(self): - return self.isOkay() + return self.isOkay() \ No newline at end of file diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/__init__.py index 7536226..a4bd00c 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/message/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'ServerMsg', @@ -6,3 +27,4 @@ __all__ = [ from .ServerMsg import ServerMsg from .ServerResponse import ServerResponse + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/CombinationsFileChangedNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/CombinationsFileChangedNotification.py index b4c84ce..8f89257 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/CombinationsFileChangedNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/CombinationsFileChangedNotification.py @@ -1,15 +1,34 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/22/2015 4573 randerso Initial creation (hand generated) # +## -from . import GfeNotification +from .GfeNotification import GfeNotification - -class CombinationsFileChangedNotification(GfeNotification.GfeNotification): +class CombinationsFileChangedNotification(GfeNotification): def __init__(self): super(CombinationsFileChangedNotification, self).__init__() @@ -23,12 +42,12 @@ class CombinationsFileChangedNotification(GfeNotification.GfeNotification): def getCombinationsFileName(self): return self.combinationsFileName - + def setCombinationsFileName(self, combinationsFileName): self.combinationsFileName = combinationsFileName - + def getWhoChanged(self): return self.whoChanged - + def setWhoChanged(self, whoChanged): self.whoChanged = whoChanged diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/DBInvChangeNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/DBInvChangeNotification.py index 6bb1f41..aabb83a 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/DBInvChangeNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/DBInvChangeNotification.py @@ -1,17 +1,36 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # ??/??/???? ???? njensen Modified to add __repr__ # 06/22/2015 4573 randerso Change to extend GfeNotification # removed inventory methods # +## -from . import GfeNotification +from .GfeNotification import GfeNotification - -class DBInvChangeNotification(GfeNotification.GfeNotification): +class DBInvChangeNotification(GfeNotification): def __init__(self): super(DBInvChangeNotification, self).__init__() @@ -34,3 +53,4 @@ class DBInvChangeNotification(GfeNotification.GfeNotification): msg = 'Additions' + str(self.additions) + '\n' msg += 'Deletions' + str(self.deletions) return msg + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GfeNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GfeNotification.py index dd18061..8b7359b 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GfeNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GfeNotification.py @@ -1,16 +1,32 @@ -# +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 10/07/2014 3684 randerso Manually updated to add sourceID # - +## import abc -from six import with_metaclass - -class GfeNotification(with_metaclass(abc.ABCMeta, object)): +class GfeNotification(object, metaclass=abc.ABCMeta): @abc.abstractmethod def __init__(self): self.siteID = None @@ -22,6 +38,7 @@ class GfeNotification(with_metaclass(abc.ABCMeta, object)): def setSiteID(self, siteID): self.siteID = siteID + def getSourceID(self): return self.sourceID diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridHistoryUpdateNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridHistoryUpdateNotification.py index 8edec6f..b2b0d36 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridHistoryUpdateNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridHistoryUpdateNotification.py @@ -1,13 +1,32 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/22/2015 4573 randerso Initial creation (hand generated) # +## -from . import GfeNotification - +from .GfeNotification import GfeNotification class GridHistoryUpdateNotification(GfeNotification): @@ -31,11 +50,12 @@ class GridHistoryUpdateNotification(GfeNotification): def getHistories(self): return self.histories - + def setHistories(self, histories): self.histories = histories - + def __str__(self): msg = "ParmID: " + str(self.parmId) msg += '\n' + "Histories: " + str(self.histories) return msg + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridUpdateNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridUpdateNotification.py index bd0e897..90a0466 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridUpdateNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/GridUpdateNotification.py @@ -1,14 +1,33 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # ??/??/???? ???? njensen Modified to add __repr__ # 06/22/2015 4573 randerso Change to extend GfeNotification # +## -from . import GfeNotification - +from .GfeNotification import GfeNotification class GridUpdateNotification(GfeNotification): @@ -39,12 +58,13 @@ class GridUpdateNotification(GfeNotification): def getHistories(self): return self.histories - + def setHistories(self, histories): self.histories = histories - + def __str__(self): msg = "ParmID: " + str(self.parmId) msg += '\n' + "Replacement TimeRange: " + str(self.replacementTimeRange) msg += '\n' + "Histories: " + str(self.histories) return msg + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/LockNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/LockNotification.py index 74288df..4aad7d2 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/LockNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/LockNotification.py @@ -1,14 +1,33 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # ??/??/???? ???? njensen Modified to add __repr__ # 06/22/2015 4573 randerso Change to extend GfeNotification # +## -from . import GfeNotification - +from .GfeNotification import GfeNotification class LockNotification(GfeNotification): @@ -24,3 +43,4 @@ class LockNotification(GfeNotification): def __str__(self): return str(self.lockTable) + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/ServiceBackupJobStatusNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/ServiceBackupJobStatusNotification.py new file mode 100644 index 0000000..9483d21 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/ServiceBackupJobStatusNotification.py @@ -0,0 +1,54 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 06/22/2015 4573 randerso Initial creation (hand generated) +# +## + +from .GfeNotification import GfeNotification + +class ServiceBackupJobStatusNotification(GfeNotification): + + def __init__(self): + super(ServiceBackupJobStatusNotification, self).__init__() + self.name = None + self.state = "UNKNOWN" + + def __str__(self): + msg = "name: " + str(self.name) + msg += '\n' + "state: " + str(self.state) + return msg + + def getName(self): + return self.name + + def setName(self, name): + self.name = name + + def getState(self): + return self.state + + def setState(self, state): + self.state = state + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/UserMessageNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/UserMessageNotification.py index 33183d1..601c372 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/UserMessageNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/UserMessageNotification.py @@ -1,13 +1,32 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 06/22/2015 4573 randerso Change to extend GfeNotification # +## -from . import GfeNotification - +from .GfeNotification import GfeNotification class UserMessageNotification(GfeNotification): @@ -40,3 +59,4 @@ class UserMessageNotification(GfeNotification): msg += 'Priority: ' + str(self.priority) + '\n' msg += 'Category: ' + str(self.category) + '\n' return msg + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/__init__.py index b0ca85e..86c7b11 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/notify/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'CombinationsFileChangedNotification', @@ -6,6 +27,7 @@ __all__ = [ 'GridHistoryUpdateNotification', 'GridUpdateNotification', 'LockNotification', + 'ServiceBackupJobStatusNotification', 'UserMessageNotification' ] @@ -15,4 +37,6 @@ from .GfeNotification import GfeNotification from .GridHistoryUpdateNotification import GridHistoryUpdateNotification from .GridUpdateNotification import GridUpdateNotification from .LockNotification import LockNotification +from .ServiceBackupJobStatusNotification import ServiceBackupJobStatusNotification from .UserMessageNotification import UserMessageNotification + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/CommitGridRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/CommitGridRequest.py index 81f6b2c..8b42939 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/CommitGridRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/CommitGridRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class CommitGridRequest(object): @@ -31,3 +51,4 @@ class CommitGridRequest(object): def setClientSendStatus(self, clientSendStatus): self.clientSendStatus = bool(clientSendStatus) + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/GetGridRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/GetGridRequest.py index 46bd13f..ee19e1b 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/GetGridRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/GetGridRequest.py @@ -1,4 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import GFERecord +from dynamicserialize.dstypes.com.raytheon.uf.common.message import WsId class GetGridRequest(object): @@ -28,3 +51,4 @@ class GetGridRequest(object): def setConvertUnit(self, convertUnit): self.convertUnit = convertUnit + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockRequest.py index 0811432..5733fb9 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class LockRequest(object): @@ -31,3 +51,4 @@ class LockRequest(object): def setMode(self, mode): self.mode = mode + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockTableRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockTableRequest.py index e48e3c4..5e67b42 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockTableRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/LockTableRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class LockTableRequest(object): @@ -17,3 +37,4 @@ class LockTableRequest(object): def setDbId(self, dbId): self.dbId = dbId + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/__init__.py index 355b490..195e735 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/server/request/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'CommitGridRequest', @@ -10,3 +31,4 @@ from .CommitGridRequest import CommitGridRequest from .GetGridRequest import GetGridRequest from .LockRequest import LockRequest from .LockTableRequest import LockTableRequest + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/AbstractGridSlice.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/AbstractGridSlice.py index 0129cad..56baa2d 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/AbstractGridSlice.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/AbstractGridSlice.py @@ -1,18 +1,37 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + import abc -from six import with_metaclass -class AbstractGridSlice(with_metaclass(abc.ABCMeta, object)): +class AbstractGridSlice(object, metaclass=abc.ABCMeta): @abc.abstractmethod def __init__(self): self.validTime = None self.gridParmInfo = None self.gridDataHistory = None - + @abc.abstractmethod def getNumPyGrid(self): raise NotImplementedError - + def getValidTime(self): return self.validTime @@ -29,4 +48,4 @@ class AbstractGridSlice(with_metaclass(abc.ABCMeta, object)): return self.gridDataHistory def setGridDataHistory(self, gridDataHistory): - self.gridDataHistory = gridDataHistory + self.gridDataHistory = gridDataHistory \ No newline at end of file diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/DiscreteGridSlice.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/DiscreteGridSlice.py index 1a26e0a..75f5c47 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/DiscreteGridSlice.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/DiscreteGridSlice.py @@ -1,3 +1,31 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------- -------- --------- -------------------------------------------- +# Jan 04, 2018 7178 randerso Changed getKey() and setKey() to getKeys() +# and setKeys() +# +# File auto-generated against equivalent DynamicSerialize Java class + from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.slice import AbstractGridSlice @@ -6,19 +34,19 @@ class DiscreteGridSlice(AbstractGridSlice): def __init__(self): super(DiscreteGridSlice, self).__init__() self.discreteGrid = None - self.key = [] + self.keys = [] def getDiscreteGrid(self): return self.discreteGrid def setDiscreteGrid(self, discreteGrid): self.discreteGrid = discreteGrid - + def getNumPyGrid(self): - return self.discreteGrid.getNumPyGrid(), self.key + return (self.discreteGrid.getNumPyGrid(), self.key) - def getKey(self): - return self.key + def getKeys(self): + return self.keys - def setKey(self, key): - self.key = key + def setKeys(self, keys): + self.keys = keys diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/ScalarGridSlice.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/ScalarGridSlice.py index 8cc9ec4..1adb169 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/ScalarGridSlice.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/ScalarGridSlice.py @@ -1,12 +1,33 @@ -from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.slice import AbstractGridSlice +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class + +from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.slice import AbstractGridSlice class ScalarGridSlice(AbstractGridSlice): def __init__(self): super(ScalarGridSlice, self).__init__() self.scalarGrid = None - + def getNumPyGrid(self): return self.scalarGrid.getNumPyGrid() diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/VectorGridSlice.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/VectorGridSlice.py index 229d47b..f109bfd 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/VectorGridSlice.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/VectorGridSlice.py @@ -1,3 +1,25 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.slice import ScalarGridSlice @@ -6,16 +28,16 @@ class VectorGridSlice(ScalarGridSlice): def __init__(self): super(VectorGridSlice, self).__init__() self.dirGrid = None - + def getNumPyGrid(self): - return self.scalarGrid.getNumPyGrid(), self.dirGrid.getNumPyGrid() + return (self.scalarGrid.getNumPyGrid(), self.dirGrid.getNumPyGrid()) def getDirGrid(self): return self.dirGrid def setDirGrid(self, dirGrid): self.dirGrid = dirGrid - + def getMagGrid(self): return self.scalarGrid diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/WeatherGridSlice.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/WeatherGridSlice.py index 92e75e3..d157151 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/WeatherGridSlice.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/WeatherGridSlice.py @@ -1,3 +1,25 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.slice import AbstractGridSlice @@ -7,7 +29,7 @@ class WeatherGridSlice(AbstractGridSlice): super(WeatherGridSlice, self).__init__() self.weatherGrid = None self.keys = [] - + def getNumPyGrid(self): pass diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/__init__.py index 6109545..77ee2da 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/slice/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'AbstractGridSlice', @@ -12,3 +33,4 @@ from .DiscreteGridSlice import DiscreteGridSlice from .ScalarGridSlice import ScalarGridSlice from .VectorGridSlice import VectorGridSlice from .WeatherGridSlice import WeatherGridSlice + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/svcbu/JobProgress.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/svcbu/JobProgress.py new file mode 100644 index 0000000..a809ced --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/svcbu/JobProgress.py @@ -0,0 +1,37 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 06/22/2015 4573 randerso Initial creation (hand generated) +# 08/27/2015 4812 randerso Change __str__ to return the self.value +# instead of __repr__(self.value) to eliminate +# ''s around string. +# +## + +class JobProgress(object): + def __init__(self): + self.value = None + + def __str__(self): + return self.value diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/svcbu/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/svcbu/__init__.py new file mode 100644 index 0000000..db5cf52 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/svcbu/__init__.py @@ -0,0 +1,33 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 06/22/2015 4573 randerso Initial creation (hand generated) +# +## + +__all__ = [ + 'JobProgress', + ] + +from .JobProgress import JobProgress diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherKey.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherKey.py index bbdbfc3..730dd0e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherKey.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherKey.py @@ -1,8 +1,31 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + + SUBKEY_SEPARATOR = '^' class WeatherKey(object): - # FIXME: Implement WeatherSubKey and use it in this class when needed. + ## FIXME: Implement WeatherSubKey and use it in this class when needed. ## def __init__(self, siteId="", subKeys=[]): self.siteId = siteId @@ -20,16 +43,13 @@ class WeatherKey(object): def __eq__(self, other): if not isinstance(other, WeatherKey): return False - return self.subKeys == self.subKeys + return self.subKeys == other.subKeys def __ne__(self, other): - return not self.__eq__(other) + return (not self.__eq__(other)) def __hash__(self): - prime = 31 - result = 1 - result = prime * result + (0 if self.subKeys is None else hash(self.subKeys)) - return result + return hash(self.subKeys) def getSiteId(self): return self.siteId diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherSubKey.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherSubKey.py index c122883..682f1a8 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherSubKey.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/WeatherSubKey.py @@ -1,6 +1,26 @@ -# TODO: Implement WeatherSubKey when it is explicitly needed. For now -# WeatherSubKeys will be list of str within the WeatherKey class. +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class +## TODO: Implement WeatherSubKey when it is explicitly needed. For now +# WeatherSubKeys will be list of str within the WeatherKey class. class WeatherSubKey(object): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/__init__.py index 3d74183..bdc4d4b 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/weather/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'WeatherKey', @@ -6,3 +27,4 @@ __all__ = [ from .WeatherKey import WeatherKey from .WeatherSubKey import WeatherSubKey + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/__init__.py index ed91455..eaa0c74 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/__init__.py @@ -1,4 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'request' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/DeleteAllGridDataRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/DeleteAllGridDataRequest.py index 6f0f0c7..9c627ea 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/DeleteAllGridDataRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/DeleteAllGridDataRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class DeleteAllGridDataRequest(object): @@ -10,3 +30,4 @@ class DeleteAllGridDataRequest(object): def setModelName(self, modelName): self.modelName = modelName + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/__init__.py index ad09320..8a5ed0f 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/grid/request/__init__.py @@ -1,6 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'DeleteAllGridDataRequest' ] from .DeleteAllGridDataRequest import DeleteAllGridDataRequest + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/Level.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/Level.py index c92c114..594822d 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/Level.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/Level.py @@ -1,63 +1,91 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to add additional features to better +# match Java implementation. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 05/29/13 2023 dgilling Initial Creation. # 02/12/14 2672 bsteffen Allow String constructor to parse floats. # 06/29/15 4480 dgilling Implement __hash__, __eq__, # __str__ and rich comparison operators. +# 02/17/22 8608 mapeters Subclass PersistableDataObject +# # -import re import numpy +import re +from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.persist import PersistableDataObject from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.level import MasterLevel + LEVEL_NAMING_REGEX = re.compile("^(\d*(?:\.\d*)?)(?:_(\d*(?:\.\d*)?))?([a-zA-Z]+)$") INVALID_VALUE = numpy.float64(-999999) - -class Level(object): +class Level(PersistableDataObject): def __init__(self, levelString=None): + super().__init__() self.id = 0 self.identifier = None self.masterLevel = None self.levelonevalue = INVALID_VALUE self.leveltwovalue = INVALID_VALUE - + if levelString is not None: matcher = LEVEL_NAMING_REGEX.match(str(levelString)) if matcher is not None: - self.levelonevalue = numpy.float64(matcher.group(1)) - self.masterLevel = MasterLevel.MasterLevel(matcher.group(3)) - levelTwo = matcher.group(2) - if levelTwo: - self.leveltwovalue = numpy.float64(levelTwo) + self.levelonevalue = numpy.float64(matcher.group(1)) + self.masterLevel = MasterLevel.MasterLevel(matcher.group(3)) + levelTwo = matcher.group(2) + if levelTwo: + self.leveltwovalue = numpy.float64(levelTwo) def __hash__(self): - # XOR-ing the 3 items in a tuple ensures that order of the + # XOR-ing the 3 items in a tuple ensures that order of the # values matters hashCode = hash(self.masterLevel) ^ hash(self.levelonevalue) ^ hash(self.leveltwovalue) hashCode ^= hash((self.masterLevel, self.levelonevalue, self.leveltwovalue)) return hashCode - + def __eq__(self, other): - if isinstance(self, type(other)): + if type(self) != type(other): + return False + else: return (self.masterLevel, self.levelonevalue, self.leveltwovalue) == \ (other.masterLevel, other.levelonevalue, other.leveltwovalue) - return False - + def __ne__(self, other): return not self.__eq__(other) - + def __lt__(self, other): - if not isinstance(self, type(other)): + if type(self) != type(other): return NotImplemented elif self.masterLevel.getName() != other.masterLevel.getName(): return NotImplemented - + myLevel1 = self.levelonevalue myLevel2 = self.leveltwovalue otherLevel1 = other.levelonevalue @@ -68,7 +96,7 @@ class Level(object): if otherLevel1 == INVALID_VALUE and otherLevel2 != INVALID_VALUE: otherLevel1 = otherLevel2 otherLevel2 = INVALID_VALUE - + # We default to descending order to make sorting levels from the DAF easier compareType = self.masterLevel.getType() if self.masterLevel.getType() else "DEC" if myLevel1 != INVALID_VALUE and otherLevel1 != INVALID_VALUE: @@ -80,23 +108,24 @@ class Level(object): elif myLevel2 != INVALID_VALUE: level2Cmp = self.__compareLevelValues(compareType, myLevel2, otherLevel1) return level2Cmp == -1 - return True + else: + return True return False - + def __le__(self, other): - if not isinstance(self, type(other)): - return NotImplemented + if type(self) != type(other): + return NotImplemented elif self.masterLevel.getName() != other.masterLevel.getName(): return NotImplemented - + return self.__lt__(other) or self.__eq__(other) - + def __gt__(self, other): - if not isinstance(self, type(other)): + if type(self) != type(other): return NotImplemented elif self.masterLevel.getName() != other.masterLevel.getName(): return NotImplemented - + myLevel1 = self.levelonevalue myLevel2 = self.leveltwovalue otherLevel1 = other.levelonevalue @@ -119,15 +148,16 @@ class Level(object): elif otherLevel2 != INVALID_VALUE: level2Cmp = self.__compareLevelValues(compareType, myLevel1, otherLevel2) return level2Cmp == 1 - return True + else: + return True return False - + def __ge__(self, other): - if not isinstance(self, type(other)): + if type(self) != type(other): return NotImplemented elif self.masterLevel.getName() != other.masterLevel.getName(): return NotImplemented - + return self.__gt__(other) or self.__eq__(other) def __compareLevelValues(self, compareType, val1, val2): @@ -150,8 +180,8 @@ class Level(object): def getId(self): return self.id - def setId(self, levelid): - self.id = levelid + def setId(self, id): + self.id = id def getMasterLevel(self): return self.masterLevel diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/MasterLevel.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/MasterLevel.py index 2879500..caa50e7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/MasterLevel.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/MasterLevel.py @@ -1,18 +1,44 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to add additional features to better +# match Java implementation. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 05/29/13 2023 dgilling Initial Creation. # 06/29/15 4480 dgilling Implement __hash__, __eq__ # and __str__. +# 02/17/22 8608 mapeters Subclass PersistableDataObject +# +# -import six +from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.persist import PersistableDataObject - -class MasterLevel(object): +class MasterLevel(PersistableDataObject): def __init__(self, name=None): + super().__init__() self.name = name self.description = None self.unitString = None @@ -23,7 +49,7 @@ class MasterLevel(object): return hash(self.name) def __eq__(self, other): - if not isinstance(self, type(other)): + if type(self) != type(other): return False else: return self.name == other.name @@ -32,67 +58,39 @@ class MasterLevel(object): return not self.__eq__(other) def __str__(self): - if six.PY2: - retVal = "MasterLevel[" - retVal += "name=" + str(self.name) + "," - retVal += "type=" + str(self.type) + "," - retVal += "unit=" + str(self.unitString) + "," - retVal += "description=" + str(self.description) - retVal += "]" - else: - retVal = "MasterLevel[" - retVal += "name=" + str(self.name.decode('utf-8')) + "," - retVal += "type=" + str(self.type.decode('utf-8')) + "," - retVal += "unit=" + str(self.unitString.decode('utf-8')) + "," - retVal += "description=" + str(self.description.decode('utf-8')) - retVal += "]" + retVal = "MasterLevel[" + retVal += "name=" + str(self.name) + "," + retVal += "type=" + str(self.type) + "," + retVal += "unit=" + str(self.unitString) + "," + retVal += "description=" + str(self.description) + retVal += "]" return retVal def getName(self): - if six.PY2: - return self.name - if (self.name is not None) and (not isinstance(self.name, str)): - return self.name.decode('utf-8') return self.name def setName(self, name): self.name = name def getDescription(self): - if six.PY2: - return self.description - if self.description is not None: - return self.description.decode('utf-8') return self.description def setDescription(self, description): self.description = description def getUnitString(self): - if six.PY2: - return self.unitString - if self.unitString is not None: - return self.unitString.decode('utf-8') return self.unitString def setUnitString(self, unitString): self.unitString = unitString def getType(self): - if six.PY2: - return self.type - if self.type is not None: - return self.type.decode('utf-8') return self.type - def setType(self, leveltype): - self.type = leveltype + def setType(self, type): + self.type = type def getIdentifier(self): - if six.PY2: - return self.identifier - if self.identifier is not None: - return self.identifier.decode('utf-8') return self.identifier def setIdentifier(self, identifier): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/__init__.py index 61c8dd7..eeab798 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/level/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'Level', @@ -6,3 +27,4 @@ __all__ = [ from .Level import Level from .MasterLevel import MasterLevel + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/DataURINotificationMessage.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/DataURINotificationMessage.py index 872afec..34a07c1 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/DataURINotificationMessage.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/DataURINotificationMessage.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class DataURINotificationMessage(object): @@ -17,3 +37,4 @@ class DataURINotificationMessage(object): def setIds(self, ids): self.ids = ids + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/__init__.py index 8982397..b414b61 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/message/__init__.py @@ -1,6 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'DataURINotificationMessage' ] from .DataURINotificationMessage import DataURINotificationMessage + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/persist/PersistableDataObject.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/persist/PersistableDataObject.py new file mode 100644 index 0000000..650c2b8 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/persist/PersistableDataObject.py @@ -0,0 +1,42 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# Feb 17, 2022 8608 mapeters Generated and made abstract + +import abc + +class PersistableDataObject(abc.ABC): + + @abc.abstractmethod + def __init__(self): + self.traceId = None + + def getTraceId(self): + return self.traceId + + def setTraceId(self, traceId): + self.traceId = traceId + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/persist/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/persist/__init__.py new file mode 100644 index 0000000..0f899e5 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/persist/__init__.py @@ -0,0 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator + +__all__ = [ + 'PersistableDataObject' + ] + +from .PersistableDataObject import PersistableDataObject + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/__init__.py index 87fb079..daea64e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/__init__.py @@ -1,5 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'request', 'response' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/GetRadarDataRecordRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/GetRadarDataRecordRequest.py index 8349d5e..97d5ba6 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/GetRadarDataRecordRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/GetRadarDataRecordRequest.py @@ -1,13 +1,33 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Aug 19, 2014 nabowle Generated import numpy - class GetRadarDataRecordRequest(object): def __init__(self): @@ -39,3 +59,4 @@ class GetRadarDataRecordRequest(object): def setPrimaryElevationAngle(self, primaryElevationAngle): self.primaryElevationAngle = numpy.float64(primaryElevationAngle) + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/__init__.py index 2c5b7f9..5f2847e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/request/__init__.py @@ -1,6 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'GetRadarDataRecordRequest' ] from .GetRadarDataRecordRequest import GetRadarDataRecordRequest + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/GetRadarDataRecordResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/GetRadarDataRecordResponse.py index f6797eb..c5bfd9a 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/GetRadarDataRecordResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/GetRadarDataRecordResponse.py @@ -1,11 +1,31 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Aug 19, 2014 nabowle Generated - class GetRadarDataRecordResponse(object): def __init__(self): @@ -16,3 +36,4 @@ class GetRadarDataRecordResponse(object): def setData(self, data): self.data = data + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/RadarDataRecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/RadarDataRecord.py index ab4e315..c9901f6 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/RadarDataRecord.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/RadarDataRecord.py @@ -1,11 +1,31 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Aug 19, 2014 nabowle Generated - class RadarDataRecord(object): def __init__(self): @@ -65,3 +85,4 @@ class RadarDataRecord(object): def setVolumeCoveragePattern(self, volumeCoveragePattern): self.volumeCoveragePattern = volumeCoveragePattern + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/__init__.py index b024490..0dfb4c6 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/radar/response/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'GetRadarDataRecordResponse', @@ -6,3 +27,4 @@ __all__ = [ from .GetRadarDataRecordResponse import GetRadarDataRecordResponse from .RadarDataRecord import RadarDataRecord + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/__init__.py index 0163bda..31e0691 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/__init__.py @@ -1,5 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'dbsrv', 'subscription' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/TextDBRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/TextDBRequest.py index 2b127cb..cd737c9 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/TextDBRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/TextDBRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class TextDBRequest(object): @@ -10,3 +30,4 @@ class TextDBRequest(object): def setMessage(self, message): self.message = message + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/__init__.py index f3d27aa..b9dcf55 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/dbsrv/__init__.py @@ -1,6 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'TextDBRequest' ] from .TextDBRequest import TextDBRequest + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/__init__.py index ed91455..eaa0c74 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/__init__.py @@ -1,4 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'request' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/SubscriptionRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/SubscriptionRequest.py index 1fe746f..2374727 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/SubscriptionRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/SubscriptionRequest.py @@ -1,11 +1,31 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Sep 05, 2014 bclement Generated - class SubscriptionRequest(object): def __init__(self): @@ -16,3 +36,4 @@ class SubscriptionRequest(object): def setMessage(self, message): self.message = message + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/__init__.py index 2812cb7..a0ad778 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/text/subscription/request/__init__.py @@ -1,6 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'SubscriptionRequest' ] from .SubscriptionRequest import SubscriptionRequest + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/__init__.py index ccf9030..d9702fd 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/__init__.py @@ -1,4 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'requests' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/RequestConstraint.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/RequestConstraint.py index c6558f2..be67109 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/RequestConstraint.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/RequestConstraint.py @@ -1,3 +1,23 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + # # SOFTWARE HISTORY # @@ -6,13 +26,12 @@ # Jun 01, 2016 5574 tgurney Initial creation # Jun 27, 2016 5725 tgurney Add NOT IN # Jul 22, 2016 2416 tgurney Add evaluate() -# Oct 05, 2018 mjames@ucar Python 3 types +# Jun 26, 2019 7888 tgurney Python 3 fixes # # import re -import six -from dynamicserialize.dstypes.com.raytheon.uf.common.time import DataTime +from ...time import DataTime class RequestConstraint(object): @@ -81,7 +100,7 @@ class RequestConstraint(object): """Make a pattern using % wildcard into a regex""" pattern = re.escape(pattern) pattern = pattern.replace('\\%', '.*') - pattern = pattern.replace('\\_', '.') + pattern = pattern.replace('_', '.') pattern = pattern + '$' return re.compile(pattern, flags) @@ -113,33 +132,35 @@ class RequestConstraint(object): self._evalValue = self._adjustValueType(self.constraintValue) def _adjustValueType(self, value): - """ + ''' Try to take part of a constraint value, encoded as a string, and return it as its 'true type'. _adjustValueType('3.0') -> 3.0 _adjustValueType('3') -> 3.0 _adjustValueType('a string') -> 'a string' - """ + ''' try: return float(value) - except ValueError: + except Exception: pass try: return DataTime(value) - except ValueError: + except Exception: pass return value def _matchType(self, value, otherValue): - """ + ''' Return value coerced to be the same type as otherValue. If this is not possible, just return value unmodified. - """ + ''' + # cannot use type() because otherValue might be an instance of an + # old-style class (then it would just be of type "instance") if not isinstance(value, otherValue.__class__): try: return otherValue.__class__(value) - except ValueError: + except Exception: pass return value @@ -147,7 +168,8 @@ class RequestConstraint(object): value = self._matchType(value, self._evalValue) if isinstance(value, float): return abs(float(self._evalValue) - value) < self.TOLERANCE - return value == self._evalValue + else: + return value == self._evalValue def _evalGreaterThan(self, value): value = self._matchType(value, self._evalValue) @@ -167,7 +189,7 @@ class RequestConstraint(object): def _evalBetween(self, value): value = self._matchType(value, self._evalValue[0]) - return self._evalValue[0] <= value <= self._evalValue[1] + return value >= self._evalValue[0] and value <= self._evalValue[1] def _evalIn(self, value): anEvalValue = next(iter(self._evalValue)) @@ -176,11 +198,12 @@ class RequestConstraint(object): try: if abs(otherValue - float(value)) < self.TOLERANCE: return True - except ValueError: + except Exception: pass return False - value = self._matchType(value, anEvalValue) - return value in self._evalValue + else: + value = self._matchType(value, anEvalValue) + return value in self._evalValue def _evalLike(self, value): value = self._matchType(value, self._evalValue) @@ -189,7 +212,7 @@ class RequestConstraint(object): return self._evalValue.match(value) is not None def _evalIsNull(self, value): - return value is None or value == 'null' + return value is None or 'null' == value # DAF-specific stuff begins here ########################################## @@ -205,24 +228,18 @@ class RequestConstraint(object): @staticmethod def _stringify(value): - if six.PY2: - if isinstance(value, (str, int, long, bool, float, unicode)): - return str(value) - else: - # Collections are not allowed; they are handled separately. - # Arbitrary objects are not allowed because the string - # representation may not be sufficient to reconstruct the object. - raise TypeError('Constraint values of type ' + repr(type(value)) + - 'are not allowed') + if type(value) in {int, bool, float}: + return str(value) + elif type(value) is str: + return value + elif type(value) is bytes: + return value.decode() else: - if isinstance(value, (str, int, bool, float)): - return str(value) - else: - # Collections are not allowed; they are handled separately. - # Arbitrary objects are not allowed because the string - # representation may not be sufficient to reconstruct the object. - raise TypeError('Constraint values of type ' + repr(type(value)) + - 'are not allowed') + # Collections are not allowed; they are handled separately. + # Arbitrary objects are not allowed because the string + # representation may not be sufficient to reconstruct the object. + raise TypeError('Constraint values of type ' + repr(type(value)) + + 'are not allowed') @classmethod def _constructIn(cls, constraintType, constraintValue): @@ -232,7 +249,7 @@ class RequestConstraint(object): except TypeError: raise TypeError("value for IN / NOT IN constraint must be an iterable") stringValue = ', '.join(cls._stringify(item) for item in iterator) - if not stringValue: + if len(stringValue) == 0: raise ValueError('cannot use IN / NOT IN with empty collection') obj = cls() obj.setConstraintType(constraintType) @@ -268,12 +285,14 @@ class RequestConstraint(object): """Build a new RequestConstraint.""" try: constraintType = cls.CONSTRAINT_MAP[operator.upper()] - except KeyError: + except (KeyError, AttributeError) as e: errmsg = '{} is not a valid operator. Valid operators are: {}' validOperators = list(sorted(cls.CONSTRAINT_MAP.keys())) - raise ValueError(errmsg.format(operator, validOperators)) + raise ValueError(errmsg.format(operator, validOperators)) from e if constraintType in ('IN', 'NOT_IN'): return cls._constructIn(constraintType, constraintValue) elif constraintType in {'EQUALS', 'NOT_EQUALS'}: return cls._constructEq(constraintType, constraintValue) - return cls._construct(constraintType, constraintValue) + else: + return cls._construct(constraintType, constraintValue) + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/__init__.py index 6c79752..c9bcf80 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/dataquery/requests/__init__.py @@ -1,6 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'RequestConstraint' ] from .RequestConstraint import RequestConstraint + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/Request.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/Request.py index f975420..52f5c6b 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/Request.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/Request.py @@ -1,4 +1,22 @@ +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# File auto-generated against equivalent DynamicSerialize Java class class Request(object): @@ -36,5 +54,6 @@ class Request(object): def getType(self): return self.type - def setType(self, requesttype): - self.type = requesttype + def setType(self, type): + self.type = type + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageProperties.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageProperties.py index 9cd9c0e..ed986b6 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageProperties.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageProperties.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class StorageProperties(object): @@ -17,3 +37,4 @@ class StorageProperties(object): def setChunked(self, chunked): self.chunked = chunked + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageStatus.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageStatus.py index 4e97635..797553c 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageStatus.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/StorageStatus.py @@ -1,4 +1,22 @@ +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# File auto-generated against equivalent DynamicSerialize Java class class StorageStatus(object): @@ -17,3 +35,4 @@ class StorageStatus(object): def setIndexOfAppend(self, indexOfAppend): self.indexOfAppend = indexOfAppend + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/__init__.py index be939ee..5aae752 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/__init__.py @@ -1,20 +1,44 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Package definition for com.raytheon.uf.common.datastorage -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 08/31/10 njensen Initial Creation. +# +# # -__all__ = [ - 'records', - 'Request', - 'StorageProperties', - 'StorageStatus' - ] + +__all__ = [ + 'records', + 'Request', + 'StorageProperties', + 'StorageStatus', + ] from .Request import Request from .StorageProperties import StorageProperties diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/ByteDataRecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/ByteDataRecord.py index 0621c22..2bcaba2 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/ByteDataRecord.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/ByteDataRecord.py @@ -1,11 +1,38 @@ -from dynamicserialize.dstypes.com.raytheon.uf.common.datastorage.records import AbstractDataRecord +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified by njensen -class ByteDataRecord(AbstractDataRecord): +class ByteDataRecord(object): def __init__(self): - super(ByteDataRecord, self).__init__() self.byteData = None + self.name = None + self.dimension = None + self.sizes = None + self.maxSizes = None + self.props = None + self.minIndex = None + self.group = None + self.dataAttributes = None + self.fillValue = None + self.maxChunkSize = None def getByteData(self): return self.byteData @@ -13,8 +40,69 @@ class ByteDataRecord(AbstractDataRecord): def setByteData(self, byteData): self.byteData = byteData + def getName(self): + return self.name + + def setName(self, name): + self.name = name + + def getDimension(self): + return self.dimension + + def setDimension(self, dimension): + self.dimension = dimension + + def getSizes(self): + return self.sizes + + def setSizes(self, sizes): + self.sizes = sizes + + def getMaxSizes(self): + return self.maxSizes + + def setMaxSizes(self, maxSizes): + self.maxSizes = maxSizes + + def getProps(self): + return self.props + + def setProps(self, props): + self.props = props + + def getMinIndex(self): + return self.minIndex + + def setMinIndex(self, minIndex): + self.minIndex = minIndex + + def getGroup(self): + return self.group + + def setGroup(self, group): + self.group = group + + def getDataAttributes(self): + return self.dataAttributes + + def setDataAttributes(self, dataAttributes): + self.dataAttributes = dataAttributes + + def getFillValue(self): + return self.fillValue + + def setFillValue(self, fillValue): + self.fillValue = fillValue + + def getMaxChunkSize(self): + return self.maxChunkSize + + def setMaxChunkSize(self, maxChunkSize): + self.maxChunkSize = maxChunkSize + def retrieveDataObject(self): return self.getByteData() - + def putDataObject(self, obj): self.setByteData(obj) + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/DataUriMetadataIdentifier.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/DataUriMetadataIdentifier.py new file mode 100644 index 0000000..6dbd9a0 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/DataUriMetadataIdentifier.py @@ -0,0 +1,48 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified by mapeters + +class DataUriMetadataIdentifier(object): + + def __init__(self): + self.traceId = None + self.dataUri = None + self.specificity = 'GROUP' + + def getTraceId(self): + return self.traceId + + def setTraceId(self, traceId): + self.traceId = traceId + + def getDataUri(self): + return self.dataUri + + def setDataUri(self, dataUri): + self.dataUri = dataUri + + def getSpecificity(self): + return self.specificity + + def setSpecificity(self, specificity): + self.specificity = specificity + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/DoubleDataRecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/DoubleDataRecord.py index 368226e..b68211f 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/DoubleDataRecord.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/DoubleDataRecord.py @@ -1,11 +1,101 @@ -from dynamicserialize.dstypes.com.raytheon.uf.common.datastorage.records import AbstractDataRecord +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class and +# modified. +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# Sep 8, 2014 kustert Initial Creation +# Apr 24, 2015 4425 nabowle Bring in. -class DoubleDataRecord(AbstractDataRecord): +class DoubleDataRecord(object): def __init__(self): - super(DoubleDataRecord, self).__init__() + self.sizes = None + self.dimension = None + self.maxChunkSize = None + self.name = None + self.fillValue = None + self.dataAttributes = None + self.group = None + self.minIndex = None + self.props = None self.doubleData = None + self.maxSizes = None + + def getSizes(self): + return self.sizes + + def setSizes(self, sizes): + self.sizes = sizes + + def getDimension(self): + return self.dimension + + def setDimension(self, dimension): + self.dimension = dimension + + def getMaxChunkSize(self): + return self.maxChunkSize + + def setMaxChunkSize(self, maxChunkSize): + self.maxChunkSize = maxChunkSize + + def getName(self): + return self.name + + def setName(self, name): + self.name = name + + def getFillValue(self): + return self.fillValue + + def setFillValue(self, fillValue): + self.fillValue = fillValue + + def getDataAttributes(self): + return self.dataAttributes + + def setDataAttributes(self, dataAttributes): + self.dataAttributes = dataAttributes + + def getGroup(self): + return self.group + + def setGroup(self, group): + self.group = group + + def getMinIndex(self): + return self.minIndex + + def setMinIndex(self, minIndex): + self.minIndex = minIndex + + def getProps(self): + return self.props + + def setProps(self, props): + self.props = props def getDoubleData(self): return self.doubleData @@ -13,8 +103,14 @@ class DoubleDataRecord(AbstractDataRecord): def setDoubleData(self, doubleData): self.doubleData = doubleData + def getMaxSizes(self): + return self.maxSizes + + def setMaxSizes(self, maxSizes): + self.maxSizes = maxSizes + def retrieveDataObject(self): return self.getDoubleData() def putDataObject(self, obj): - self.setDoubleData(obj) + self.setDoubleData(obj) diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/FloatDataRecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/FloatDataRecord.py index 8e4d029..b9420fc 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/FloatDataRecord.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/FloatDataRecord.py @@ -1,11 +1,38 @@ -from dynamicserialize.dstypes.com.raytheon.uf.common.datastorage.records import AbstractDataRecord +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified by njensen -class FloatDataRecord(AbstractDataRecord): +class FloatDataRecord(object): def __init__(self): - super(FloatDataRecord, self).__init__() self.floatData = None + self.name = None + self.dimension = None + self.sizes = None + self.maxSizes = None + self.props = None + self.minIndex = None + self.group = None + self.dataAttributes = None + self.fillValue = None + self.maxChunkSize = None def getFloatData(self): return self.floatData @@ -13,8 +40,69 @@ class FloatDataRecord(AbstractDataRecord): def setFloatData(self, floatData): self.floatData = floatData + def getName(self): + return self.name + + def setName(self, name): + self.name = name + + def getDimension(self): + return self.dimension + + def setDimension(self, dimension): + self.dimension = dimension + + def getSizes(self): + return self.sizes + + def setSizes(self, sizes): + self.sizes = sizes + + def getMaxSizes(self): + return self.maxSizes + + def setMaxSizes(self, maxSizes): + self.maxSizes = maxSizes + + def getProps(self): + return self.props + + def setProps(self, props): + self.props = props + + def getMinIndex(self): + return self.minIndex + + def setMinIndex(self, minIndex): + self.minIndex = minIndex + + def getGroup(self): + return self.group + + def setGroup(self, group): + self.group = group + + def getDataAttributes(self): + return self.dataAttributes + + def setDataAttributes(self, dataAttributes): + self.dataAttributes = dataAttributes + + def getFillValue(self): + return self.fillValue + + def setFillValue(self, fillValue): + self.fillValue = fillValue + + def getMaxChunkSize(self): + return self.maxChunkSize + + def setMaxChunkSize(self, maxChunkSize): + self.maxChunkSize = maxChunkSize + def retrieveDataObject(self): return self.getFloatData() - + def putDataObject(self, obj): self.setFloatData(obj) + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/IntegerDataRecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/IntegerDataRecord.py index ec63a28..a8d2fd2 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/IntegerDataRecord.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/IntegerDataRecord.py @@ -1,11 +1,38 @@ -from dynamicserialize.dstypes.com.raytheon.uf.common.datastorage.records import AbstractDataRecord +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified by njensen -class IntegerDataRecord(AbstractDataRecord): +class IntegerDataRecord(object): def __init__(self): - super(IntegerDataRecord, self).__init__() self.intData = None + self.name = None + self.dimension = None + self.sizes = None + self.maxSizes = None + self.props = None + self.minIndex = None + self.group = None + self.dataAttributes = None + self.fillValue = None + self.maxChunkSize = None def getIntData(self): return self.intData @@ -13,6 +40,66 @@ class IntegerDataRecord(AbstractDataRecord): def setIntData(self, intData): self.intData = intData + def getName(self): + return self.name + + def setName(self, name): + self.name = name + + def getDimension(self): + return self.dimension + + def setDimension(self, dimension): + self.dimension = dimension + + def getSizes(self): + return self.sizes + + def setSizes(self, sizes): + self.sizes = sizes + + def getMaxSizes(self): + return self.maxSizes + + def setMaxSizes(self, maxSizes): + self.maxSizes = maxSizes + + def getProps(self): + return self.props + + def setProps(self, props): + self.props = props + + def getMinIndex(self): + return self.minIndex + + def setMinIndex(self, minIndex): + self.minIndex = minIndex + + def getGroup(self): + return self.group + + def setGroup(self, group): + self.group = group + + def getDataAttributes(self): + return self.dataAttributes + + def setDataAttributes(self, dataAttributes): + self.dataAttributes = dataAttributes + + def getFillValue(self): + return self.fillValue + + def setFillValue(self, fillValue): + self.fillValue = fillValue + + def getMaxChunkSize(self): + return self.maxChunkSize + + def setMaxChunkSize(self, maxChunkSize): + self.maxChunkSize = maxChunkSize + def retrieveDataObject(self): return self.getIntData() diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/LongDataRecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/LongDataRecord.py index 5fec3d9..490074e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/LongDataRecord.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/LongDataRecord.py @@ -1,11 +1,38 @@ -from dynamicserialize.dstypes.com.raytheon.uf.common.datastorage.records import AbstractDataRecord +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified by njensen -class LongDataRecord(AbstractDataRecord): +class LongDataRecord(object): def __init__(self): - super(LongDataRecord, self).__init__() self.longData = None + self.name = None + self.dimension = None + self.sizes = None + self.maxSizes = None + self.props = None + self.minIndex = None + self.group = None + self.dataAttributes = None + self.fillValue = None + self.maxChunkSize = None def getLongData(self): return self.longData @@ -13,8 +40,69 @@ class LongDataRecord(AbstractDataRecord): def setLongData(self, longData): self.longData = longData + def getName(self): + return self.name + + def setName(self, name): + self.name = name + + def getDimension(self): + return self.dimension + + def setDimension(self, dimension): + self.dimension = dimension + + def getSizes(self): + return self.sizes + + def setSizes(self, sizes): + self.sizes = sizes + + def getMaxSizes(self): + return self.maxSizes + + def setMaxSizes(self, maxSizes): + self.maxSizes = maxSizes + + def getProps(self): + return self.props + + def setProps(self, props): + self.props = props + + def getMinIndex(self): + return self.minIndex + + def setMinIndex(self, minIndex): + self.minIndex = minIndex + + def getGroup(self): + return self.group + + def setGroup(self, group): + self.group = group + + def getDataAttributes(self): + return self.dataAttributes + + def setDataAttributes(self, dataAttributes): + self.dataAttributes = dataAttributes + + def getFillValue(self): + return self.fillValue + + def setFillValue(self, fillValue): + self.fillValue = fillValue + + def getMaxChunkSize(self): + return self.maxChunkSize + + def setMaxChunkSize(self, maxChunkSize): + self.maxChunkSize = maxChunkSize + def retrieveDataObject(self): return self.getLongData() def putDataObject(self, obj): self.setLongData(obj) + \ No newline at end of file diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/NoMetadataIdentifier.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/NoMetadataIdentifier.py new file mode 100644 index 0000000..24843c9 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/NoMetadataIdentifier.py @@ -0,0 +1,40 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# Sep 23, 2021 8608 mapeters Generated and slightly modified +# Feb 17, 2022 8608 mapeters Removed writeBehindSupported, metadataUsed +# + +class NoMetadataIdentifier(object): + + def __init__(self): + self.traceId = None + + def getTraceId(self): + return self.traceId + + def setTraceId(self, traceId): + self.traceId = traceId diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/RecordAndMetadata.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/RecordAndMetadata.py new file mode 100644 index 0000000..1b012a2 --- /dev/null +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/RecordAndMetadata.py @@ -0,0 +1,47 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# Sep 23, 2021 8608 mapeters Generated +# + +class RecordAndMetadata(object): + + def __init__(self): + self.metadata = None + self.record = None + + def getMetadata(self): + return self.metadata + + def setMetadata(self, metadata): + self.metadata = metadata + + def getRecord(self): + return self.record + + def setRecord(self, record): + self.record = record + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/ShortDataRecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/ShortDataRecord.py index be53273..eaf5b82 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/ShortDataRecord.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/ShortDataRecord.py @@ -1,11 +1,38 @@ -from dynamicserialize.dstypes.com.raytheon.uf.common.datastorage.records import AbstractDataRecord +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified by njensen -class ShortDataRecord(AbstractDataRecord): +class ShortDataRecord(object): def __init__(self): - super(ShortDataRecord, self).__init__() self.shortData = None + self.name = None + self.dimension = None + self.sizes = None + self.maxSizes = None + self.props = None + self.minIndex = None + self.group = None + self.dataAttributes = None + self.fillValue = None + self.maxChunkSize = None def getShortData(self): return self.shortData @@ -13,8 +40,68 @@ class ShortDataRecord(AbstractDataRecord): def setShortData(self, shortData): self.shortData = shortData + def getName(self): + return self.name + + def setName(self, name): + self.name = name + + def getDimension(self): + return self.dimension + + def setDimension(self, dimension): + self.dimension = dimension + + def getSizes(self): + return self.sizes + + def setSizes(self, sizes): + self.sizes = sizes + + def getMaxSizes(self): + return self.maxSizes + + def setMaxSizes(self, maxSizes): + self.maxSizes = maxSizes + + def getProps(self): + return self.props + + def setProps(self, props): + self.props = props + + def getMinIndex(self): + return self.minIndex + + def setMinIndex(self, minIndex): + self.minIndex = minIndex + + def getGroup(self): + return self.group + + def setGroup(self, group): + self.group = group + + def getDataAttributes(self): + return self.dataAttributes + + def setDataAttributes(self, dataAttributes): + self.dataAttributes = dataAttributes + + def getFillValue(self): + return self.fillValue + + def setFillValue(self, fillValue): + self.fillValue = fillValue + + def getMaxChunkSize(self): + return self.maxChunkSize + + def setMaxChunkSize(self, maxChunkSize): + self.maxChunkSize = maxChunkSize + def retrieveDataObject(self): return self.getShortData() def putDataObject(self, obj): - self.setShortData(obj) + self.setShortData(obj) \ No newline at end of file diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/StringDataRecord.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/StringDataRecord.py index 86d0a5e..5364308 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/StringDataRecord.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/StringDataRecord.py @@ -1,12 +1,39 @@ -from dynamicserialize.dstypes.com.raytheon.uf.common.datastorage.records import AbstractDataRecord +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified by njensen -class StringDataRecord(AbstractDataRecord): +class StringDataRecord(object): def __init__(self): - super(StringDataRecord, self).__init__() self.stringData = None self.maxLength = None + self.name = None + self.dimension = None + self.sizes = None + self.maxSizes = None + self.props = None + self.minIndex = None + self.group = None + self.dataAttributes = None + self.fillValue = None + self.maxChunkSize = None self.numpyData = None def getStringData(self): @@ -21,17 +48,78 @@ class StringDataRecord(AbstractDataRecord): def setMaxLength(self, maxLength): self.maxLength = maxLength + def getName(self): + return self.name + + def setName(self, name): + self.name = name + + def getDimension(self): + return self.dimension + + def setDimension(self, dimension): + self.dimension = dimension + + def getSizes(self): + return self.sizes + + def setSizes(self, sizes): + self.sizes = sizes + + def getMaxSizes(self): + return self.maxSizes + + def setMaxSizes(self, maxSizes): + self.maxSizes = maxSizes + + def getProps(self): + return self.props + + def setProps(self, props): + self.props = props + + def getMinIndex(self): + return self.minIndex + + def setMinIndex(self, minIndex): + self.minIndex = minIndex + + def getGroup(self): + return self.group + + def setGroup(self, group): + self.group = group + + def getDataAttributes(self): + return self.dataAttributes + + def setDataAttributes(self, dataAttributes): + self.dataAttributes = dataAttributes + + def getFillValue(self): + return self.fillValue + + def setFillValue(self, fillValue): + self.fillValue = fillValue + + def getMaxChunkSize(self): + return self.maxChunkSize + + def setMaxChunkSize(self, maxChunkSize): + self.maxChunkSize = maxChunkSize + def retrieveDataObject(self): - if not self.numpyData: + if not self.numpyData: import numpy from h5py import h5t - if self.maxLength: + if self.maxLength: dtype = h5t.py_create('S' + str(self.maxLength)) else: from pypies.impl.H5pyDataStore import vlen_str_type as dtype - # dtype.set_strpad(h5t.STR_NULLTERM) - return numpy.asarray(self.getStringData(), dtype) - return self.numpyData + #dtype.set_strpad(h5t.STR_NULLTERM) + numpyData = numpy.asarray(self.getStringData(), dtype) + return numpyData def putDataObject(self, obj): self.setStringData(obj) + \ No newline at end of file diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/__init__.py index 1978888..39e0d7d 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/datastorage/records/__init__.py @@ -1,3 +1,23 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + # # Package definition for com.raytheon.uf.common.datastorage.records # @@ -8,24 +28,32 @@ # ------------ ---------- ----------- -------------------------- # 08/31/10 njensen Initial Creation. # Apr 24, 2015 4425 nabowle Add DoubleDataRecord +# Sep 28, 2021 8608 mapeters Add metadata classes +# +# # __all__ = [ - 'AbstractDataRecord', 'ByteDataRecord', + 'DataUriMetadataIdentifier', 'DoubleDataRecord', 'FloatDataRecord', 'IntegerDataRecord', 'LongDataRecord', + 'NoMetadataIdentifier', + 'RecordAndMetadata', 'ShortDataRecord', 'StringDataRecord' ] -from .AbstractDataRecord import AbstractDataRecord from .ByteDataRecord import ByteDataRecord +from .DataUriMetadataIdentifier import DataUriMetadataIdentifier from .DoubleDataRecord import DoubleDataRecord from .FloatDataRecord import FloatDataRecord from .IntegerDataRecord import IntegerDataRecord from .LongDataRecord import LongDataRecord +from .NoMetadataIdentifier import NoMetadataIdentifier +from .RecordAndMetadata import RecordAndMetadata from .ShortDataRecord import ShortDataRecord from .StringDataRecord import StringDataRecord + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationContext.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationContext.py index c0ce181..cd32b9c 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationContext.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationContext.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class LocalizationContext(object): @@ -24,12 +44,13 @@ class LocalizationContext(object): def setContextName(self, contextName): self.contextName = contextName - + def __str__(self): return self.__repr__() - + def __repr__(self): delimitedString = str(self.localizationType).lower() + "." + str(self.localizationLevel).lower() if self.contextName is not None and self.contextName != "": delimitedString += "." + self.contextName return delimitedString + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationLevel.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationLevel.py index e791020..e826a76 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationLevel.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationLevel.py @@ -1,11 +1,43 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## -knownLevels = { - "BASE": {"text": "BASE", "order": 0, "systemLevel": True}, - "CONFIGURED": {"text": "CONFIGURED", "order": 250, "systemLevel": True}, - "SITE": {"text": "SITE", "order": 500, "systemLevel": False}, - "USER": {"text": "USER", "order": 1000, "systemLevel": False}, - "UNKNOWN": {"text": "UNKNOWN", "order": -1} -} +knownLevels = {"BASE": {"text" : "BASE", + "order" : 0, + "systemLevel" : True, + }, + "CONFIGURED": {"text" : "CONFIGURED", + "order" : 250, + "systemLevel" : True, + }, + "SITE": {"text" : "SITE", + "order" : 500, + "systemLevel" : False, + }, + "USER": {"text" : "USER", + "order" : 1000, + "systemLevel" : False, + }, + "UNKNOWN": {"text" : "UNKNOWN", + "order" : -1, + } + } class LocalizationLevel(object): @@ -31,12 +63,13 @@ class LocalizationLevel(object): def setOrder(self, order): self.order = int(order) - + def isSystemLevel(self): return self.systemLevel - + def __str__(self): return self.__repr__() - + def __repr__(self): return str(self.text) + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationType.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationType.py index d24decd..35282c7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationType.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/LocalizationType.py @@ -1,18 +1,37 @@ - +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## class LocalizationType(object): def __init__(self, text=None): self.text = text - + def __str__(self): return self.__repr__() - + def __repr__(self): return str(self.text) - + def getText(self): return self.text def setText(self, text): self.text = text + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/__init__.py index d8e1699..a8e4c3d 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/__init__.py @@ -1,12 +1,34 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ - 'msgs', - 'stream', 'LocalizationContext', 'LocalizationLevel', - 'LocalizationType' + 'LocalizationType', + 'msgs', + 'stream' ] from .LocalizationContext import LocalizationContext from .LocalizationLevel import LocalizationLevel from .LocalizationType import LocalizationType + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/DeleteUtilityCommand.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/DeleteUtilityCommand.py index 807eee6..236a8e2 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/DeleteUtilityCommand.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/DeleteUtilityCommand.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class DeleteUtilityCommand(object): @@ -18,9 +38,10 @@ class DeleteUtilityCommand(object): def setContext(self, context): self.context = context - + def getMyContextName(self): return self.myContextName def setMyContextName(self, contextName): self.myContextName = str(contextName) + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/DeleteUtilityResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/DeleteUtilityResponse.py index c86ea04..8eecbcd 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/DeleteUtilityResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/DeleteUtilityResponse.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class DeleteUtilityResponse(object): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListResponseEntry.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListResponseEntry.py index 906be7d..f18051a 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListResponseEntry.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListResponseEntry.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class ListResponseEntry(object): @@ -55,6 +75,7 @@ class ListResponseEntry(object): def setExistsOnServer(self, existsOnServer): self.existsOnServer = existsOnServer - + def __str__(self): return self.fileName + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListUtilityCommand.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListUtilityCommand.py index 1219cc2..777aa63 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListUtilityCommand.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListUtilityCommand.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class ListUtilityCommand(object): @@ -38,3 +58,4 @@ class ListUtilityCommand(object): def setContext(self, context): self.context = context + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListUtilityResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListUtilityResponse.py index 58cf158..af68733 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListUtilityResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/ListUtilityResponse.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class ListUtilityResponse(object): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/PrivilegedUtilityRequestMessage.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/PrivilegedUtilityRequestMessage.py index 9fb8604..7fb3f70 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/PrivilegedUtilityRequestMessage.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/PrivilegedUtilityRequestMessage.py @@ -1,5 +1,26 @@ -from dynamicserialize.dstypes.com.raytheon.uf.common.auth.user import User +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class + +from dynamicserialize.dstypes.com.raytheon.uf.common.auth.user import User class PrivilegedUtilityRequestMessage(object): @@ -18,3 +39,4 @@ class PrivilegedUtilityRequestMessage(object): def setUser(self, user): self.user = user + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityRequestMessage.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityRequestMessage.py index 606dd10..a62fa65 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityRequestMessage.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityRequestMessage.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class UtilityRequestMessage(object): @@ -10,3 +30,4 @@ class UtilityRequestMessage(object): def setCommands(self, commands): self.commands = commands + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityResponseMessage.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityResponseMessage.py index 65be40f..6d20f57 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityResponseMessage.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/UtilityResponseMessage.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class UtilityResponseMessage(object): @@ -10,3 +30,4 @@ class UtilityResponseMessage(object): def setResponses(self, responses): self.responses = responses + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/__init__.py index 2d9f587..10cd93c 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/msgs/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'DeleteUtilityCommand', @@ -18,3 +39,4 @@ from .ListUtilityResponse import ListUtilityResponse from .PrivilegedUtilityRequestMessage import PrivilegedUtilityRequestMessage from .UtilityRequestMessage import UtilityRequestMessage from .UtilityResponseMessage import UtilityResponseMessage + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/AbstractLocalizationStreamRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/AbstractLocalizationStreamRequest.py index 8fff94e..a02a590 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/AbstractLocalizationStreamRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/AbstractLocalizationStreamRequest.py @@ -1,10 +1,30 @@ -from six import with_metaclass +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + import abc import os from dynamicserialize.dstypes.com.raytheon.uf.common.auth.user import User - -class AbstractLocalizationStreamRequest(with_metaclass(abc.ABCMeta, object)): +class AbstractLocalizationStreamRequest(object, metaclass=abc.ABCMeta): @abc.abstractmethod def __init__(self): self.context = None @@ -23,9 +43,9 @@ class AbstractLocalizationStreamRequest(with_metaclass(abc.ABCMeta, object)): def setFileName(self, fileName): if fileName[0] == os.sep: - fileName = fileName[1:] + fileName = fileName[1:] self.fileName = fileName - + def getMyContextName(self): return self.myContextName @@ -37,3 +57,4 @@ class AbstractLocalizationStreamRequest(with_metaclass(abc.ABCMeta, object)): def setUser(self, user): self.user = user + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamGetRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamGetRequest.py index c1479f7..001f101 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamGetRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamGetRequest.py @@ -1,5 +1,28 @@ -from dynamicserialize.dstypes.com.raytheon.uf.common.localization.stream import AbstractLocalizationStreamRequest +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class + +import os +from dynamicserialize.dstypes.com.raytheon.uf.common.localization.stream import AbstractLocalizationStreamRequest +from dynamicserialize.dstypes.com.raytheon.uf.common.auth.user import User class LocalizationStreamGetRequest(AbstractLocalizationStreamRequest): @@ -19,3 +42,4 @@ class LocalizationStreamGetRequest(AbstractLocalizationStreamRequest): def setNumBytes(self, numBytes): self.numBytes = numBytes + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamPutRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamPutRequest.py index f46ec7d..9b9286c 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamPutRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/LocalizationStreamPutRequest.py @@ -1,6 +1,29 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class + +import os import uuid from dynamicserialize.dstypes.com.raytheon.uf.common.localization.stream import AbstractLocalizationStreamRequest +from dynamicserialize.dstypes.com.raytheon.uf.common.auth.user import User class LocalizationStreamPutRequest(AbstractLocalizationStreamRequest): @@ -16,14 +39,14 @@ class LocalizationStreamPutRequest(AbstractLocalizationStreamRequest): def getId(self): return self.id - def setId(self, requestid): - self.id = requestid + def setId(self, id): + self.id = id def getBytes(self): return self.bytes - def setBytes(self, streambytes): - self.bytes = streambytes + def setBytes(self, bytes): + self.bytes = bytes def getEnd(self): return self.end @@ -42,3 +65,4 @@ class LocalizationStreamPutRequest(AbstractLocalizationStreamRequest): def setLocalizedSite(self, localizedSite): self.localizedSite = localizedSite + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/__init__.py index 61fefc3..fbdfa7e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/localization/stream/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'AbstractLocalizationStreamRequest', @@ -8,3 +29,4 @@ __all__ = [ from .AbstractLocalizationStreamRequest import AbstractLocalizationStreamRequest from .LocalizationStreamGetRequest import LocalizationStreamGetRequest from .LocalizationStreamPutRequest import LocalizationStreamPutRequest + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/__init__.py index 87fb079..daea64e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/__init__.py @@ -1,5 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'request', 'response' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/ChangeContextRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/ChangeContextRequest.py index 675429d..a0485e7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/ChangeContextRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/ChangeContextRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class ChangeContextRequest(object): @@ -17,3 +37,4 @@ class ChangeContextRequest(object): def setContextName(self, contextName): self.contextName = contextName + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/PassThroughRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/PassThroughRequest.py index 0913594..ca444ba 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/PassThroughRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/PassThroughRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class PassThroughRequest(object): @@ -24,3 +44,4 @@ class PassThroughRequest(object): def setJvmName(self, jvmName): self.jvmName = jvmName + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/__init__.py index 8bf2c4d..251d61c 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/__init__.py @@ -1,9 +1,31 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ - 'diagnostic', 'ChangeContextRequest', - 'PassThroughRequest' + 'PassThroughRequest', + 'diagnostic' ] from .ChangeContextRequest import ChangeContextRequest from .PassThroughRequest import PassThroughRequest + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/GetClusterMembersRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/GetClusterMembersRequest.py index bed8155..0844daf 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/GetClusterMembersRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/GetClusterMembersRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GetClusterMembersRequest(object): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/GetContextsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/GetContextsRequest.py index be04a3a..06a89ac 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/GetContextsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/GetContextsRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GetContextsRequest(object): @@ -10,3 +30,4 @@ class GetContextsRequest(object): def setContextState(self, contextState): self.contextState = contextState + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/StatusRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/StatusRequest.py index 72f5165..03a06fb 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/StatusRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/StatusRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class StatusRequest(object): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/__init__.py index dfa38a7..ff239d1 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/request/diagnostic/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'GetClusterMembersRequest', @@ -8,3 +29,4 @@ __all__ = [ from .GetClusterMembersRequest import GetClusterMembersRequest from .GetContextsRequest import GetContextsRequest from .StatusRequest import StatusRequest + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/__init__.py index 5881904..a43d147 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/__init__.py @@ -1,4 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'diagnostic' ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ClusterMembersResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ClusterMembersResponse.py index 4243ed4..7966a2d 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ClusterMembersResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ClusterMembersResponse.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class ClusterMembersResponse(object): @@ -10,9 +30,10 @@ class ClusterMembersResponse(object): def setStatus(self, status): self.status = status - + def __repr__(self): msg = '' for x in self.status: msg += str(x) + '\n' return msg + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ContextsResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ContextsResponse.py index 2aed7fa..ef011e8 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ContextsResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/ContextsResponse.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class ContextsResponse(object): @@ -17,6 +37,7 @@ class ContextsResponse(object): def setContexts(self, contexts): self.contexts = contexts - + def __repr__(self): return str(self.contexts) + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/StatusResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/StatusResponse.py index 5f9649b..c3844b9 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/StatusResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/StatusResponse.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class StatusResponse(object): @@ -24,6 +44,7 @@ class StatusResponse(object): def setStatistics(self, statistics): self.statistics = statistics - + def __repr__(self): return self.hostname + ':' + self.jvmName + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/__init__.py index 1cc4ead..689b2f7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/management/response/diagnostic/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'ClusterMembersResponse', @@ -8,3 +29,4 @@ __all__ = [ from .ClusterMembersResponse import ClusterMembersResponse from .ContextsResponse import ContextsResponse from .StatusResponse import StatusResponse + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Body.py b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Body.py index b7dfffd..a2ea8df 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Body.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Body.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class Body(object): @@ -10,3 +30,4 @@ class Body(object): def setResponses(self, responses): self.responses = responses + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Header.py b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Header.py index 8d09aa7..61a61b1 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Header.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Header.py @@ -1,5 +1,26 @@ -from .Property import Property +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class + +from .Property import Property class Header(object): @@ -19,3 +40,4 @@ class Header(object): def setProperties(self, properties): self.properties = properties + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Message.py b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Message.py index 2b38d9b..9d12331 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Message.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Message.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class Message(object): @@ -17,3 +37,4 @@ class Message(object): def setBody(self, body): self.body = body + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Property.py b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Property.py index 5234a76..eac8d1c 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/message/Property.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/message/Property.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class Property(object): @@ -17,3 +37,4 @@ class Property(object): def setValue(self, value): self.value = value + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py b/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py index f0bd3c0..d23e92b 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/message/WsId.py @@ -1,3 +1,23 @@ +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. + +# File auto-generated against equivalent DynamicSerialize Java class +# Modified by njensen to add __repr__ # # SOFTWARE HISTORY # @@ -5,44 +25,43 @@ # ------------- -------- --------- --------------------------------------------- # Apr 25, 2012 545 randerso Repurposed the lockKey field as threadId # Jun 12, 2013 2099 dgilling Implemented toPrettyString(). -# Feb 06, 2017 5959 randerso Removed Java .toString() calls +# Feb 06, 2017 5959 randerso Removed Java .toString() calls +# Jun 24, 2020 8187 randerso Changed to use hostName instead of integer +# network address. +# Oct 29, 2020 8239 randerso Undo change to use hostName instead of +# integer network address +# Dec 08, 2020 8239 randerso Add ability to set all fields in __init__ # +## import struct import socket import os -try: - import pwd - pwd_error = False -except ImportError: - pwd_error = True -try: - import _thread -except ImportError: - import thread as _thread - +import pwd +import threading class WsId(object): - def __init__(self, networkId=None, userName=None, progName=None): + def __init__(self, networkId=None, userName=None, progName=None, pid=None, threadId=None): self.networkId = networkId if networkId is None: - self.networkId = str(struct.unpack('') - compressedBuffer = numpy.getbuffer(self.compressedData) + compressedBuffer = memoryview(self.compressedData) self.compressedData = None uncompressedSize = datatype.itemsize for s in self.sizes: @@ -139,7 +172,7 @@ class CompressedDataRecord(object): if self.uncompressedData is None: self.decompress() return self.uncompressedData - + def putDataObject(self, obj): self.compressedData = None self.uncompressedData = obj diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/records/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/records/__init__.py index c21aec0..38894a4 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/records/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/records/__init__.py @@ -1,6 +1,41 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# +# Package definition for com.raytheon.uf.common.datastorage.records +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 08/31/10 njensen Initial Creation. +# Apr 24, 2015 4425 nabowle Add DoubleDataRecord +# Oct 04, 2018 7435 ksunil Added Chunked records +# Jan 28, 2020 7985 ksunil Removed the compression changes introduced in 7985 +# +# + __all__ = [ 'CompressedDataRecord' ] - from .CompressedDataRecord import CompressedDataRecord + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/CopyRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/CopyRequest.py index adb09ee..18a6eed 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/CopyRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/CopyRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class CopyRequest(object): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/CreateDatasetRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/CreateDatasetRequest.py index dc22048..1df97bf 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/CreateDatasetRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/CreateDatasetRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class CreateDatasetRequest(object): @@ -17,3 +37,4 @@ class CreateDatasetRequest(object): def setFilename(self, filename): self.filename = filename + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DatasetDataRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DatasetDataRequest.py index e1f36ce..67d41ca 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DatasetDataRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DatasetDataRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class DatasetDataRequest(object): @@ -24,3 +44,4 @@ class DatasetDataRequest(object): def setFilename(self, filename): self.filename = filename + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DatasetNamesRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DatasetNamesRequest.py index 3eb6fbd..74c72c2 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DatasetNamesRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DatasetNamesRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class DatasetNamesRequest(object): @@ -17,3 +37,4 @@ class DatasetNamesRequest(object): def setFilename(self, filename): self.filename = filename + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DeleteFilesRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DeleteFilesRequest.py index c6da193..54e6d98 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DeleteFilesRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DeleteFilesRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class DeleteFilesRequest(object): @@ -16,3 +36,4 @@ class DeleteFilesRequest(object): def setFilename(self, filename): self.filename = filename + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DeleteOrphansRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DeleteOrphansRequest.py index a95fc00..e68029a 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DeleteOrphansRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DeleteOrphansRequest.py @@ -1,12 +1,32 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Jul 27, 2015 1574 nabowle Generated # Feb 23, 2016 5389 nabowle Regenerated - class DeleteOrphansRequest(object): def __init__(self): @@ -24,3 +44,4 @@ class DeleteOrphansRequest(object): def setFilename(self, filename): self.filename = filename + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DeleteRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DeleteRequest.py index d6d7526..19fa019 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DeleteRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/DeleteRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class DeleteRequest(object): @@ -24,3 +44,4 @@ class DeleteRequest(object): def setFilename(self, filename): self.filename = filename + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/GroupsRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/GroupsRequest.py index 82c10c3..f0de10c 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/GroupsRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/GroupsRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GroupsRequest(object): @@ -24,3 +44,4 @@ class GroupsRequest(object): def setFilename(self, filename): self.filename = filename + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/RepackRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/RepackRequest.py index 481bf22..0698238 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/RepackRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/RepackRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class RepackRequest(object): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/RetrieveRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/RetrieveRequest.py index 839f287..fc88787 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/RetrieveRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/RetrieveRequest.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class RetrieveRequest(object): @@ -31,3 +51,4 @@ class RetrieveRequest(object): def setFilename(self, filename): self.filename = filename + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/StoreRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/StoreRequest.py index d18f0b4..d590109 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/StoreRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/StoreRequest.py @@ -1,10 +1,30 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class StoreRequest(object): def __init__(self): self.op = None - self.records = None + self.recordsAndMetadata = None self.filename = None def getOp(self): @@ -13,14 +33,15 @@ class StoreRequest(object): def setOp(self, op): self.op = op - def getRecords(self): - return self.records + def getRecordsAndMetadata(self): + return self.recordsAndMetadata - def setRecords(self, records): - self.records = records + def setRecordsAndMetadata(self, recordsAndMetadata): + self.recordsAndMetadata = recordsAndMetadata def getFilename(self): return self.filename def setFilename(self, filename): self.filename = filename + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/__init__.py index 766797d..eeba9a4 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/request/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'CopyRequest', diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/DeleteResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/DeleteResponse.py index f95180f..f4558a3 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/DeleteResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/DeleteResponse.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class DeleteResponse(object): @@ -10,3 +30,4 @@ class DeleteResponse(object): def setSuccess(self, success): self.success = success + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/ErrorResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/ErrorResponse.py index 526c34f..7bef7a0 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/ErrorResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/ErrorResponse.py @@ -1,12 +1,40 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class ErrorResponse(object): - def __init__(self): - self.error = None + def __init__(self, error=None, errorType='OTHER'): + self.error = error + self.type = errorType def getError(self): return self.error def setError(self, error): self.error = error + + def getType(self): + return self.type + + def setType(self, errorType): + self.type = errorType + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/FileActionResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/FileActionResponse.py index 9b7a625..4812b67 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/FileActionResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/FileActionResponse.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class FileActionResponse(object): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/RetrieveResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/RetrieveResponse.py index a354f92..df3dddb 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/RetrieveResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/RetrieveResponse.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class RetrieveResponse(object): @@ -10,3 +30,4 @@ class RetrieveResponse(object): def setRecords(self, records): self.records = records + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/StoreResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/StoreResponse.py index f66a596..44b1e7e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/StoreResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/StoreResponse.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class StoreResponse(object): @@ -24,3 +44,4 @@ class StoreResponse(object): def setFailedRecords(self, failedRecords): self.failedRecords = failedRecords + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/__init__.py index 22ac327..1c6daea 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/pypies/response/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'DeleteResponse', diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/SerializableExceptionWrapper.py b/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/SerializableExceptionWrapper.py index 0014102..a3079a8 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/SerializableExceptionWrapper.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/SerializableExceptionWrapper.py @@ -1,13 +1,31 @@ +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. + +# File auto-generated against equivalent DynamicSerialize Java class and +# modified. # # SOFTWARE HISTORY # # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 2015-02-27 4174 nabowle Output full stacktrace. -# 2018-10-05 mjames@ucar Fix returned retVal encoding. # - class SerializableExceptionWrapper(object): def __init__(self): @@ -22,13 +40,13 @@ class SerializableExceptionWrapper(object): def __repr__(self): if not self.message: self.message = '' - retVal = "" + str(self.exceptionClass) + " exception thrown: " + str(self.message) + "\n" + retVal = "" + self.exceptionClass + " exception thrown: " + self.message + "\n" for element in self.stackTrace: retVal += "\tat " + str(element) + "\n" if self.wrapper: retVal += "Caused by: " + self.wrapper.__repr__() - return str(retVal) + return retVal def getStackTrace(self): return self.stackTrace @@ -53,3 +71,4 @@ class SerializableExceptionWrapper(object): def setWrapper(self, wrapper): self.wrapper = wrapper + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/__init__.py index 29e6b99..b41f0d6 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/__init__.py @@ -1,7 +1,41 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +# +# Package definition for com.raytheon.uf.common.serialization +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 09/21/10 njensen Initial Creation. +# +# +# + __all__ = [ - 'comm', - 'SerializableExceptionWrapper' - ] + 'comm', + 'SerializableExceptionWrapper', + ] from .SerializableExceptionWrapper import SerializableExceptionWrapper diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/comm/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/comm/__init__.py index 1406bfb..50e49d4 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/comm/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/comm/__init__.py @@ -1,4 +1,39 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + +# +# Package definition for com.raytheon.uf.common.serialization.comm +# +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# 09/21/10 njensen Initial Creation. +# +# +# + __all__ = [ - 'response' - ] + 'response', + ] + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/comm/response/ServerErrorResponse.py b/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/comm/response/ServerErrorResponse.py index 832782b..3299fbe 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/comm/response/ServerErrorResponse.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/comm/response/ServerErrorResponse.py @@ -1,4 +1,22 @@ +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# File auto-generated against equivalent DynamicSerialize Java class class ServerErrorResponse(object): @@ -10,3 +28,4 @@ class ServerErrorResponse(object): def setException(self, exception): self.exception = exception + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/comm/response/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/comm/response/__init__.py index fcd7335..d4de14e 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/comm/response/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/serialization/comm/response/__init__.py @@ -1,18 +1,40 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Package definition for com.raytheon.uf.common.serialization.comm.response -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 09/21/10 njensen Initial Creation. +# +# # -# -# + __all__ = [ - 'ServerErrorResponse' - ] + 'ServerErrorResponse', + ] from .ServerErrorResponse import ServerErrorResponse diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/site/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/site/__init__.py index 2005420..ee60dba 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/site/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/site/__init__.py @@ -1,5 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'notify', - 'requests' + 'requests', ] + + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/site/notify/ClusterActivationNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/site/notify/ClusterActivationNotification.py index a19e0c7..e0fbac4 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/site/notify/ClusterActivationNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/site/notify/ClusterActivationNotification.py @@ -1,23 +1,42 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 09/10/14 #3623 randerso Manually created, do not regenerate # +## +# File auto-generated against equivalent DynamicSerialize Java class from .SiteActivationNotification import SiteActivationNotification - - class ClusterActivationNotification(SiteActivationNotification): def __init__(self): self.clusterActive = False SiteActivationNotification.__init__(self) - + def isClusterActive(self): return self.clusterActive - + def setClusterActive(self, clusterActive): self.clusterActive = clusterActive @@ -29,11 +48,11 @@ class ClusterActivationNotification(SiteActivationNotification): s += " has failed to activate on some or all cluster members. See logs for details" else: s += " has been successfully activated on all cluster members" - + else: if self.status == 'FAILURE': s += " has failed to deactivate on some or all cluster members. See logs for details" else: s += " has been successfully deactivated on all cluster members" - return s + return s \ No newline at end of file diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/site/notify/SiteActivationNotification.py b/dynamicserialize/dstypes/com/raytheon/uf/common/site/notify/SiteActivationNotification.py index 8672a16..a6feaff 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/site/notify/SiteActivationNotification.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/site/notify/SiteActivationNotification.py @@ -1,11 +1,30 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 09/10/14 #3623 randerso Manually created, do not regenerate # - +## class SiteActivationNotification(object): @@ -21,8 +40,8 @@ class SiteActivationNotification(object): def getType(self): return self.type - def setType(self, notificationType): - self.type = notificationType + def setType(self, type): + self.type = type def getStatus(self): return self.status @@ -31,10 +50,10 @@ class SiteActivationNotification(object): self.status = status def getPrimarySite(self): - return self.primarySite + return self.primarysite def setPrimarySite(self, primarysite): - self.primarySite = primarysite + self.primarysite = primarysite def getModifiedSite(self): return self.modifiedSite @@ -59,7 +78,7 @@ class SiteActivationNotification(object): def setPluginName(self, pluginName): self.pluginName = pluginName - + def __str__(self): return self.pluginName.upper() + ":" \ + self.status + ":" \ @@ -67,3 +86,4 @@ class SiteActivationNotification(object): + self.modifiedSite.upper() + " on " \ + self.serverName + ":" \ + self.runMode + \ No newline at end of file diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/site/notify/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/site/notify/__init__.py index b8c384e..752f16d 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/site/notify/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/site/notify/__init__.py @@ -1,8 +1,30 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'ClusterActivationNotification', - 'SiteActivationNotification' + 'SiteActivationNotification', ] from .ClusterActivationNotification import ClusterActivationNotification from .SiteActivationNotification import SiteActivationNotification + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/ActivateSiteRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/ActivateSiteRequest.py index 8b9f225..a6edaea 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/ActivateSiteRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/ActivateSiteRequest.py @@ -1,11 +1,30 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 09/10/14 #3623 randerso Manually created, do not regenerate # - +## class ActivateSiteRequest(object): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/DeactivateSiteRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/DeactivateSiteRequest.py index d6adafe..04cc600 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/DeactivateSiteRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/DeactivateSiteRequest.py @@ -1,11 +1,30 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 09/10/14 #3623 randerso Manually created, do not regenerate # - +## class DeactivateSiteRequest(object): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/GetActiveSitesRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/GetActiveSitesRequest.py index 8f04b7a..747ee03 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/GetActiveSitesRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/GetActiveSitesRequest.py @@ -1,6 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GetActiveSitesRequest(object): def __init__(self): super(GetActiveSitesRequest, self).__init__() + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/GetPrimarySiteRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/GetPrimarySiteRequest.py index 1f9c9a7..4930696 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/GetPrimarySiteRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/GetPrimarySiteRequest.py @@ -1,6 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class GetPrimarySiteRequest(object): def __init__(self): super(GetPrimarySiteRequest, self).__init__() + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/ValidateConfigRequest.py b/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/ValidateConfigRequest.py index f9f391c..2fa79fe 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/ValidateConfigRequest.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/ValidateConfigRequest.py @@ -1,11 +1,32 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 09/12/16 #5888 dgilling Initial creation. # +## +### This class was manually created. DO NOT AUTOGENERATE ### class ValidateConfigRequest(object): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/__init__.py index 3cebd9b..24cb25b 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/site/requests/__init__.py @@ -1,10 +1,31 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'ActivateSiteRequest', 'DeactivateSiteRequest', 'GetActiveSitesRequest', 'GetPrimarySiteRequest', - 'ValidateConfigRequest' + 'ValidateConfigRequest', ] from .ActivateSiteRequest import ActivateSiteRequest @@ -12,3 +33,4 @@ from .DeactivateSiteRequest import DeactivateSiteRequest from .GetActiveSitesRequest import GetActiveSitesRequest from .GetPrimarySiteRequest import GetPrimarySiteRequest from .ValidateConfigRequest import ValidateConfigRequest + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/time/CommutativeTimestamp.py b/dynamicserialize/dstypes/com/raytheon/uf/common/time/CommutativeTimestamp.py index bc3c247..e1473a6 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/time/CommutativeTimestamp.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/time/CommutativeTimestamp.py @@ -1,3 +1,23 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# ---------------------------------------------------------------------------- # # SOFTWARE HISTORY # @@ -5,11 +25,13 @@ # ------------ ---------- ----------- -------------------------- # 06/23/2016 #5696 rjpeter Initial creation. # +## +from time import gmtime, strftime from dynamicserialize.dstypes.java.sql import Timestamp - class CommutativeTimestamp(Timestamp): def __init__(self, timeInMillis=None): super(CommutativeTimestamp, self).__init__(timeInMillis) + diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/time/DataTime.py b/dynamicserialize/dstypes/com/raytheon/uf/common/time/DataTime.py index 5df62f9..4b401e7 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/time/DataTime.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/time/DataTime.py @@ -1,3 +1,26 @@ +# # +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +# # + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to add additional features to better +# match Java implementation. # # SOFTWARE HISTORY # @@ -14,14 +37,16 @@ # 05/26/16 2416 rjpeter Added str based constructor. # 08/02/16 2416 tgurney Forecast time regex bug fix, # plus misc cleanup -# +# 09/13/19 7888 tgurney Python 3 division fixes +# 11/18/19 7881 tgurney Fix __hash__ + import calendar import datetime -import re -import time import numpy -from six.moves import cStringIO as StringIO +import re +import io +import time from dynamicserialize.dstypes.java.util import Date from dynamicserialize.dstypes.java.util import EnumSet @@ -30,11 +55,16 @@ from .TimeRange import TimeRange _DATE = r'(\d{4}-\d{2}-\d{2})' _TIME = r'(\d{2}:\d{2}:\d{2})' -_MILLIS = '(?:\.(\d{1,3})(?:\d{1,4})?)?' # might have microsecond but that is thrown out +# might have microsecond but that is thrown out +_MILLIS = '(?:\.(\d{1,3})(?:\d{1,4})?)?' REFTIME_PATTERN_STR = _DATE + '[ _]' + _TIME + _MILLIS FORECAST_PATTERN_STR = r'(?:[ _]\((\d+)(?::(\d{1,2}))?\))?' -VALID_PERIOD_PATTERN_STR = r'(?:\[' + REFTIME_PATTERN_STR + '--' + REFTIME_PATTERN_STR + r'\])?' -STR_PATTERN = re.compile(REFTIME_PATTERN_STR + FORECAST_PATTERN_STR + VALID_PERIOD_PATTERN_STR) +VALID_PERIOD_PATTERN_STR = r'(?:\[' + REFTIME_PATTERN_STR + \ + '--' + REFTIME_PATTERN_STR + r'\])?' +STR_PATTERN = re.compile( + REFTIME_PATTERN_STR + + FORECAST_PATTERN_STR + + VALID_PERIOD_PATTERN_STR) class DataTime(object): @@ -58,14 +88,18 @@ class DataTime(object): self.fcstTime = 0 self.refTime = refTime if validPeriod is not None and not isinstance(validPeriod, TimeRange): - raise ValueError("Invalid validPeriod object specified for DataTime.") + raise ValueError( + "Invalid validPeriod object specified for DataTime.") self.validPeriod = validPeriod - self.utilityFlags = EnumSet('com.raytheon.uf.common.time.DataTime$FLAG') + self.utilityFlags = EnumSet( + 'com.raytheon.uf.common.time.DataTime$FLAG') self.levelValue = numpy.float64(-1.0) if self.refTime is not None: if isinstance(self.refTime, datetime.datetime): - self.refTime = int(calendar.timegm(self.refTime.utctimetuple()) * 1000) + self.refTime = int( + calendar.timegm( + self.refTime.utctimetuple()) * 1000) elif isinstance(self.refTime, time.struct_time): self.refTime = int(calendar.timegm(self.refTime) * 1000) elif hasattr(self.refTime, 'getTime'): @@ -83,12 +117,15 @@ class DataTime(object): + str(refTime)) groups = match.groups() + rDate = groups[0] + rTime = groups[1] rMillis = groups[2] or 0 fcstTimeHr = groups[3] fcstTimeMin = groups[4] periodStart = groups[5], groups[6], (groups[7] or 0) periodEnd = groups[8], groups[9], (groups[10] or 0) - self.refTime = self._getTimeAsEpochMillis(groups[0], groups[1], rMillis) + self.refTime = self._getTimeAsEpochMillis( + rDate, rTime, rMillis) if fcstTimeHr is not None: self.fcstTime = int(fcstTimeHr) * 3600 @@ -97,18 +134,19 @@ class DataTime(object): if periodStart[0] is not None: self.validPeriod = TimeRange() - periodStartTime = self._getTimeAsEpochMillis(*periodStart) - self.validPeriod.setStart(periodStartTime / 1000) + periodStartTime = self._getTimeAsEpochMillis( + *periodStart) + self.validPeriod.setStart(periodStartTime // 1000) periodEndTime = self._getTimeAsEpochMillis(*periodEnd) - self.validPeriod.setEnd(periodEndTime / 1000) + self.validPeriod.setEnd(periodEndTime // 1000) self.refTime = Date(self.refTime) if self.validPeriod is None: validTimeMillis = self.refTime.getTime() + int(self.fcstTime * 1000) self.validPeriod = TimeRange() - self.validPeriod.setStart(validTimeMillis / 1000) - self.validPeriod.setEnd(validTimeMillis / 1000) + self.validPeriod.setStart(validTimeMillis // 1000) + self.validPeriod.setEnd(validTimeMillis // 1000) # figure out utility flags if self.fcstTime: @@ -147,45 +185,44 @@ class DataTime(object): self.levelValue = numpy.float64(levelValue) def __str__(self): - sbuffer = StringIO() + buffer = io.StringIO() if self.refTime is not None: - refTimeInSecs = self.refTime.getTime() / 1000 + refTimeInSecs = self.refTime.getTime() // 1000 micros = (self.refTime.getTime() % 1000) * 1000 dtObj = datetime.datetime.utcfromtimestamp(refTimeInSecs) dtObj = dtObj.replace(microsecond=micros) - # This won't be compatible with java or string from java since its to microsecond - sbuffer.write(dtObj.isoformat(' ')) + # This won't be compatible with java or string from java since its + # to microsecond + buffer.write(dtObj.isoformat(' ')) if "FCST_USED" in self.utilityFlags: hrs = int(self.fcstTime / 3600) mins = int((self.fcstTime - (hrs * 3600)) / 60) - sbuffer.write(" (" + str(hrs)) + buffer.write(" (" + str(hrs)) if mins != 0: - sbuffer.write(":" + str(mins)) - sbuffer.write(")") + buffer.write(":" + str(mins)) + buffer.write(")") if "PERIOD_USED" in self.utilityFlags: - sbuffer.write("[") - sbuffer.write(self.validPeriod.start.isoformat(' ')) - sbuffer.write("--") - sbuffer.write(self.validPeriod.end.isoformat(' ')) - sbuffer.write("]") + buffer.write("[") + buffer.write(self.validPeriod.start.isoformat(' ')) + buffer.write("--") + buffer.write(self.validPeriod.end.isoformat(' ')) + buffer.write("]") - strVal = sbuffer.getvalue() - sbuffer.close() + strVal = buffer.getvalue() + buffer.close() return strVal def __repr__(self): return "" def __hash__(self): - hashCode = hash(self.refTime) ^ hash(self.fcstTime) - if self.validPeriod is not None and self.validPeriod.isValid(): - hashCode ^= hash(self.validPeriod.getStart()) - hashCode ^= hash(self.validPeriod.getEnd()) - hashCode ^= hash(self.levelValue) - return hashCode + if self.getRefTime() is None: + return hash(self.fcstTime) + return hash((self.refTime, self.fcstTime, + self.validPeriod, self.levelValue)) def __eq__(self, other): if not isinstance(self, type(other)): @@ -194,8 +231,16 @@ class DataTime(object): if other.getRefTime() is None: return self.fcstTime == other.fcstTime - dataTime1 = (self.refTime, self.fcstTime, self.validPeriod, self.levelValue) - dataTime2 = (other.refTime, other.fcstTime, other.validPeriod, other.levelValue) + dataTime1 = ( + self.refTime, + self.fcstTime, + self.validPeriod, + self.levelValue) + dataTime2 = ( + other.refTime, + other.fcstTime, + other.validPeriod, + other.levelValue) return dataTime1 == dataTime2 def __ne__(self, other): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/time/FormattedDate.py b/dynamicserialize/dstypes/com/raytheon/uf/common/time/FormattedDate.py index 1987b8a..5f1f673 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/time/FormattedDate.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/time/FormattedDate.py @@ -1,3 +1,23 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# ---------------------------------------------------------------------------- # # SOFTWARE HISTORY # @@ -5,11 +25,10 @@ # ------------ ---------- ----------- -------------------------- # 09/21/2015 4486 rjpeter Initial creation. # 06/23/2016 #5696 rjpeter Extend CommutativeTimestamp -# +## from .CommutativeTimestamp import CommutativeTimestamp - # TODO: Remove after 16.4.1 no longer in field class FormattedDate(CommutativeTimestamp): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/time/TimeRange.py b/dynamicserialize/dstypes/com/raytheon/uf/common/time/TimeRange.py index 53e972b..901e7e5 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/time/TimeRange.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/time/TimeRange.py @@ -1,3 +1,25 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class. Then modified to add functionality +# # # SOFTWARE HISTORY # @@ -9,6 +31,7 @@ # 06/24/15 4480 dgilling fix __eq__. # # +# import calendar import datetime @@ -19,7 +42,8 @@ MICROS_IN_SECOND = 1000000 class TimeRange(object): - def __init__(self, start=None, end=None, startExtraMicros=None, endExtraMicros=None): + def __init__(self, start=None, end=None, + startExtraMicros=None, endExtraMicros=None): self.start = self.__convertToDateTimeWithExtra(start, startExtraMicros) self.end = self.__convertToDateTimeWithExtra(end, endExtraMicros) @@ -27,22 +51,19 @@ class TimeRange(object): return self.__repr__() def __repr__(self): - return "(" + self.start.strftime("%b %d %y %H:%M:%S %Z") + ", " + \ - self.end.strftime("%b %d %y %H:%M:%S %Z") + ")" + return "(" + self.start.strftime("%b %d %y %H:%M:%S %Z") + \ + ", " + self.end.strftime("%b %d %y %H:%M:%S %Z") + ")" def __eq__(self, other): - if not isinstance(self, type(other)): - return False - - if self.isValid() and other.isValid(): - return self.getStart() == other.getStart() and self.getEnd() == other.getEnd() - elif not self.isValid() and not other.isValid(): - return True - else: + if not isinstance(other, TimeRange): return False + return (self.start, self.end) == (other.start, other.end) def __ne__(self, other): - return not self.__eq__(other) + return (not self.__eq__(other)) + + def __hash__(self): + return hash((self.start, self.end)) def __convertToDateTimeWithExtra(self, timeArg, extraMicros): rval = self.__convertToDateTime(timeArg) @@ -110,20 +131,22 @@ class TimeRange(object): return self.__eq__(timeArg) elif timeArg.duration() == 0: return self.contains(timeArg.start) - return timeArg.start >= self.start and timeArg.end <= self.end + return (timeArg.start >= self.start and timeArg.end <= self.end) else: convTime = self.__convertToDateTime(timeArg) if not isinstance(convTime, datetime.datetime): - raise TypeError("Invalid type for argument time specified to TimeRange.contains().") + raise TypeError( + "Invalid type for argument time specified to TimeRange.contains().") if self.duration() != 0: - return self.start <= convTime < self.end + return (convTime >= self.start and convTime < self.end) return convTime == self.start def isValid(self): return bool(self.start != self.end) def overlaps(self, timeRange): - return timeRange.contains(self.start) or self.contains(timeRange.start) + return (timeRange.contains(self.start) + or self.contains(timeRange.start)) def combineWith(self, timeRange): if self.isValid() and timeRange.isValid(): diff --git a/dynamicserialize/dstypes/com/raytheon/uf/common/time/__init__.py b/dynamicserialize/dstypes/com/raytheon/uf/common/time/__init__.py index 14d6861..19c6270 100644 --- a/dynamicserialize/dstypes/com/raytheon/uf/common/time/__init__.py +++ b/dynamicserialize/dstypes/com/raytheon/uf/common/time/__init__.py @@ -1,12 +1,34 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ - 'CommutativeTimestamp', 'DataTime', + 'TimeRange', 'FormattedDate', - 'TimeRange' + 'CommutativeTimestamp' ] from .DataTime import DataTime from .TimeRange import TimeRange from .FormattedDate import FormattedDate from .CommutativeTimestamp import CommutativeTimestamp + diff --git a/dynamicserialize/dstypes/com/vividsolutions/__init__.py b/dynamicserialize/dstypes/com/vividsolutions/__init__.py deleted file mode 100644 index 074f0ea..0000000 --- a/dynamicserialize/dstypes/com/vividsolutions/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ - -__all__ = [ - 'jts' - ] diff --git a/dynamicserialize/dstypes/com/vividsolutions/jts/__init__.py b/dynamicserialize/dstypes/com/vividsolutions/jts/__init__.py deleted file mode 100644 index 0699c05..0000000 --- a/dynamicserialize/dstypes/com/vividsolutions/jts/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ - -__all__ = [ - 'geom' - ] diff --git a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Coordinate.py b/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Coordinate.py deleted file mode 100644 index f143f0f..0000000 --- a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Coordinate.py +++ /dev/null @@ -1,25 +0,0 @@ - - -class Coordinate(object): - - def __init__(self, x=None, y=None): - self.x = x - self.y = y - - def getX(self): - return self.x - - def getY(self): - return self.y - - def setX(self, x): - self.x = x - - def setY(self, y): - self.y = y - - def __str__(self): - return str((self.x, self.y)) - - def __repr__(self): - return self.__str__() diff --git a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Geometry.py b/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Geometry.py deleted file mode 100644 index 2b134c7..0000000 --- a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Geometry.py +++ /dev/null @@ -1,17 +0,0 @@ -# This class is a dummy implementation of the -# com.vividsolutions.jts.geom.Geometry class. It was simply created to allow -# serialization/deserialization of GridLocation objects. This should be -# reimplemented if useful work needs to be performed against serialized -# Geometry objects. - - -class Geometry(object): - - def __init__(self): - self.binaryData = None - - def getBinaryData(self): - return self.binaryData - - def setBinaryData(self, data): - self.binaryData = data diff --git a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/__init__.py b/dynamicserialize/dstypes/com/vividsolutions/jts/geom/__init__.py deleted file mode 100644 index 93748c2..0000000 --- a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ - -__all__ = [ - 'Coordinate', - 'Envelope', - 'Geometry' - ] - -from .Coordinate import Coordinate -from .Envelope import Envelope -from .Geometry import Geometry diff --git a/dynamicserialize/dstypes/gov/__init__.py b/dynamicserialize/dstypes/gov/__init__.py index 5dd1b2b..c19855a 100644 --- a/dynamicserialize/dstypes/gov/__init__.py +++ b/dynamicserialize/dstypes/gov/__init__.py @@ -1,4 +1,8 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ 'noaa' ] + + diff --git a/dynamicserialize/dstypes/gov/noaa/__init__.py b/dynamicserialize/dstypes/gov/noaa/__init__.py index 7d0a4a9..47f9c4d 100644 --- a/dynamicserialize/dstypes/gov/noaa/__init__.py +++ b/dynamicserialize/dstypes/gov/noaa/__init__.py @@ -1,4 +1,8 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ 'nws' ] + + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/__init__.py b/dynamicserialize/dstypes/gov/noaa/nws/__init__.py index 24524a7..925c05f 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/__init__.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/__init__.py @@ -1,4 +1,8 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ 'ncep' ] + + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/__init__.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/__init__.py index c03e3e7..3a99cc7 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/__init__.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/__init__.py @@ -1,4 +1,8 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ 'common' ] + + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/__init__.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/__init__.py index 4d826f7..c28322f 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/__init__.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/__init__.py @@ -1,4 +1,8 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ 'dataplugin' ] + + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/__init__.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/__init__.py index aed05b4..adba431 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/__init__.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/__init__.py @@ -1,7 +1,11 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ 'atcf', 'gempak', 'gpd', 'pgen' ] + + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/atcf/__init__.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/atcf/__init__.py index ed91455..a944c4e 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/atcf/__init__.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/atcf/__init__.py @@ -1,4 +1,8 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ 'request' ] + + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/atcf/request/RetrieveAtcfDeckRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/atcf/request/RetrieveAtcfDeckRequest.py index be5a1a7..9fdc815 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/atcf/request/RetrieveAtcfDeckRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/atcf/request/RetrieveAtcfDeckRequest.py @@ -1,4 +1,5 @@ +# File auto-generated against equivalent DynamicSerialize Java class class RetrieveAtcfDeckRequest(object): @@ -10,3 +11,4 @@ class RetrieveAtcfDeckRequest(object): def setDeckID(self, deckID): self.deckID = deckID + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/atcf/request/__init__.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/atcf/request/__init__.py index a8c381a..5fed242 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/atcf/request/__init__.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/atcf/request/__init__.py @@ -1,6 +1,9 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ 'RetrieveAtcfDeckRequest' ] from .RetrieveAtcfDeckRequest import RetrieveAtcfDeckRequest + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/__init__.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/__init__.py index ed91455..a944c4e 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/__init__.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/__init__.py @@ -1,4 +1,8 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ 'request' ] + + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridDataRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridDataRequest.py index 5fccf34..6393c60 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridDataRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridDataRequest.py @@ -1,11 +1,12 @@ -# + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Sep 16, 2016 pmoyer Generated - class GetGridDataRequest(object): def __init__(self): @@ -65,3 +66,4 @@ class GetGridDataRequest(object): def setFcstsec(self, fcstsec): self.fcstsec = fcstsec + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridInfoRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridInfoRequest.py index 7ecd148..2c2c02c 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridInfoRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridInfoRequest.py @@ -1,11 +1,12 @@ -# + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Sep 16, 2016 pmoyer Generated - class GetGridInfoRequest(object): def __init__(self): @@ -37,3 +38,4 @@ class GetGridInfoRequest(object): def setFcstsec(self, fcstsec): self.fcstsec = fcstsec + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridNavRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridNavRequest.py index 5284322..dd2afca 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridNavRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridNavRequest.py @@ -1,11 +1,12 @@ -# + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Sep 16, 2016 pmoyer Generated - class GetGridNavRequest(object): def __init__(self): @@ -23,3 +24,4 @@ class GetGridNavRequest(object): def setPluginName(self, pluginName): self.pluginName = pluginName + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetStationsRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetStationsRequest.py index 3670c42..2f58961 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetStationsRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetStationsRequest.py @@ -1,11 +1,12 @@ -# + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Sep 16, 2016 pmoyer Generated - class GetStationsRequest(object): def __init__(self): @@ -16,3 +17,4 @@ class GetStationsRequest(object): def setPluginName(self, pluginName): self.pluginName = pluginName + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesRequest.py index 6387132..f766896 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesRequest.py @@ -1,11 +1,12 @@ -# + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Sep 16, 2016 pmoyer Generated - class GetTimesRequest(object): def __init__(self): @@ -23,3 +24,4 @@ class GetTimesRequest(object): def setTimeField(self, timeField): self.timeField = timeField + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesResponse.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesResponse.py index 0f37030..6864f0c 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesResponse.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetTimesResponse.py @@ -1,11 +1,12 @@ -# + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Sep 16, 2016 pmoyer Generated - class GetTimesResponse(object): def __init__(self): @@ -16,3 +17,4 @@ class GetTimesResponse(object): def setTimes(self, times): self.times = times + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/Station.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/Station.py index 9bae221..a530b76 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/Station.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/Station.py @@ -1,13 +1,14 @@ -# + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Sep 16, 2016 pmoyer Generated import numpy - class Station(object): def __init__(self): @@ -60,3 +61,4 @@ class Station(object): def setCountry(self, country): self.country = country + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/StationDataRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/StationDataRequest.py index b587766..cb9a467 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/StationDataRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/StationDataRequest.py @@ -1,11 +1,12 @@ -# + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Sep 16, 2016 pmoyer Generated - class StationDataRequest(object): def __init__(self): @@ -44,3 +45,4 @@ class StationDataRequest(object): def setPartNumber(self, partNumber): self.partNumber = partNumber + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/SurfaceDataRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/SurfaceDataRequest.py index 04ae692..7424671 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/SurfaceDataRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/SurfaceDataRequest.py @@ -1,11 +1,12 @@ -# + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Sep 16, 2016 pmoyer Generated - class SurfaceDataRequest(object): def __init__(self): @@ -44,3 +45,4 @@ class SurfaceDataRequest(object): def setPartNumber(self, partNumber): self.partNumber = partNumber + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/UpperAirDataRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/UpperAirDataRequest.py index ed692ed..3a57baf 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/UpperAirDataRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/UpperAirDataRequest.py @@ -1,11 +1,12 @@ -# + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # Sep 16, 2016 pmoyer Generated - class UpperAirDataRequest(object): def __init__(self): @@ -44,3 +45,4 @@ class UpperAirDataRequest(object): def setPartNumber(self, partNumber): self.partNumber = partNumber + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/__init__.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/__init__.py index ead3450..8943267 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/__init__.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/__init__.py @@ -1,4 +1,6 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ 'GetGridDataRequest', 'GetGridInfoRequest', @@ -22,3 +24,4 @@ from .Station import Station from .StationDataRequest import StationDataRequest from .SurfaceDataRequest import SurfaceDataRequest from .UpperAirDataRequest import UpperAirDataRequest + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gpd/__init__.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gpd/__init__.py index 8f0707c..2e70919 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gpd/__init__.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gpd/__init__.py @@ -1,4 +1,6 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ 'query' ] diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gpd/query/GenericPointDataReqMsg.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gpd/query/GenericPointDataReqMsg.py index eafa73a..56daf7a 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gpd/query/GenericPointDataReqMsg.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gpd/query/GenericPointDataReqMsg.py @@ -1,4 +1,5 @@ +# File auto-generated against equivalent DynamicSerialize Java class class GenericPointDataReqMsg(object): @@ -14,7 +15,7 @@ class GenericPointDataReqMsg(object): self.queryKey = None self.gpdDataString = None self.maxNumLevel = 1 - + def getReqType(self): return self.reqType @@ -77,6 +78,7 @@ class GenericPointDataReqMsg(object): def getGpdDataString(self): return self.gpdDataString - + def setGpdDataString(self, gpdDataString): self.gpdDataString = gpdDataString + \ No newline at end of file diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gpd/query/__init__.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gpd/query/__init__.py index ec61bb1..6a24ef2 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gpd/query/__init__.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gpd/query/__init__.py @@ -1,4 +1,6 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ 'GenericPointDataReqMsg' ] diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ActivityInfo.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ActivityInfo.py index d72b906..8ce7a83 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ActivityInfo.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ActivityInfo.py @@ -1,4 +1,5 @@ +# File auto-generated against equivalent DynamicSerialize Java class class ActivityInfo(object): @@ -73,3 +74,4 @@ class ActivityInfo(object): def setStatus(self, status): self.status = status + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/DerivedProduct.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/DerivedProduct.py index 647ead2..888e270 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/DerivedProduct.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/DerivedProduct.py @@ -1,4 +1,5 @@ +# File auto-generated against equivalent DynamicSerialize Java class class DerivedProduct(object): @@ -24,3 +25,4 @@ class DerivedProduct(object): def setProduct(self, product): self.product = product + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ResponseMessageValidate.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ResponseMessageValidate.py index e6c2742..2d7dc5c 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ResponseMessageValidate.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/ResponseMessageValidate.py @@ -1,4 +1,5 @@ +# File auto-generated against equivalent DynamicSerialize Java class class ResponseMessageValidate(object): @@ -38,3 +39,4 @@ class ResponseMessageValidate(object): def setValidTime(self, validTime): self.validTime = validTime + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/__init__.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/__init__.py index bf0eb37..a5ed27e 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/__init__.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/__init__.py @@ -1,12 +1,15 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ - 'request', - 'response', 'ActivityInfo', 'DerivedProduct', - 'ResponseMessageValidate' + 'ResponseMessageValidate', + 'request', + 'response' ] from .ActivityInfo import ActivityInfo from .DerivedProduct import DerivedProduct from .ResponseMessageValidate import ResponseMessageValidate + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/RetrieveActivityMapRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/RetrieveActivityMapRequest.py index 852420f..0c34127 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/RetrieveActivityMapRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/RetrieveActivityMapRequest.py @@ -1,11 +1,12 @@ -# + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # May 05, 2016 root Generated - class RetrieveActivityMapRequest(object): def __init__(self): diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/RetrieveAllProductsRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/RetrieveAllProductsRequest.py index 73cd3a9..e3a1124 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/RetrieveAllProductsRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/RetrieveAllProductsRequest.py @@ -1,4 +1,5 @@ +# File auto-generated against equivalent DynamicSerialize Java class class RetrieveAllProductsRequest(object): @@ -10,3 +11,4 @@ class RetrieveAllProductsRequest(object): def setDataURI(self, dataURI): self.dataURI = dataURI + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreActivityRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreActivityRequest.py index 1512011..3f36740 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreActivityRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreActivityRequest.py @@ -1,4 +1,5 @@ +# File auto-generated against equivalent DynamicSerialize Java class class StoreActivityRequest(object): @@ -17,3 +18,4 @@ class StoreActivityRequest(object): def setActivityXML(self, activityXML): self.activityXML = activityXML + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreDerivedProductRequest.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreDerivedProductRequest.py index 3b70af8..92d64a9 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreDerivedProductRequest.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/StoreDerivedProductRequest.py @@ -1,4 +1,5 @@ +# File auto-generated against equivalent DynamicSerialize Java class class StoreDerivedProductRequest(object): @@ -17,3 +18,4 @@ class StoreDerivedProductRequest(object): def setProductList(self, productList): self.productList = productList + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/__init__.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/__init__.py index c6784eb..7c800a3 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/__init__.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/request/__init__.py @@ -1,12 +1,15 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ - 'RetrieveActivityMapRequest', 'RetrieveAllProductsRequest', 'StoreActivityRequest', - 'StoreDerivedProductRequest' + 'StoreDerivedProductRequest', + 'RetrieveActivityMapRequest' ] from .RetrieveAllProductsRequest import RetrieveAllProductsRequest from .StoreActivityRequest import StoreActivityRequest from .StoreDerivedProductRequest import StoreDerivedProductRequest from .RetrieveActivityMapRequest import RetrieveActivityMapRequest + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/ActivityMapData.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/ActivityMapData.py index 0596caa..97b9a3c 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/ActivityMapData.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/ActivityMapData.py @@ -1,11 +1,12 @@ -# + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # May 06, 2016 root Generated - class ActivityMapData(object): def __init__(self): @@ -51,3 +52,4 @@ class ActivityMapData(object): def setActivityName(self, activityName): self.activityName = activityName + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/RetrieveActivityMapResponse.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/RetrieveActivityMapResponse.py index 2f6d1bd..f9111ee 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/RetrieveActivityMapResponse.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/RetrieveActivityMapResponse.py @@ -1,11 +1,12 @@ -# + +# File auto-generated against equivalent DynamicSerialize Java class +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # May 06, 2016 root Generated - class RetrieveActivityMapResponse(object): def __init__(self): @@ -16,3 +17,4 @@ class RetrieveActivityMapResponse(object): def setData(self, data): self.data = data + diff --git a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/__init__.py b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/__init__.py index 34367e3..529412e 100644 --- a/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/__init__.py +++ b/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/pgen/response/__init__.py @@ -1,4 +1,6 @@ +# File auto-generated by PythonFileGenerator + __all__ = [ 'ActivityMapData', 'RetrieveActivityMapResponse' @@ -6,3 +8,4 @@ __all__ = [ from .ActivityMapData import ActivityMapData from .RetrieveActivityMapResponse import RetrieveActivityMapResponse + diff --git a/dynamicserialize/dstypes/java/__init__.py b/dynamicserialize/dstypes/java/__init__.py index c0920bb..06f1a98 100644 --- a/dynamicserialize/dstypes/java/__init__.py +++ b/dynamicserialize/dstypes/java/__init__.py @@ -1,7 +1,30 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'awt', - 'lang', 'sql', + 'lang', 'util' ] + + diff --git a/dynamicserialize/dstypes/java/awt/Point.py b/dynamicserialize/dstypes/java/awt/Point.py index 45f4028..7e037b0 100644 --- a/dynamicserialize/dstypes/java/awt/Point.py +++ b/dynamicserialize/dstypes/java/awt/Point.py @@ -1,13 +1,32 @@ +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. + # # Custom python class representing a java.awt.Point. -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 08/31/10 njensen Initial Creation. -# +# +# # @@ -16,10 +35,10 @@ class Point(object): def __init__(self): self.x = None self.y = None - + def __str__(self): return str((self.x, self.y)) - + def __repr__(self): return self.__str__() @@ -28,9 +47,10 @@ class Point(object): def getY(self): return self.y - + def setX(self, x): self.x = x - + def setY(self, y): self.y = y + diff --git a/dynamicserialize/dstypes/java/awt/__init__.py b/dynamicserialize/dstypes/java/awt/__init__.py index 5714b72..d094064 100644 --- a/dynamicserialize/dstypes/java/awt/__init__.py +++ b/dynamicserialize/dstypes/java/awt/__init__.py @@ -1,16 +1,40 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + + # # Package definition for java.awt -# -# +# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 08/31/10 njensen Initial Creation. +# +# # -__all__ = [ - 'Point' - ] + +__all__ = [ + 'Point', + ] from .Point import Point diff --git a/dynamicserialize/dstypes/java/lang/StackTraceElement.py b/dynamicserialize/dstypes/java/lang/StackTraceElement.py index 3262c40..65bf11a 100644 --- a/dynamicserialize/dstypes/java/lang/StackTraceElement.py +++ b/dynamicserialize/dstypes/java/lang/StackTraceElement.py @@ -1,4 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# File auto-generated against equivalent DynamicSerialize Java class class StackTraceElement(object): @@ -7,45 +27,47 @@ class StackTraceElement(object): self.methodName = None self.fileName = None self.lineNumber = 0 - + def getDeclaringClass(self): return self.declaringClass - + def setDeclaringClass(self, clz): self.declaringClass = clz - + def getMethodName(self): return self.methodName - + def setMethodName(self, methodName): self.methodName = methodName - + def getFileName(self): return self.fileName - + def setFileName(self, filename): self.fileName = filename - + def getLineNumber(self): return self.lineNumber - + def setLineNumber(self, lineNumber): self.lineNumber = int(lineNumber) - + def isNativeMethod(self): - return self.lineNumber == -2 - + return (self.lineNumber == -2) + def __str__(self): return self.__repr__() - + def __repr__(self): - msg = self.declaringClass.decode('cp437') + "." + self.methodName.decode('cp437') + msg = self.declaringClass + "." + self.methodName if self.isNativeMethod(): msg += "(Native Method)" elif self.fileName is not None and self.lineNumber >= 0: - msg += "(" + self.fileName.decode('cp437') + ":" + str(self.lineNumber) + ")" + msg += "(" + self.fileName + ":" + str(self.lineNumber) + ")" elif self.fileName is not None: - msg += "(" + self.fileName.decode('cp437') + ")" + msg += "(" + self.fileName + ")" else: msg += "(Unknown Source)" return msg + + diff --git a/dynamicserialize/dstypes/java/lang/__init__.py b/dynamicserialize/dstypes/java/lang/__init__.py index dabec42..0851daf 100644 --- a/dynamicserialize/dstypes/java/lang/__init__.py +++ b/dynamicserialize/dstypes/java/lang/__init__.py @@ -1,6 +1,28 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'StackTraceElement' ] from .StackTraceElement import StackTraceElement + diff --git a/dynamicserialize/dstypes/java/sql/Timestamp.py b/dynamicserialize/dstypes/java/sql/Timestamp.py index fef3a19..93058fd 100644 --- a/dynamicserialize/dstypes/java/sql/Timestamp.py +++ b/dynamicserialize/dstypes/java/sql/Timestamp.py @@ -1,6 +1,29 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class +# and then modified post-generation to add additional features to better +# match Java implementation. Unlike real timestamp, does not support nanos precision. +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # ??/??/?? xxxxxxxx Initial Creation. @@ -11,12 +34,10 @@ from dynamicserialize.dstypes.java.util import Date from time import gmtime, strftime - class Timestamp(Date): def __init__(self, time=None): super(Timestamp, self).__init__(time) def __repr__(self): - return strftime("%Y-%m-%d %H:%M:%S.", gmtime(self.time/1000.0)) + \ - '{:03d}'.format(self.time % 1000) + return strftime("%Y-%m-%d %H:%M:%S.", gmtime(self.time/1000.0)) + '{:03d}'.format(self.time%1000) \ No newline at end of file diff --git a/dynamicserialize/dstypes/java/sql/__init__.py b/dynamicserialize/dstypes/java/sql/__init__.py index a6f3bc1..2c5ddc8 100644 --- a/dynamicserialize/dstypes/java/sql/__init__.py +++ b/dynamicserialize/dstypes/java/sql/__init__.py @@ -1,3 +1,24 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'Timestamp' diff --git a/dynamicserialize/dstypes/java/util/Calendar.py b/dynamicserialize/dstypes/java/util/Calendar.py index 85bcba0..89b13b5 100644 --- a/dynamicserialize/dstypes/java/util/Calendar.py +++ b/dynamicserialize/dstypes/java/util/Calendar.py @@ -1,30 +1,50 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +## # Custom python class representing a java.util.GregorianCalendar. # # This is a stripped-down version of the class that only supports # minimal methods for serialization. -# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 09/29/10 wldougher Initial Creation. -# - -from . import GregorianCalendar - - +# +# +## class Calendar(object): - + """ +""" def __init__(self): self.time = None - # Methods from the real class that we typically use + # Methods from the real class that we typically use @staticmethod def getInstance(): return GregorianCalendar() - + def getTimeInMillis(self): return self.time - + def setTimeInMillis(self, timeInMillis): self.time = timeInMillis diff --git a/dynamicserialize/dstypes/java/util/Date.py b/dynamicserialize/dstypes/java/util/Date.py index 693ab86..97879dd 100644 --- a/dynamicserialize/dstypes/java/util/Date.py +++ b/dynamicserialize/dstypes/java/util/Date.py @@ -1,3 +1,23 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +# ---------------------------------------------------------------------------- # # SOFTWARE HISTORY # @@ -6,6 +26,7 @@ # 04/28/2015 4027 randerso Added optional construction parameter to set the time # 06/26/2015 4480 dgilling Implement __eq__ and __hash__. # +## from time import gmtime, strftime @@ -14,21 +35,21 @@ class Date(object): def __init__(self, timeInMillis=None): self.time = timeInMillis - + def getTime(self): return self.time - + def setTime(self, timeInMillis): self.time = timeInMillis def __str__(self): return self.__repr__() - + def __repr__(self): return strftime("%b %d %y %H:%M:%S GMT", gmtime(self.time/1000.0)) - + def __eq__(self, other): - return self.time == other.time + return self.time == other.time def __ne__(self, other): return not self.__eq__(other) diff --git a/dynamicserialize/dstypes/java/util/EnumSet.py b/dynamicserialize/dstypes/java/util/EnumSet.py index 35ff3fa..e6af671 100644 --- a/dynamicserialize/dstypes/java/util/EnumSet.py +++ b/dynamicserialize/dstypes/java/util/EnumSet.py @@ -1,3 +1,23 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + ## # NOTE: Please do not ever use this class unless you really must. It is not # designed to be directly accessed from client code. Hide its use from end- @@ -10,39 +30,39 @@ # a new instance of this class, you must specify the name of the Java enum # contained within as this is needed for serialization. Do not append the # "dynamicserialize.dstypes" portion of the Python package to the supplied -# class name as Java won't know what class that is when deserializing. +# class name as Java won't know what class that is when deserializing. # # Since Python has no concept of enums, this class cannot provide the value- # checking that Java class does. Be very sure that you add only valid enum -# values to your EnumSet. +# values to your EnumSet. ## -import collections.abc +import collections -class EnumSet(collections.abc.MutableSet): - +class EnumSet(collections.MutableSet): + def __init__(self, enumClassName, iterable=[]): self.__enumClassName = enumClassName self.__set = set(iterable) - + def __repr__(self): return "EnumSet({0})".format(list(self.__set)) def __len__(self): return len(self.__set) - + def __contains__(self, key): return key in self.__set - + def __iter__(self): return iter(self.__set) - + def add(self, value): self.__set.add(value) - + def discard(self, value): self.__set.discard(value) - + def getEnumClass(self): return self.__enumClassName diff --git a/dynamicserialize/dstypes/java/util/GregorianCalendar.py b/dynamicserialize/dstypes/java/util/GregorianCalendar.py index 605ea46..10c4323 100644 --- a/dynamicserialize/dstypes/java/util/GregorianCalendar.py +++ b/dynamicserialize/dstypes/java/util/GregorianCalendar.py @@ -1,29 +1,50 @@ -# +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +## # Custom python class representing a java.util.GregorianCalendar. # # This is a stripped-down version of the class that only supports # minimal methods for serialization. -# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 09/29/10 wldougher Initial Creation. -# - - +# +# +## class GregorianCalendar(object): - + """ +""" def __init__(self): self.time = None - # Methods from the real class that we typically use + # Methods from the real class that we typically use @staticmethod def getInstance(): return GregorianCalendar() - + def getTimeInMillis(self): return self.time - + def setTimeInMillis(self, timeInMillis): self.time = timeInMillis diff --git a/dynamicserialize/dstypes/java/util/__init__.py b/dynamicserialize/dstypes/java/util/__init__.py index 0fc1b2e..4330481 100644 --- a/dynamicserialize/dstypes/java/util/__init__.py +++ b/dynamicserialize/dstypes/java/util/__init__.py @@ -1,8 +1,29 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator __all__ = [ 'Calendar', 'Date', - 'EnumSet', + 'EnumSet', 'GregorianCalendar' ] @@ -10,3 +31,4 @@ from .Calendar import Calendar from .Date import Date from .EnumSet import EnumSet from .GregorianCalendar import GregorianCalendar + diff --git a/dynamicserialize/dstypes/org/__init__.py b/dynamicserialize/dstypes/org/__init__.py new file mode 100644 index 0000000..37ec021 --- /dev/null +++ b/dynamicserialize/dstypes/org/__init__.py @@ -0,0 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator + +__all__ = [ + 'locationtech', + ] + + diff --git a/dynamicserialize/dstypes/org/locationtech/__init__.py b/dynamicserialize/dstypes/org/locationtech/__init__.py new file mode 100644 index 0000000..28b918b --- /dev/null +++ b/dynamicserialize/dstypes/org/locationtech/__init__.py @@ -0,0 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator + +__all__ = [ + 'jts' + ] + + diff --git a/dynamicserialize/dstypes/org/locationtech/jts/__init__.py b/dynamicserialize/dstypes/org/locationtech/jts/__init__.py new file mode 100644 index 0000000..8c68cc4 --- /dev/null +++ b/dynamicserialize/dstypes/org/locationtech/jts/__init__.py @@ -0,0 +1,27 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator + +__all__ = [ + 'geom' + ] + + diff --git a/dynamicserialize/dstypes/org/locationtech/jts/geom/Coordinate.py b/dynamicserialize/dstypes/org/locationtech/jts/geom/Coordinate.py new file mode 100644 index 0000000..55a64f1 --- /dev/null +++ b/dynamicserialize/dstypes/org/locationtech/jts/geom/Coordinate.py @@ -0,0 +1,46 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated against equivalent DynamicSerialize Java class + +class Coordinate(object): + + def __init__(self, x=None, y=None): + self.x = x + self.y = y + + def getX(self): + return self.x + + def getY(self): + return self.y + + def setX(self, x): + self.x = x + + def setY(self, y): + self.y = y + + def __str__(self): + return str((self.x, self.y)) + + def __repr__(self): + return self.__str__() + diff --git a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Envelope.py b/dynamicserialize/dstypes/org/locationtech/jts/geom/Envelope.py similarity index 55% rename from dynamicserialize/dstypes/com/vividsolutions/jts/geom/Envelope.py rename to dynamicserialize/dstypes/org/locationtech/jts/geom/Envelope.py index 7491741..a66df4e 100644 --- a/dynamicserialize/dstypes/com/vividsolutions/jts/geom/Envelope.py +++ b/dynamicserialize/dstypes/org/locationtech/jts/geom/Envelope.py @@ -1,16 +1,36 @@ -# This class is a dummy implementation of the -# com.vividsolutions.jts.geom.Envelope class. It was simply created to allow +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# This class is a dummy implementation of the +# org.locationtech.jts.geom.Envelope class. It was simply created to allow # serialization/deserialization of IDataRequest objects from the Data Access -# Framework. This should be re-implemented if useful work needs to be +# Framework. This should be re-implemented if useful work needs to be # performed against serialized Envelope objects. -# +# # SOFTWARE HISTORY -# +# # Date Ticket# Engineer Description # ------------ ---------- ----------- -------------------------- # 05/29/13 2023 dgilling Initial Creation. # - +# class Envelope(object): @@ -45,3 +65,4 @@ class Envelope(object): def setMinY(self, value): self.miny = value + diff --git a/dynamicserialize/dstypes/org/locationtech/jts/geom/Geometry.py b/dynamicserialize/dstypes/org/locationtech/jts/geom/Geometry.py new file mode 100644 index 0000000..4192e0b --- /dev/null +++ b/dynamicserialize/dstypes/org/locationtech/jts/geom/Geometry.py @@ -0,0 +1,37 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# This class is a dummy implementation of the +# org.locationtech.jts.geom.Geometry class. It was simply created to allow +# serialization/deserialization of GridLocation objects. This should be +# reimplemented if useful work needs to be performed against serialized +# Geometry objects. + +class Geometry(object): + + def __init__(self): + self.binaryData = None + + def getBinaryData(self): + return self.binaryData + + def setBinaryData(self, data): + self.binaryData = data + diff --git a/dynamicserialize/dstypes/org/locationtech/jts/geom/__init__.py b/dynamicserialize/dstypes/org/locationtech/jts/geom/__init__.py new file mode 100644 index 0000000..0e16f04 --- /dev/null +++ b/dynamicserialize/dstypes/org/locationtech/jts/geom/__init__.py @@ -0,0 +1,32 @@ +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +# File auto-generated by PythonFileGenerator + +__all__ = [ + 'Coordinate', + 'Envelope', + 'Geometry' + ] + +from .Coordinate import Coordinate +from .Envelope import Envelope +from .Geometry import Geometry + diff --git a/thrift/ThriftStreamSerializer.class b/thrift/ThriftStreamSerializer.class new file mode 100644 index 0000000000000000000000000000000000000000..9a61a790367eabc5c3b2cdb27e9757ef4a405c8d GIT binary patch literal 1667 zcmcIl?M@Rx6g|@x7PiY*1r#fairVtE;&)Pmn2Ls2z`%xtUuM`2WyyB8?#>eMNqh|T z2O59)06vuQ?ng_Z#7Kxgc4qGM&N=s3jRSFFcFe)<-Taa*(^8wIg*Snl_{-czq*r5T1ez!{8p@=eo_En!dKZ zCrqiJn_=O6G^ddnwDQ`jv9xNuH@4m_G2|-8G~{eKwGu;L*>!x$9l6QvK=dHXFwPqd z+cM+etA`G+Tjp#tCBe}B+;S|rz>qE!HyJWzw<=VmF{nX9AHzV!a>Qy--xi+1w{1F+ ztGFh&H#w<7cCwj~yOz(eQaN9me^rwb>TQd3y3m$#tZXUXv0QyEkc~jbs+Gb-)TIMc zG{P(M6^t>IP6tMIo$j+q5DV12%E)RV^dgUO1=kqX{|V()Eb|Gl74Gnw@Fq`e8ix&` z;W}>6J;W8oV01`$W~ArhD5c*3;lhhHFzZ*z~(X$JRAzKyAN}(1gCZ$M)x9qglU1x!Y!s{AlFw2m#9EOn= zL;FdFe$tb=R|-dlRlzV^D7L}1T3p?51J4w%t*{mIXFo%8;nP4b#OHQR4J<(KiMKJv8^y+n9oi46W$}ps}BJbeb8>T~psM@Fj8?qOm*LoJWqLRju8KF+Z{t0TxQa~|c z(lCW-Vql@V9ZYX%Cq+!zgy{%#pUF%i3_B*O5YY-{T8W6lV9C8jl*N6_6F9>IJftyH mVK%aXbWS}6i#6D4(;%IIr07p3q